diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-01-06 23:05:26 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-01-06 23:05:26 -0500 |
commit | 4075d476731a7a1c29e399d60f6baa210f3d1cb4 (patch) | |
tree | b0fab3d856f64f0562b7b7da317cf79c3b3e05f1 /lib/sisu/v5/sst_convert_markup.rb | |
parent | debian/changelog (4.2.16-1) (diff) | |
parent | v5: heading recalibration, code (downstream) changes (diff) |
Merge tag 'sisu_4.2.17' into debian/sid
SiSU 4.2.17
Diffstat (limited to 'lib/sisu/v5/sst_convert_markup.rb')
-rw-r--r-- | lib/sisu/v5/sst_convert_markup.rb | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/sisu/v5/sst_convert_markup.rb b/lib/sisu/v5/sst_convert_markup.rb index 6eaa691e..cec67960 100644 --- a/lib/sisu/v5/sst_convert_markup.rb +++ b/lib/sisu/v5/sst_convert_markup.rb @@ -8,7 +8,8 @@ * Author: Ralph Amissah * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011, 2012, 2013 Ralph Amissah, All Rights Reserved. + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Ralph Amissah, + All Rights Reserved. * License: GPL 3 or later: @@ -160,9 +161,9 @@ WOK def convert_filename_36_to_37 @opt.files.each do |f| s=case f - when /(\.s[1-3])$/; f.sub($1,'.sst') - when /(\.r[1-3])$/; f.sub($1,'.ssm') - when /(\.ri)$/; f.sub($1,'.ssi') + when /(\.s[1-3])$/ then f.sub($1,'.sst') + when /(\.r[1-3])$/ then f.sub($1,'.ssm') + when /(\.ri)$/ then f.sub($1,'.ssi') else f end pwd=Dir.pwd @@ -203,26 +204,26 @@ WOK if @opt.mod.inspect =~/--help/ then help elsif @opt.mod.inspect =~/(?:convert|to)[=-](?:xml |sxs|sax|sxd|dom|sxn|node)/ ext=case @opt.mod.inspect - when /(?:convert|to)[=-](?:xml|sxs|sax)/; '.sxs.xml' - when /(?:convert|to)[=-](?:sxd|dom)/; '.sxd.xml' - when /(?:convert|to)[=-](?:sxn|node)/; '.sxn.xml' + when /(?:convert|to)[=-](?:xml|sxs|sax)/ then '.sxs.xml' + when /(?:convert|to)[=-](?:sxd|dom)/ then '.sxd.xml' + when /(?:convert|to)[=-](?:sxn|node)/ then '.sxn.xml' end message("#{@opt.files.inspect}\n\nWARNING, PROCEED AT YOUR OWN RISK,\noverwriting any equivalent file with the extension #{ext}") mr=case @opt.mod.inspect - when /(?:convert|to)[=-](?:sxs|sax|xml )/; convert_to_simple_xml_model_sax - when /(?:convert|to)[=-](?:sxd|dom)/; convert_to_simple_xml_model_dom - when /(?:convert|to)[=-](?:sxn|node)/; convert_to_simple_xml_model_node + when /(?:convert|to)[=-](?:sxs|sax|xml )/ then convert_to_simple_xml_model_sax + when /(?:convert|to)[=-](?:sxd|dom)/ then convert_to_simple_xml_model_dom + when /(?:convert|to)[=-](?:sxn|node)/ then convert_to_simple_xml_model_node else help end else mr=case @opt.mod.inspect - when /(?:(?:37)?to-?38|--(?:convert|to)[=-](?:current|0.38))/; convert_37_to_38 - when /(?:(?:38)?to-?37|--(?:convert|to)[=-](?:0.37))/; convert_38_to_37 - when /(?:36to37)/; convert_filename_36_to_37 - when /(?:convert|from)[=-]kdi/; convert_kdi_to_sst - when /(?:(?:convert|from)[=-])?(?:xml_to_sst|xml2sst|sxml|sxs|sxd|sxd)/; convert_s_xml_to_sst - when /(?:convert|to)[=-]footnotes/; convert_footnotes - when /convert|default/; current_match_and_replace + when /(?:(?:37)?to-?38|--(?:convert|to)[=-](?:current|0.38))/ then convert_37_to_38 + when /(?:(?:38)?to-?37|--(?:convert|to)[=-](?:0.37))/ then convert_38_to_37 + when /(?:36to37)/ then convert_filename_36_to_37 + when /(?:convert|from)[=-]kdi/ then convert_kdi_to_sst + when /(?:(?:convert|from)[=-])?(?:xml_to_sst|xml2sst|sxml|sxs|sxd|sxd)/ then convert_s_xml_to_sst + when /(?:convert|to)[=-]footnotes/ then convert_footnotes + when /convert|default/ then current_match_and_replace else help end end |