From 1323f18af45ea0d3aaef5cd9ead0efb5de8b9729 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 19 Apr 2015 14:44:38 -0400 Subject: c<-d: sync, roll develop into current dir branch (5==6) * two dir branches, same library contents (v5 synced & updated with v6) --- lib/sisu/current/se_version.rb | 54 ++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'lib/sisu/current/se_version.rb') diff --git a/lib/sisu/current/se_version.rb b/lib/sisu/current/se_version.rb index 464af3d9..bbbf5962 100644 --- a/lib/sisu/current/se_version.rb +++ b/lib/sisu/current/se_version.rb @@ -75,7 +75,7 @@ module SiSU_Info_Version end @@lib_path=nil def get_version - @version={} + version={} @pwd=ENV['PWD'] lib_path= @@lib_path \ @@ -83,19 +83,47 @@ module SiSU_Info_Version : `echo $RUBYLIB`.split(':') @@lib_path ||=lib_path if File.exist?(SiSU_is.version_info_path?) - @version=YAML::load(File::open(SiSU_is.version_info_path?)) + version=YAML::load(File::open(SiSU_is.version_info_path?)) end - @version[:install_method]=if SiSU_is.runtime_type? ==:gem_install + 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.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) \ ? ' (ruby gem install)' : '' else '' end - @version[:branch_name]=SiSU_is.branch_name? - @version[:branch_version]=SiSU_is.branch_version? - @version[:branch_number]=/^v([0-9]+)$/.match(@version[:branch_version])[1] - @version + @version=version + def version_details_hash + @version + end + def project + version_details_hash[:project] + end + def date + version_details_hash[:date] + end + def date_stamp + version_details_hash[:date_stamp] + end + def version + version_details_hash[:version] + end + def branch_version + version_details_hash[:branch_version] + end + def branch_number + version_details_hash[:branch_number] + end + def branch_name + version_details_hash[:branch_name] + end + def install_method + version_details_hash[:install_method] + end + self end def rbversion %x{ruby -v}.strip @@ -118,7 +146,7 @@ module SiSU_Info_About def sisu_version version=SiSU_Env::InfoVersion.instance.get_version rb_ver=SiSU_Env::InfoVersion.instance.rbversion - if version[:version] + if version.version opt_cmd=if defined? @color.cmd \ and @color.cmd =~/[ck]/ @color.cmd @@ -126,11 +154,11 @@ module SiSU_Info_About end SiSU_Screen::Ansi.new( opt_cmd, - version[:project], - version[:version], - version[:date_stamp], - version[:date], - version[:install_method], + version.project, + version.version, + version.date_stamp, + version.date, + version.install_method, rb_ver ).version else puts 'SiSU (version information not available)' -- cgit v1.2.3