aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/sisu4
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sisu4')
-rw-r--r--bin/sisu438
1 files changed, 37 insertions, 1 deletions
diff --git a/bin/sisu4 b/bin/sisu4
index 9d27ad6d..ec515326 100644
--- a/bin/sisu4
+++ b/bin/sisu4
@@ -41,6 +41,15 @@ WOK
rbv_sisu_dev='1.9.2'
ruby_version_ok?(rbv_sisu_dev)
end
+ def require_hub_path(sisu_path_specified_lib_)
+ sisu_path_lib=if sisu_path_specified_lib_ \
+ && FileTest.file?("#{sisu_path_specified_lib_}/#{SiSU_lib}/hub.rb")
+ "#{sisu_path_specified_lib_}/#{SiSU_lib}"
+ else
+ SiSU_lib
+ end
+ end
+#% sisu branch
$VERBOSE=nil
$KCODE='u' if RUBY_VERSION < '1.9'
argv=$*
@@ -58,8 +67,34 @@ WOK
check_sisu_stable_ruby_version?
'v4'
end
+#% $0
+ e=Config::CONFIG
+ SiSU_lib="sisu/#{SiSU_version_dir}"
+ sisu_path_specified_lib_=if $0 =~ /^#{e['bindir']}\/sisu[34]?$/
+ nil
+ elsif $0 !~ /^#{e['bindir']}\/sisu[34]?$/ \
+ && $0 =~/bin\/sisu[34]?$/ \
+ && FileTest.file?($0)
+ $0.sub(/bin\/sisu[34]?$/,'lib').
+ sub(/^lib$/,"#{Dir.pwd}/lib")
+ elsif $0 !~ /^#{e['bindir']}\/sisu[34]?$/ \
+ && $0 =~/^sisu[34]?$/ \
+ && FileTest.file?($0)
+ $0.sub(/sisu[34]?$/,'../lib')
+ #bug, relative path does not work for sisu version information
+ else
+ nil
+ end
+ SiSU_path_specified_Version_=if sisu_path_specified_lib_
+ sisu_path_specified_lib_.sub(/\/lib/,
+ "/data/sisu/#{SiSU_version_dir}/v/version.yml")
+ else
+ nil
+ end
+ SiSU_path_lib="#{require_hub_path(sisu_path_specified_lib_)}"
+#%
SiSU_lib="sisu/#{SiSU_version_dir}"
- require "#{SiSU_lib}/hub"
+ require "#{SiSU_path_lib}/hub"
SiSU::HubMaster.new(argv)
rescue
STDERR.puts 'ERROR'
@@ -79,6 +114,7 @@ rescue
system RUBYPATH: ${RUBYPATH}
system RUBYLIB: ${RUBYLIB}
"})
+#ensure
end
__END__