From 17f1f887c2542e3e92139cd9ccb1eed9bd2420e3 Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph@amissah.com>
Date: Mon, 6 Jan 2014 21:59:03 -0500
Subject: v5: date 2014: headers bin/sisu & lib/; code constants.rb

---
 bin/sisu | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'bin')

diff --git a/bin/sisu b/bin/sisu
index 501e439b..2b31dc9b 100644
--- a/bin/sisu
+++ b/bin/sisu
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 # encoding: utf-8
-#SiSU: copyright (C) 1997 - 2013 Ralph Amissah; License GPL, see appended program information
+#SiSU: copyright (C) 1997 - 2014 Ralph Amissah; License GPL 3, see appended program information
 begin
   def ruby_version_ok?(base_version)
     @v ||=RUBY_VERSION.scan(/\d+/)
@@ -172,7 +172,8 @@ __END__
  * Author: Ralph Amissah
 
  * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-   2007, 2008, 2009, 2010, 2011, 2012, 2013 Ralph Amissah, All Rights Reserved.
+   2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Ralph Amissah,
+   All Rights Reserved.
 
  * License: GPL 3 or later:
 
-- 
cgit v1.2.3


From 42aae8da2b103b4038cfb2fc24591b9004972d4a Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph@amissah.com>
Date: Mon, 6 Jan 2014 22:03:06 -0500
Subject: bin/sisu, version dir (fix) & version info

* (ensure SiSU_version_dir) fix
* sisu version info, yml info also when installed via ruby gem
* downstream libs
---
 bin/sisu | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

(limited to 'bin')

diff --git a/bin/sisu b/bin/sisu
index 2b31dc9b..102d10d1 100644
--- a/bin/sisu
+++ b/bin/sisu
@@ -58,15 +58,20 @@ WOK
   check_sisu_stable_ruby_version?
   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'
+    SiSU_version_dir=case __FILE__
+    when /\/sisu-5\.(?:\d+|[a-z])\.(?:\d+|[a-z])\//   then 'v5'
+    when /\/sisu-4\.(?:\d+|[a-z])\.(?:\d+|[a-z])\//   then 'v4'
+    else                                                   'v4'
+    end
+  else                                                     'v4'
   end
-  if $0 =~/\bsisu4$/                             then 'v4'
-  elsif $0 =~/\bsisu5$/                          then 'v5'
+  SiSU_version_dir=case $0
+  when /\bsisu4$/                                     then 'v4'
+  when /\bsisu5$/                                     then 'v5'
   else
-    SiSU_version_dir=case argv.inspect
-    when /"(?:--v4|--current|--stable)"/         then 'v4'
-    when /"(?:--v5|--next|--dev)"/               then 'v5'
+    case argv.inspect
+    when /"(?:--v4|--current|--stable)"/              then 'v4'
+    when /"(?:--v5|--next|--dev)"/                    then 'v5'
     else default_version
     end
   end
@@ -85,9 +90,13 @@ WOK
   sisu_path_specified_lib_=SiSU_path_base \
   ? File.expand_path($0).sub(/bin\/sisu[45]?$/,'lib')
   : nil
-  SiSU_path_specified_Version_=SiSU_path_base \
-  ? "#{SiSU_path_base}/data/sisu/#{SiSU_version_dir}/v/version.yml"
-  : nil
+  SiSU_path_specified_Version_=if __FILE__ =~/gem/
+    spec = Gem::Specification.find_by_name("sisu")
+    spec.gem_dir + "/data/sisu/#{SiSU_version_dir}/v/version.yml"
+  elsif SiSU_path_base
+    "#{SiSU_path_base}/data/sisu/#{SiSU_version_dir}/v/version.yml"
+  else nil
+  end
   SiSU_path_lib="#{require_hub_path(sisu_path_specified_lib_)}"
 #% $*
   require "#{SiSU_path_lib}/hub"
-- 
cgit v1.2.3