aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-12-03 20:44:02 -0500
committerRalph Amissah <ralph@amissah.com>2013-12-03 20:44:02 -0500
commit8295509e9a4098e24008dc7403dabb54e33db621 (patch)
treea2e170fbe596c7c3d3450748934df7f403d03e1c /bin
parentdebian/changelog (4.2.13-1) (diff)
parentv4 v5: bin/sisu, simplify in relation to sisu gem (diff)
Merge tag 'sisu_4.2.14' into debian/sid
SiSU 4.2.14
Diffstat (limited to 'bin')
-rw-r--r--bin/sisu38
1 files changed, 11 insertions, 27 deletions
diff --git a/bin/sisu b/bin/sisu
index 0786500f..501e439b 100644
--- a/bin/sisu
+++ b/bin/sisu
@@ -56,34 +56,18 @@ WOK
SiSU_called_from_directory=Dir.pwd
require 'rubygems'
check_sisu_stable_ruby_version?
- if __FILE__ =~/gem/ \
- and __FILE__ =~/sisu-[45]\.\d+\.\d+/
- SiSU_version_dir=(__FILE__ =~/sisu-5\.\d+\.\d+/) \
- ? 'v5'
- : 'v4'
- elsif $0 !~/\b(?:sisu[45]|sisugem)$/
- SiSU_version_dir=case argv.inspect
- when /"(?:--v4)"/
- 'v4'
- when /"(?:--v5)"/
- 'v5'
- when /"--dev"/
- 'v5'
- else
- 'v4'
- end
+ default_version=if __FILE__ =~/gem/ \
+ and __FILE__ =~/\/sisu-[45]\.(?:\d+|[a-z])\.(?:\d+|[a-z])\//
+ SiSU_version_dir=(__FILE__ =~/\/sisu-5\.(?:\d+|[a-z])\.(?:\d+|[a-z])\//) ? 'v5' : 'v4'
+ else 'v4'
+ end
+ if $0 =~/\bsisu4$/ then 'v4'
+ elsif $0 =~/\bsisu5$/ then 'v5'
else
- SiSU_version_dir=case $0
- when /\bsisu4$/
- 'v4'
- when /\bsisu5$/
- 'v5'
- when /sisugem$/ # should have been caught earlier, unused, debug check
- SiSU_version_dir=(__FILE__ =~/sisu-5\.\d+\.\d+/) \
- ? 'v5'
- : 'v4'
- else
- 'v4'
+ SiSU_version_dir=case argv.inspect
+ when /"(?:--v4|--current|--stable)"/ then 'v4'
+ when /"(?:--v5|--next|--dev)"/ then 'v5'
+ else default_version
end
end
#% $0 File.expand_path($0)