summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2015-04-07 02:34:28 +0000
committerRalph Amissah <ralph@amissah.com>2015-04-09 03:05:39 +0000
commit906634e9ac9793110f2fd6bd6e215a66c84932cd (patch)
treee45374dbe54d8d66602df0fb98cc1473fa68875e /lib
parentc&d: se_programs for "which" i/o redirection of error message (diff)
downloadsisu-906634e9ac9793110f2fd6bd6e215a66c84932cd.zip
sisu-906634e9ac9793110f2fd6bd6e215a66c84932cd.tar.xz
c&d: pass info needed make run better without install
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/current/hub.rb4
-rw-r--r--lib/sisu/current/hub_options.rb14
-rw-r--r--lib/sisu/current/se_version.rb2
-rw-r--r--lib/sisu/current/utils.rb6
-rw-r--r--lib/sisu/develop/hub.rb4
-rw-r--r--lib/sisu/develop/hub_options.rb35
-rw-r--r--lib/sisu/develop/se_version.rb2
-rw-r--r--lib/sisu/develop/utils.rb6
8 files changed, 61 insertions, 12 deletions
diff --git a/lib/sisu/current/hub.rb b/lib/sisu/current/hub.rb
index 6b0832e..eb6ab19 100644
--- a/lib/sisu/current/hub.rb
+++ b/lib/sisu/current/hub.rb
@@ -72,9 +72,9 @@ module SiSU
error('uri NOT FOUND (LoadError)')
end
class HubMaster
- def initialize(argv,call_path)
+ def initialize(argv,sisu_runtime)
begin
- opt=SiSU_Commandline::Options.new(argv,call_path)
+ opt=SiSU_Commandline::Options.new(argv,sisu_runtime)
SiSU::Processing.new(opt).actions_without_files
SiSU::Processing.new(opt).actions_on_files
SiSU::Processing.new(opt).actions_without_files_post
diff --git a/lib/sisu/current/hub_options.rb b/lib/sisu/current/hub_options.rb
index 40775a3..3539875 100644
--- a/lib/sisu/current/hub_options.rb
+++ b/lib/sisu/current/hub_options.rb
@@ -152,9 +152,9 @@ module SiSU_Commandline
end
end
class Options
- attr_accessor :selections,:opt_ch,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod
+ attr_accessor :selections,:opt_ch,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod,:sisu_run_path,:sisu_install_type
@@act=nil
- def initialize(a,call_path)
+ def initialize(a,sisu_runtime)
@opt_ch=@f_pth=@pth=@fno=@fns=@fnb=@fnc=@fng=@fncb=@what=@lng=@lng_base=@call_path=@base_path=@base_stub=@image_src_path=@sub_location=''
@f_pths,@files,@files_mod,@paths,@select_arr,@act=Array.new(5){[]}
@select_str=nil
@@ -162,7 +162,9 @@ module SiSU_Commandline
@lng_base=@env.language_default_set
@dir_structure_by=SiSU_Env::EnvCall.new.output_dir_structure.by?
@lingual=SiSU_Env::EnvCall.new.mono_multi_lingual?
- @call_path=call_path
+ @sisu_run_from=sisu_runtime[:runtime_path]
+ @sisu_install_type=sisu_runtime[:runtime_type]
+ @call_path=sisu_runtime[:call_path]
pth=SiSU_Utils::Path.new(call_path)
@base_path=pth.base_markup
@base_stub=pth.base_markup_stub
@@ -173,6 +175,12 @@ module SiSU_Commandline
@make_instructions_pod=nil
init
end
+ def sisu_run_from?
+ @sisu_run_from
+ end
+ def sisu_install_type?
+ @sisu_install_type
+ end
def find_all(find_flag,opt)
if find_flag
x=Dir.glob('*.ss[tm]')
diff --git a/lib/sisu/current/se_version.rb b/lib/sisu/current/se_version.rb
index 156b440..464af3d 100644
--- a/lib/sisu/current/se_version.rb
+++ b/lib/sisu/current/se_version.rb
@@ -85,7 +85,7 @@ module SiSU_Info_Version
if File.exist?(SiSU_is.version_info_path?)
@version=YAML::load(File::open(SiSU_is.version_info_path?))
end
- @version[:install_method]=if SiSU_is.run_from? ==:gem_install
+ @version[:install_method]=if SiSU_is.runtime_type? ==:gem_install
spec = Gem::Specification.find_by_name("sisu")
gem_root = spec.gem_dir
(File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_is.branch_name?}/,'')) == gem_root) \
diff --git a/lib/sisu/current/utils.rb b/lib/sisu/current/utils.rb
index 1049fdf..53e28fd 100644
--- a/lib/sisu/current/utils.rb
+++ b/lib/sisu/current/utils.rb
@@ -132,6 +132,12 @@ module SiSU_Utils
def mark(v=nil,x=nil)
puts set(v,x)
end
+ def tell(v=nil,x=nil)
+ puts set(v,x)
+ end
+ def report(v=nil,x=nil)
+ puts set(v,x)
+ end
def ok(v=nil,x=nil)
if (v.is_a?(Symbol) \
and x.is_a?(String))
diff --git a/lib/sisu/develop/hub.rb b/lib/sisu/develop/hub.rb
index 1b5ac58..26a2af7 100644
--- a/lib/sisu/develop/hub.rb
+++ b/lib/sisu/develop/hub.rb
@@ -72,9 +72,9 @@ module SiSU
error('uri NOT FOUND (LoadError)')
end
class HubMaster
- def initialize(argv,call_path)
+ def initialize(argv,sisu_runtime)
begin
- opt=SiSU_Commandline::Options.new(argv,call_path)
+ opt=SiSU_Commandline::Options.new(argv,sisu_runtime)
SiSU::Processing.new(opt).actions_without_files
SiSU::Processing.new(opt).actions_on_files
SiSU::Processing.new(opt).actions_without_files_post
diff --git a/lib/sisu/develop/hub_options.rb b/lib/sisu/develop/hub_options.rb
index f6a40be..1c3f4e3 100644
--- a/lib/sisu/develop/hub_options.rb
+++ b/lib/sisu/develop/hub_options.rb
@@ -152,9 +152,9 @@ module SiSU_Commandline
end
end
class Options
- attr_accessor :selections,:opt_ch,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod
+ attr_accessor :selections,:opt_ch,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod,:sisu_run_path,:sisu_install_type
@@act=nil
- def initialize(a,call_path)
+ def initialize(a,sisu_runtime)
@opt_ch=@f_pth=@pth=@fno=@fns=@fnb=@fnc=@fng=@fncb=@what=@lng=@lng_base=@call_path=@base_path=@base_stub=@image_src_path=@sub_location=''
@f_pths,@files,@files_mod,@paths,@select_arr,@act=Array.new(5){[]}
@select_str=nil
@@ -162,7 +162,9 @@ module SiSU_Commandline
@lng_base=@env.language_default_set
@dir_structure_by=SiSU_Env::EnvCall.new.output_dir_structure.by?
@lingual=SiSU_Env::EnvCall.new.mono_multi_lingual?
- @call_path=call_path
+ @sisu_run_from=sisu_runtime[:runtime_path]
+ @sisu_install_type=sisu_runtime[:runtime_type]
+ @call_path=sisu_runtime[:call_path]
pth=SiSU_Utils::Path.new(call_path)
@base_path=pth.base_markup
@base_stub=pth.base_markup_stub
@@ -173,6 +175,33 @@ module SiSU_Commandline
@make_instructions_pod=nil
init
end
+ def sisu_called_from?
+ @call_path
+ end
+ def sisu_bin_filepath?
+ @sisu_run_from
+ end
+ def sisu_install_type?
+ @sisu_install_type
+ end
+ def sisu_lib_dir?
+ File.dirname(__FILE__)
+ end
+ def sisu_data_dir?
+ env=RbConfig::CONFIG
+ if sisu_install_type? ==:full_path_to_sisu_bin_in_sisu_dir_tree
+ sisu_bin_filepath?.gsub(/\/bin\/sisu\S*/,'/data/sisu')
+ #sisu_lib_dir?.gsub(/\/lib\/sisu\/(?:current|develop)\S*/,'/data/sisu')
+ elsif sisu_install_type? ==:gem_install
+ #sisu_run_from?.gsub(/\/bin\/.+/,'/data/sisu')
+ env['datadir']
+ elsif sisu_install_type? ==:system_install
+ #SiSU_Info_Env::InfoEnv.new.path.share
+ env['datadir']
+ else
+ env['datadir']
+ end
+ end
def find_all(find_flag,opt)
if find_flag
x=Dir.glob('*.ss[tm]')
diff --git a/lib/sisu/develop/se_version.rb b/lib/sisu/develop/se_version.rb
index 860faee..157ecc9 100644
--- a/lib/sisu/develop/se_version.rb
+++ b/lib/sisu/develop/se_version.rb
@@ -88,7 +88,7 @@ module SiSU_Info_Version
version[:branch_version]=SiSU_is.branch_version?
version[:branch_number]=/^v([0-9]+)/.match(version[:branch_version])[1]
version[:branch_name]=SiSU_is.branch_name?
- version[:install_method]=if SiSU_is.run_from? ==:gem_install
+ version[:install_method]=if SiSU_is.runtime_type? ==:gem_install
spec = Gem::Specification.find_by_name("sisu")
gem_root = spec.gem_dir
(File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_is.branch_name?}/,'')) == gem_root) \
diff --git a/lib/sisu/develop/utils.rb b/lib/sisu/develop/utils.rb
index f100b2d..a43154f 100644
--- a/lib/sisu/develop/utils.rb
+++ b/lib/sisu/develop/utils.rb
@@ -132,6 +132,12 @@ module SiSU_Utils
def mark(v=nil,x=nil)
puts set(v,x)
end
+ def tell(v=nil,x=nil)
+ puts set(v,x)
+ end
+ def report(v=nil,x=nil)
+ puts set(v,x)
+ end
def ok(v=nil,x=nil)
if (v.is_a?(Symbol) \
and x.is_a?(String))