v4 v5: bin/sisu, simplify in relation to sisu gem sisu_4.2.14
authorRalph Amissah <ralph@amissah.com>
Wed, 4 Dec 2013 01:42:50 +0000 (20:42 -0500)
committerRalph Amissah <ralph@amissah.com>
Wed, 4 Dec 2013 01:42:50 +0000 (20:42 -0500)
bin/sisu
data/doc/sisu/CHANGELOG_v4
data/doc/sisu/CHANGELOG_v5

index 0786500fe2174a19b6e4dcff2bf38b98b10f4506..501e439baf7e659ec6da3ec471c1b1e6c97b41e7 100644 (file)
--- 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)
index 24909dd40d488fb85d4ba61311d7397a28fc409f..f01d56cdbb41ed4b2e4ea97816931cfb0ae17774 100644 (file)
@@ -34,6 +34,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.2.14.orig.tar.xz
   * gemspec adjusted to install only libraries related to a version (v4 or v5)
   * select sisu version to create, build & install
 
+* bin/sisu, simplify in relation to sisu gem
+
 %% 4.2.13.orig.tar.xz (2013-12-02:48/1)
 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.2.13
 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.2.13-1
index aecfa02af038910d13e103773e6761c63786b62d..04eae66448c4a3baa623a3b4b937d1f0872c931f 100644 (file)
@@ -34,6 +34,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.1.1.orig.tar.xz
   * gemspec adjusted to install only libraries related to a version (v4 or v5)
   * select sisu version to create, build & install
 
+* bin/sisu, simplify in relation to sisu gem
+
 %% 5.1.0.orig.tar.xz (2013-12-02:48/1)
 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.1.0
 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.1.0-1