diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-10-23 23:40:45 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-10-23 23:40:45 -0400 |
commit | edd89902036bde18c91031470e19c871a182cf6d (patch) | |
tree | 1269e7b1660aa64896fc21768002e837233c2c24 /lib/sisu/v5/sst_convert_markup.rb | |
parent | v4 v5: version & changelog (diff) |
v5: options & downstream, more use of opt.act instead of opt.cmd
* opt.act.*.set==:on instead of opt.cmd =~/\S/
Diffstat (limited to 'lib/sisu/v5/sst_convert_markup.rb')
-rw-r--r-- | lib/sisu/v5/sst_convert_markup.rb | 27 |
1 files changed, 20 insertions, 7 deletions
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 |