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/sst_convert_markup.rb | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'lib/sisu/v5/sst_convert_markup.rb') diff --git a/lib/sisu/v5/sst_convert_markup.rb b/lib/sisu/v5/sst_convert_markup.rb index cbf40f24..6eaa691e 100644 --- a/lib/sisu/v5/sst_convert_markup.rb +++ b/lib/sisu/v5/sst_convert_markup.rb @@ -79,7 +79,7 @@ module SiSU_Modify def message(text) response='' unless @opt.cmd=~/QQ/ \ - or @opt.cmd=~/q/ + or @opt.act[:quiet][:set]==:on response=@ask.response?(%{#{ text}\nProceed? }) end end @@ -258,7 +258,7 @@ WOK end end if @matched - puts "conversion match in #{i}" unless @opt.cmd=~/q/ + puts "conversion match in #{i}" unless @opt.act[:quiet][:set]==:on @flag_start=true cont.each do |y| if y =~end_processing @@ -269,10 +269,18 @@ WOK match_and_replace.each do |m,r,w| if y =~m \ and y =~w - puts m.inspect + ' -> ' + r unless @opt.cmd=~/q/ - puts "in: #{y}" if @opt.cmd=~/[vVM]/ + puts m.inspect + ' -> ' + r unless @opt.act[:quiet][:set]==:on + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + puts "in: #{y}" + end y.gsub!(m,r) if m and r - puts "out: #{y}" if @opt.cmd=~/[vVM]/ + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + puts "out: #{y}" + end end end end @@ -285,9 +293,14 @@ WOK : false end @file.close - else puts "NO conversion match in #{i}" unless @opt.cmd=~/q/ + else puts "NO conversion match in #{i}" unless @opt.act[:quiet][:set]==:on + end + else + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + puts "Requested conversion #{@opt.mod.inspect} markup #{markup_version} identified in #{i}" end - else puts "Requested conversion #{@opt.mod.inspect} markup #{markup_version} identified in #{i}" if @opt.cmd=~/[vVM]/ end end end -- cgit v1.2.3