From 32d32bf7ecfbc84a58d67a920135ef0bddfb9ee0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 1 Oct 2012 15:40:42 -0400 Subject: v3: cosmetic code, if true ; x, remove semicolons replace with "then" --- data/doc/sisu/CHANGELOG_v3 | 1 + lib/sisu/v3/cgi_pgsql.rb | 4 ++-- lib/sisu/v3/cgi_sql_common.rb | 10 +++++----- lib/sisu/v3/cgi_sqlite.rb | 4 ++-- lib/sisu/v3/composite.rb | 4 ++-- lib/sisu/v3/dal.rb | 2 +- lib/sisu/v3/dal_expand_insertions.rb | 28 ++++++++++++++-------------- lib/sisu/v3/db_import.rb | 6 +++--- lib/sisu/v3/epub_concordance.rb | 2 +- lib/sisu/v3/help.rb | 2 +- lib/sisu/v3/html.rb | 2 +- lib/sisu/v3/manifest.rb | 16 ++++++++-------- lib/sisu/v3/odf.rb | 12 ++++++------ lib/sisu/v3/param.rb | 16 ++++++++-------- lib/sisu/v3/qrcode.rb | 18 +++++++++--------- lib/sisu/v3/response.rb | 6 +++--- lib/sisu/v3/shared_xml.rb | 4 ++-- lib/sisu/v3/sst_convert_markup.rb | 2 +- lib/sisu/v3/sst_do_inline_footnotes.rb | 2 +- lib/sisu/v3/texpdf.rb | 7 ++++--- 20 files changed, 75 insertions(+), 73 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 2a1d6977..7d05b400 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -34,6 +34,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.3.orig.tar.xz * v3: cosmetic, code * true ? x : y * if, else, remove some semicolons (;) replace with newlines + * if true ; x, remove semicolons replace with "then" * v3: sisu -v, provide version information, fix diff --git a/lib/sisu/v3/cgi_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb index f78f65f5..d2c13132 100644 --- a/lib/sisu/v3/cgi_pgsql.rb +++ b/lib/sisu/v3/cgi_pgsql.rb @@ -146,8 +146,8 @@ module SiSU_CGI_PgSQL def string search={ :search => [], :flag => false } if @t =~/\S+/ or @q =~/\S+/ - if @t =~/\S+/; unescaped_search=CGI.unescape(@t) - elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) + if @t =~/\S+/ then unescaped_search=CGI.unescape(@t) + elsif @q =~/\S+/ then unescaped_search=CGI.unescape(@q) end search_construct=[] unescaped_search=if @c diff --git a/lib/sisu/v3/cgi_sql_common.rb b/lib/sisu/v3/cgi_sql_common.rb index 7a3ba387..5a044d5f 100644 --- a/lib/sisu/v3/cgi_sql_common.rb +++ b/lib/sisu/v3/cgi_sql_common.rb @@ -292,8 +292,8 @@ module SiSU_CGI_SQL @date_modified=q['dtm'] if q['dtm']=~/\S/ @date_available=q['dta'] if q['dta']=~/\S/ @date_valid=q['dtv'] if q['dtv']=~/\S/ - @filename=if q['doc'] and q['search'] !~/search db/; q['doc'] - elsif q['fns']=~/\S/; q['fns'] + @filename=if q['doc'] and q['search'] !~/search db/ then q['doc'] + elsif q['fns']=~/\S/ then q['fns'] end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@offset=q['off'] if q['off']=~/\d+/ # 0 @@ -306,8 +306,8 @@ module SiSU_CGI_SQL :word => /#{identifier}[\s(]*(\S+)/ } search_string=if @search_field =~m[:word] - search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1] - elsif @search_field =~m[:string]; m[:string].match(@search_field)[1] + search_string=if @search_field =~m[:braces] then m[:braces].match(@search_field)[1] + elsif @search_field =~m[:string] then m[:string].match(@search_field)[1] else str=m[:word].match(@search_field)[1] str=str.gsub(/[()]/,'') @@ -512,7 +512,7 @@ module SiSU_CGI_SQL } end else - if page.to_s =~ /^1$/; '' + if page.to_s =~ /^1$/ then '' elsif page.to_s =~ /^2$/ %{
diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb index ccb1fb50..a9f9d277 100644 --- a/lib/sisu/v3/cgi_sqlite.rb +++ b/lib/sisu/v3/cgi_sqlite.rb @@ -143,8 +143,8 @@ module SiSU_CGI_SQLite def string search={ :search => [], :flag => false } if @t =~/\S+/ or @q =~/\S+/ - if @t =~/\S+/; unescaped_search=CGI.unescape(@t) - elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) + if @t =~/\S+/ then unescaped_search=CGI.unescape(@t) + elsif @q =~/\S+/ then unescaped_search=CGI.unescape(@q) end search_construct=[] unescaped_search=unescaped_search.gsub(/\s*(AND|OR)\s*/,"%' \) \\1 #{@l} LIKE \( '%"). diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb index 90ec28dc..d73b0c73 100644 --- a/lib/sisu/v3/composite.rb +++ b/lib/sisu/v3/composite.rb @@ -160,8 +160,8 @@ module SiSU_Assemble file[:prepared] << "\n% |#{fni}|@|^|>>ok\n" @code_flag=false insert_array.each do |i| - @code_flag=if i =~/^code\{/; true - elsif i =~/^\}code/; false + @code_flag=if i =~/^code\{/ then true + elsif i =~/^\}code/ then false else @code_flag end if not @code_flag \ diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index a039545f..79e12e2d 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -275,7 +275,7 @@ module SiSU_DAL end file_array=@env.read_source_file(fn) file_array.each do |l| - if l =~/\r\n/; l.gsub!(/\r\n/,"\n") + if l =~/\r\n/ then l.gsub!(/\r\n/,"\n") end end meta=file_array.dup diff --git a/lib/sisu/v3/dal_expand_insertions.rb b/lib/sisu/v3/dal_expand_insertions.rb index 5903d242..2ec4945f 100644 --- a/lib/sisu/v3/dal_expand_insertions.rb +++ b/lib/sisu/v3/dal_expand_insertions.rb @@ -72,33 +72,33 @@ module SiSU_DAL_Insertions end file_type_names={} file_type_names[:gen],file_type_names[:src]=[],[] - file_type_names[:gen] <<= if cmd_list =~ /y/; "~^ { document manifest }#{lnk[:manifest]}" + file_type_names[:gen] <<= if cmd_list =~ /y/ then "~^ { document manifest }#{lnk[:manifest]}" end - file_type_names[:gen] <<= if cmd_list =~ /h/; [" { html, segmented text }#{lnk[:html_toc]}"," { html, scroll, document in one }#{lnk[:html_doc]}"] + file_type_names[:gen] <<= if cmd_list =~ /h/ then [" { html, segmented text }#{lnk[:html_toc]}"," { html, scroll, document in one }#{lnk[:html_doc]}"] end - file_type_names[:gen] <<= if cmd_list =~ /e/; [" { epub }#{lnk[:epub]}"] + file_type_names[:gen] <<= if cmd_list =~ /e/ then [" { epub }#{lnk[:epub]}"] end - file_type_names[:gen] <<= if cmd_list =~ /p/; [" { pdf, landscape }#{lnk[:pdf_landscape]}"," { pdf, portrait }#{lnk[:pdf_portrait]}"] + file_type_names[:gen] <<= if cmd_list =~ /p/ then [" { pdf, landscape }#{lnk[:pdf_landscape]}"," { pdf, portrait }#{lnk[:pdf_portrait]}"] end - file_type_names[:gen] <<= if cmd_list =~ /o/; " { odf:odt, open document text }#{lnk[:odt]}" + file_type_names[:gen] <<= if cmd_list =~ /o/ then " { odf:odt, open document text }#{lnk[:odt]}" end - file_type_names[:gen] <<= if cmd_list =~ /b/; " { xhtml scroll }#{lnk[:xhtml]}" + file_type_names[:gen] <<= if cmd_list =~ /b/ then " { xhtml scroll }#{lnk[:xhtml]}" end - file_type_names[:gen] <<= if cmd_list =~ /x/; " { xml, sax }#{lnk[:xml_sax]}" + file_type_names[:gen] <<= if cmd_list =~ /x/ then " { xml, sax }#{lnk[:xml_sax]}" end - file_type_names[:gen] <<= if cmd_list =~ /X/; " { xml, dom }#{lnk[:xml_dom]}" + file_type_names[:gen] <<= if cmd_list =~ /X/ then " { xml, dom }#{lnk[:xml_dom]}" end - file_type_names[:gen] <<= if cmd_list =~ /a/; " { plain text utf-8 }#{lnk[:txt]}" + file_type_names[:gen] <<= if cmd_list =~ /a/ then " { plain text utf-8 }#{lnk[:txt]}" end - file_type_names[:gen] <<= if cmd_list =~ /g/; 'wiki.txt' + file_type_names[:gen] <<= if cmd_list =~ /g/ then 'wiki.txt' end - file_type_names[:gen] <<= if cmd_list =~ /w/; " { concordance }#{lnk[:html_concordance]}" + file_type_names[:gen] <<= if cmd_list =~ /w/ then " { concordance }#{lnk[:html_concordance]}" end - file_type_names[:gen] <<= if cmd_list =~ /N/; " { dcc, document content certificate (digests) }#{lnk[:digest]}" + file_type_names[:gen] <<= if cmd_list =~ /N/ then " { dcc, document content certificate (digests) }#{lnk[:digest]}" end - file_type_names[:src] <<= if source and cmd_shortcut =~ /s/; " { markup source text }#{lnk[:source]}" + file_type_names[:src] <<= if source and cmd_shortcut =~ /s/ then " { markup source text }#{lnk[:source]}" end - file_type_names[:src] <<= if cmd_shortcut =~ /S/; " { markup source (zipped) pod }#{lnk[:sisupod]}" + file_type_names[:src] <<= if cmd_shortcut =~ /S/ then " { markup source (zipped) pod }#{lnk[:sisupod]}" end file_type_names[:gen]=file_type_names[:gen].flatten file_type_names[:src]=file_type_names[:src].flatten diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb index f533e7f1..0cae5872 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -283,11 +283,11 @@ module SiSU_DbImport @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) - if @en[0]; @en_a,@en_z=@en[0].first,@en[0].last + if @en[0] then @en_a,@en_z=@en[0].first,@en[0].last end - if @en_ast[0]; @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last + if @en_ast[0] then @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last end - if @en_pls[0]; @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last + if @en_pls[0] then @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last end t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file_maint) @tuple_array << t.tuple diff --git a/lib/sisu/v3/epub_concordance.rb b/lib/sisu/v3/epub_concordance.rb index df975a48..224578b6 100644 --- a/lib/sisu/v3/epub_concordance.rb +++ b/lib/sisu/v3/epub_concordance.rb @@ -219,7 +219,7 @@ WOK && line.ln==4 @seg=line.name end - if line.ocn.to_s =~/\d+/; toy=line.ocn.to_s + if line.ocn.to_s =~/\d+/ then toy=line.ocn.to_s end if toy =~/\d+/ \ and toy !~/^0$/ diff --git a/lib/sisu/v3/help.rb b/lib/sisu/v3/help.rb index 421594fb..980380c3 100644 --- a/lib/sisu/v3/help.rb +++ b/lib/sisu/v3/help.rb @@ -901,7 +901,7 @@ WOK SiSU_Env::InfoSettings.new.program?(program) else '' end - if program =='rmagick'; program='identify' #rmagick is ruby lib uses imagemagick's identify + if program =='rmagick' then program='identify' #rmagick is ruby lib uses imagemagick's identify end bin=if SiSU_Env::SystemCall.new.program_found?(program) SiSU_Env::SystemCall.new.program_found?(program) diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index 3a2f8a0d..b4fd96ba 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -321,7 +321,7 @@ WOK and link !~/#/ #% keep eye on link p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,link) end - title=if dob.obj !~/Metadata/; linkname + title=if dob.obj !~/Metadata/ then linkname else link='metadata' %{#{linkname}} diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb index 446a8716..743bc090 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -229,9 +229,9 @@ module SiSU_Manifest @manifest[:html] << %{

#{id}:

#{info}

\n} end def links(url,lnk,target) - static=if url =~/^\.\//; url.gsub(/^\.(\.)?/,@base_url) - elsif url =~/^\.\.\//; url.gsub(/^\.(\.)?/,@env.url.root) - else url + static=if url =~/^\.\// then url.gsub(/^\.(\.)?/,@base_url) + elsif url =~/^\.\.\// then url.gsub(/^\.(\.)?/,@env.url.root) + else url end @manifest[:html] << %{

#{lnk}

  #{@brace_url.xml_open}#{static}#{@brace_url.xml_close}

\n} end @@ -406,11 +406,11 @@ module SiSU_Manifest summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.txt.dir)==true - if @md.opt.cmd =~/a/; id='Plaintext (Unix (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/e/; id='Plaintext (Unix (UTF-8) with endnotes)' - elsif @md.opt.cmd =~/A/; id='Plaintext (dos (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/E/; id='Plaintext (dos (UTF-8) with endnotes)' - else id='Plaintext (UTF-8)' + id=if @md.opt.cmd =~/a/ then 'Plaintext (Unix (UTF-8) with footnotes)' + elsif @md.opt.cmd =~/e/ then 'Plaintext (Unix (UTF-8) with endnotes)' + elsif @md.opt.cmd =~/A/ then 'Plaintext (dos (UTF-8) with footnotes)' + elsif @md.opt.cmd =~/E/ then 'Plaintext (dos (UTF-8) with endnotes)' + else 'Plaintext (UTF-8)' end pth=@f.output_path.txt.dir rel=@f.output_path.txt.rel_sm diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index 2830b24d..d4d16b1d 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -137,7 +137,7 @@ module SiSU_ODF if n =~/#{Mx[:br_line]}/ fix=n.split(/#{Mx[:br_line]}/) #watch #added fix.each do |x| - if x =~/\S+/; @n << x + if x =~/\S+/ then @n << x end end else @n << n @@ -271,7 +271,7 @@ module SiSU_ODF dob.obj.scan(/(#{Mx[:lnk_o]}[ ]*(.+?)[ ]*#{Mx[:lnk_c]}(image))/) else nil end - if m; m.each do |i| + if m then m.each do |i| cont,url=i[1],i[2] cont=cont.gsub(/([)(\]\[])/,"\\\\\\1"). gsub(/([+?])/,"\\\\\\1") # incorrect handling of + @@ -385,8 +385,8 @@ module SiSU_ODF str end def footnote(t_o) - str=if defined? t_o.obj; t_o.obj - elsif t_o.class==String; t_o + str=if defined? t_o.obj then t_o.obj + elsif t_o.class==String then t_o end if str @astx||=10000 @@ -420,8 +420,8 @@ module SiSU_ODF end end end - if defined? t_o.obj; t_o.obj=str - elsif t_o.class==String; t_o=str + if defined? t_o.obj then t_o.obj=str + elsif t_o.class==String then t_o=str end t_o end diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index 26d09041..7a416bd9 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -541,7 +541,7 @@ module SiSU_Param (str =~/https?:\/\/\S+$/) ? ' ;' : ';' end def all - s=if @h['all']; @h['all'] + s=if @h['all'] then @h['all'] else s='' if defined? copyright.text \ @@ -798,9 +798,9 @@ module SiSU_Param end end def emphasis - if @h['emphasis'] =~/bold/; 'bold' - elsif @h['emphasis'] =~/italics?/; 'italics' - elsif @h['emphasis'] =~/under(?:line|score)/; 'underscore' + if @h['emphasis'] =~/bold/ then 'bold' + elsif @h['emphasis'] =~/italics?/ then 'italics' + elsif @h['emphasis'] =~/under(?:line|score)/ then 'underscore' else nil end end @@ -1331,7 +1331,7 @@ module SiSU_Param if @markup.nil? \ or @markup.empty? @markup=@markup_version.determined.to_s - elsif @markup !~/0\.38/; @markup=@markup.strip + "; #{@markup_version.determined}" + elsif @markup !~/0\.38/ then @markup=@markup.strip + "; #{@markup_version.determined}" end if not defined? @title.full.nil? tf=para[/^:A~\S*(.+)$/m,1] @@ -1508,9 +1508,9 @@ module SiSU_Param # @flv.each do |l| # lang=SiSU_Env::StandardiseLanguage.new.file_to_language(l) # c={ a: '', b: '', c: '' } -# if @fnl[:pre] =~/\S/; c[:a]="#{lang[:c]}." -# elsif @fnl[:mid] =~/\S/; c[:b]=".#{lang[:c]}" -# elsif @fnl[:post] =~/\S/; c[:c]=".#{lang[:c]}" +# if @fnl[:pre] =~/\S/ then c[:a]="#{lang[:c]}." +# elsif @fnl[:mid] =~/\S/ then c[:b]=".#{lang[:c]}" +# elsif @fnl[:post] =~/\S/ then c[:c]=".#{lang[:c]}" # end # @lang << [lang[:n],"#{c[:a]}sisu_manifest#{c[:b]}.html#{c[:c]}"] # end if @flv diff --git a/lib/sisu/v3/qrcode.rb b/lib/sisu/v3/qrcode.rb index d668c813..dfd253d8 100644 --- a/lib/sisu/v3/qrcode.rb +++ b/lib/sisu/v3/qrcode.rb @@ -242,9 +242,9 @@ WOK @manifest[:txt_title] << %{#{info}\n} end def links(url,lnk,target) - static=if url =~/^\.\//; url.gsub(/^\.(\.)?/,@base_url) - elsif url =~/^\.\.\//; url.gsub(/^\.(\.)?/,@env.url.root) - else url + static=if url =~/^\.\// then url.gsub(/^\.(\.)?/,@base_url) + elsif url =~/^\.\.\// then url.gsub(/^\.(\.)?/,@env.url.root) + else url end @manifest[:txt] << %{#{url} #{lnk} #{@brace_url.txt_open}#{static}#{@brace_url.txt_close}\n} end @@ -384,12 +384,12 @@ WOK summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.txt.dir)==true - if @md.opt.cmd =~/a/; id='Plaintext (Unix (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/e/; id='Plaintext (Unix (UTF-8) with endnotes)' - elsif @md.opt.cmd =~/A/; id='Plaintext (dos (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/E/; id='Plaintext (dos (UTF-8) with endnotes)' - else id='Plaintext (UTF-8)' - end + id=if @md.opt.cmd =~/a/ then 'Plaintext (Unix (UTF-8) with footnotes)' + elsif @md.opt.cmd =~/e/ then 'Plaintext (Unix (UTF-8) with endnotes)' + elsif @md.opt.cmd =~/A/ then 'Plaintext (dos (UTF-8) with footnotes)' + elsif @md.opt.cmd =~/E/ then 'Plaintext (dos (UTF-8) with endnotes)' + else 'Plaintext (UTF-8)' + end pth=@f.output_path.txt.dir rel=@f.output_path.txt.rel_sm url=@f.output_path.txt.url diff --git a/lib/sisu/v3/response.rb b/lib/sisu/v3/response.rb index 675b249e..d660d398 100644 --- a/lib/sisu/v3/response.rb +++ b/lib/sisu/v3/response.rb @@ -61,9 +61,9 @@ module SiSU_Response response='redo' print ask + " ['yes', 'no' or 'quit']: " response=File.new('/dev/tty').gets.strip - ans=if response=='yes'; true - elsif response=='no'; false - elsif response =~/^quit|exit$/; exit + ans=if response=='yes' then true + elsif response=='no' then false + elsif response =~/^quit|exit$/ then exit else puts "[please type: 'yes', 'no' or 'quit']" response?(ask) end diff --git a/lib/sisu/v3/shared_xml.rb b/lib/sisu/v3/shared_xml.rb index cff58007..959170b6 100644 --- a/lib/sisu/v3/shared_xml.rb +++ b/lib/sisu/v3/shared_xml.rb @@ -109,8 +109,8 @@ module SiSU_XML_Munge def char_enc #character encode def utf8(dob='') if @sys.locale =~/utf-?8/i # instead ucs for utf8 # String#encode Iñtërnâtiônàlizætiøn - str=if defined? dob.obj; dob.obj - elsif dob.class==String; dob + str=if defined? dob.obj then dob.obj + elsif dob.class==String then dob end if str #¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûü diff --git a/lib/sisu/v3/sst_convert_markup.rb b/lib/sisu/v3/sst_convert_markup.rb index 47426490..20b6d775 100644 --- a/lib/sisu/v3/sst_convert_markup.rb +++ b/lib/sisu/v3/sst_convert_markup.rb @@ -196,7 +196,7 @@ WOK and @opt.files.length > 0 mr=nil #%% changes to make m match, r replace --------------------------> - if @opt.mod.inspect =~/--help/; help + 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' diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb index 08c599ce..b30fa8d2 100644 --- a/lib/sisu/v3/sst_do_inline_footnotes.rb +++ b/lib/sisu/v3/sst_do_inline_footnotes.rb @@ -124,7 +124,7 @@ module SiSU_ConvertFootnotes SiSU_Screen::Ansi.new(@opt.cmd,'convert footnotes').green_title_hi unless @opt.cmd =~/q/ file_array=IO.readlines(@opt.fns,'') file_array.each do |l| - if l =~/\r\n/; l.gsub!(/\r\n/,"\n") + if l =~/\r\n/ then l.gsub!(/\r\n/,"\n") end end meta=file_array.dup diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index aba92c3e..fc007a4f 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -402,7 +402,8 @@ module SiSU_TeX @tex_file=[] data.each do |dob| @tex_file << if dob.class==String \ - or dob.class==Hash; dob + or dob.class==Hash + dob elsif dob.is==:table tables_hash(@md,dob) #Hash result else dob @@ -709,8 +710,8 @@ WOK % \\sloppy \\begin{document} WOK - sisu_rc_footnote=if @md.sc_info; @tex_ml.doc_sc_info_footnote_full - else @tex_ml.doc_sc_info_footnote_brief + sisu_rc_footnote=if @md.sc_info then @tex_ml.doc_sc_info_footnote_full + else @tex_ml.doc_sc_info_footnote_brief end @copymark='' #check and remove as now is superflous x={} -- cgit v1.2.3