diff options
Diffstat (limited to 'lib/sisu/v0/sst_convert_markup.rb')
-rw-r--r-- | lib/sisu/v0/sst_convert_markup.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/sisu/v0/sst_convert_markup.rb b/lib/sisu/v0/sst_convert_markup.rb index 9eeb22b9..e1e691f7 100644 --- a/lib/sisu/v0/sst_convert_markup.rb +++ b/lib/sisu/v0/sst_convert_markup.rb @@ -79,7 +79,8 @@ module SiSU_Modify end def message(text) response='' - unless @opt.cmd=~/QQ/ or @opt.cmd=~/q/ + unless @opt.cmd=~/QQ/ \ + or @opt.cmd=~/q/ response=@ask.response?(%{#{ text}\nProceed? }) end end @@ -196,7 +197,8 @@ WOK end def conversion #%% do it --------------------------> - if @opt.files and @opt.files.length > 0 + if @opt.files \ + and @opt.files.length > 0 mr=nil #%% changes to make m match, r replace --------------------------> if @opt.mod.inspect =~/--help/; help @@ -234,15 +236,16 @@ WOK @new,@matched,@flag_start,@flag_end,@empty1,@empty2=true,false,false,false,false,false o="#{i}.bk" #o is for old markup_version=SiSU_Markup::Markup_identify.new(@opt).markup_version? - if (@opt.mod.inspect=~/37/ and markup_version=~/0.38/) or - (@opt.mod.inspect=~/current|38/ and markup_version=~/0.37/) + if (@opt.mod.inspect=~/37/ and markup_version=~/0.38/) \ + or (@opt.mod.inspect=~/current|38/ and markup_version=~/0.37/) puts "#{i} #{markup_version}" file=File.open(i,'r') cont=file.readlines file.close cont.each do |y| match_and_replace.each do |m,r,w| - if y =~m and y =~w + if y =~m \ + and y =~w if @new @new=false File.unlink(o) if File.exist?(o) @@ -262,9 +265,11 @@ WOK if y =~end_processing @flag_end=true end - if @flag_start and not @flag_end + if @flag_start \ + and not @flag_end match_and_replace.each do |m,r,w| - if y =~m and y =~w + if y =~m \ + and y =~w puts m.inspect + ' -> ' + r unless @opt.cmd=~/q/ puts "in: #{y}" if @opt.cmd=~/[vVM]/ y.gsub!(m,r) if m and r |