From 32d773a21da4518a1f6cda697350e7efee3316bf Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 29 Aug 2014 19:34:45 -0400 Subject: v5 v6: hub, sisu version info, when & what to report --- lib/sisu/v5/hub.rb | 1 + lib/sisu/v5/hub_actions.rb | 19 +++++++++++-------- lib/sisu/v5/hub_options.rb | 4 +++- lib/sisu/v6/hub.rb | 1 + lib/sisu/v6/hub_actions.rb | 19 +++++++++++-------- lib/sisu/v6/hub_options.rb | 4 +++- 6 files changed, 30 insertions(+), 18 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb index 68db1f13..eda98084 100644 --- a/lib/sisu/v5/hub.rb +++ b/lib/sisu/v5/hub.rb @@ -207,6 +207,7 @@ module SiSU def actions_without_files actions=SiSU_Hub_Actions::HubActions.new(@opt) actions.report.version_info? + actions.report.version_dir? actions.prepare.site? actions.prepare.sql? end diff --git a/lib/sisu/v5/hub_actions.rb b/lib/sisu/v5/hub_actions.rb index 785f507e..5f99f444 100644 --- a/lib/sisu/v5/hub_actions.rb +++ b/lib/sisu/v5/hub_actions.rb @@ -72,6 +72,17 @@ module SiSU_Hub_Actions SiSU_Env::InfoAbout.new(@opt).sisu_version end end + def version_dir? + if @opt.act[:version_info][:set]==:on \ + || @opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + ' ' + File.dirname(__FILE__) + ).grey + end + end self end def prepare @@ -853,14 +864,6 @@ module SiSU_Hub_Actions end def init? SiSU_Env::InfoProcessingFlag.new - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - ' ' + File.dirname(__FILE__) - ).grey - end if @opt.act[:ao][:set]==:on \ or @opt.act[:maintenance][:set]==:on #% --maintenance, -M env=SiSU_Env::InfoEnv.new(@opt.fns) diff --git a/lib/sisu/v5/hub_options.rb b/lib/sisu/v5/hub_options.rb index bc96b878..d871c9c3 100644 --- a/lib/sisu/v5/hub_options.rb +++ b/lib/sisu/v5/hub_options.rb @@ -316,7 +316,9 @@ module SiSU_Commandline c,w='','' m,f,pth,lng,lngs=[],[],[],[],[] lng_is='' - a=s.split(/\s+/) + a=(s.nil?) \ + ? ['-v'] + : s.split(/\s+/) r_l=Px[:lng_lst].join('|') a.uniq.each do |x| if x =~/^-[a-z0-5]+/i \ diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb index cd66bc17..2558a9db 100644 --- a/lib/sisu/v6/hub.rb +++ b/lib/sisu/v6/hub.rb @@ -207,6 +207,7 @@ module SiSU def actions_without_files actions=SiSU_Hub_Actions::HubActions.new(@opt) actions.report.version_info? + actions.report.version_dir? actions.prepare.site? actions.prepare.sql? end diff --git a/lib/sisu/v6/hub_actions.rb b/lib/sisu/v6/hub_actions.rb index 2be0304b..54d0ccd2 100644 --- a/lib/sisu/v6/hub_actions.rb +++ b/lib/sisu/v6/hub_actions.rb @@ -72,6 +72,17 @@ module SiSU_Hub_Actions SiSU_Env::InfoAbout.new(@opt).sisu_version end end + def version_dir? + if @opt.act[:version_info][:set]==:on \ + || @opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + ' ' + File.dirname(__FILE__) + ).grey + end + end self end def prepare @@ -853,14 +864,6 @@ module SiSU_Hub_Actions end def init? SiSU_Env::InfoProcessingFlag.new - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - ' ' + File.dirname(__FILE__) - ).grey - end if @opt.act[:ao][:set]==:on \ or @opt.act[:maintenance][:set]==:on #% --maintenance, -M env=SiSU_Env::InfoEnv.new(@opt.fns) diff --git a/lib/sisu/v6/hub_options.rb b/lib/sisu/v6/hub_options.rb index 5625963b..336f0d93 100644 --- a/lib/sisu/v6/hub_options.rb +++ b/lib/sisu/v6/hub_options.rb @@ -316,7 +316,9 @@ module SiSU_Commandline c,w='','' m,f,pth,lng,lngs=[],[],[],[],[] lng_is='' - a=s.split(/\s+/) + a=(s.nil?) \ + ? ['-v'] + : s.split(/\s+/) r_l=Px[:lng_lst].join('|') a.uniq.each do |x| if x =~/^-[a-z0-5]+/i \ -- cgit v1.2.3