From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/digests.rb | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'lib/sisu/v5/digests.rb') diff --git a/lib/sisu/v5/digests.rb b/lib/sisu/v5/digests.rb index ea2e81cd..e142ff11 100644 --- a/lib/sisu/v5/digests.rb +++ b/lib/sisu/v5/digests.rb @@ -76,14 +76,21 @@ module SiSU_DigestView def read begin @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array - unless @opt.cmd =~/q/ - tool=(@opt.cmd =~/[MVv]/) \ + unless @opt.act[:quiet][:set]==:on + tool=(@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) \ ? "#{@env.program.text_editor} file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}" : "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}" - @opt.cmd=~/[MVvz]/ \ - ? SiSU_Screen::Ansi.new(@opt.cmd,"Document #{@dg} Digests",tool).green_hi_blue - : SiSU_Screen::Ansi.new(@opt.cmd,"Document #{@dg} Digests",tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").flow if @opt.cmd =~/[MV]/ + (@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],"Document #{@dg} Digests",tool).green_hi_blue + : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"Document #{@dg} Digests",tool).green_title_hi + if @opt.act[:verbose_plus][:set]==:on \ + or @opt.act[:maintenance][:set]==:on + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").flow + end end SiSU_DigestView::Source::Scroll.new(@particulars).songsheet rescue @@ -118,23 +125,23 @@ module SiSU_DigestView output end def description(f,e='') - puts f + e.to_s if @md.opt.cmd =~/V/ + puts f + e.to_s if @md.opt.act[:verbose_plus][:set]==:on @@description << f << e end def digests(f,e='') - puts f if @md.opt.cmd =~/V/ + puts f if @md.opt.act[:verbose_plus][:set]==:on @@ds[:digests] << f + "\n" end def dal_structure_tree(f,e='') - puts f + e.to_s if @md.opt.cmd =~/V/ + puts f + e.to_s if @md.opt.act[:verbose_plus][:set]==:on @@ds[:tree] << f << e end def dal_structure_summary(f,e='') - puts f + e.to_s if @md.opt.cmd =~/V/ + puts f + e.to_s if @md.opt.act[:verbose_plus][:set]==:on @@ds[:summary] << f << e end def rcinfo(f,e='') - puts f + e.to_s if @md.opt.cmd =~/V/ + puts f + e.to_s if @md.opt.act[:verbose_plus][:set]==:on @@sc_info << f << e end def output @@ -201,7 +208,7 @@ module SiSU_DigestView elsif FileTest.file?("#{@env.path.image_source_include}/#{i}") @env.path.image_source_include else - SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.act[:quiet][:set]==:on nil end @img << /\S+\.(png|jpg|gif)/.match(i)[1] -- cgit v1.2.3