From 88ed8a0c1376fbe6d45059694ce31db597fde3e9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 14 Apr 2020 11:10:59 -0400 Subject: ruby 2.7 fix --- lib/sisu/xml_odf_odt.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/sisu/xml_odf_odt.rb') diff --git a/lib/sisu/xml_odf_odt.rb b/lib/sisu/xml_odf_odt.rb index 4d670a92..1f1c69b7 100644 --- a/lib/sisu/xml_odf_odt.rb +++ b/lib/sisu/xml_odf_odt.rb @@ -215,7 +215,8 @@ module SiSU_XML_ODF_ODT end unless @@docstart breakpage=if (@md.pagenew || @md.pagebreak) \ - and (@md.pagenew =~m or @md.pagebreak =~m) + and (@md.pagenew.to_s =~m \ + or @md.pagebreak.to_s =~m) ' ' elsif @md.pageline \ and @md.pageline =~m #fix @@ -612,7 +613,7 @@ module SiSU_XML_ODF_ODT if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ if @make.build.odt_ocn? if defined? dob.ocn \ - and dob.ocn.is_a?(Fixnum) + and dob.ocn.is_a?(Integer) p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn).set_bookmark_and_display end end @@ -670,7 +671,7 @@ module SiSU_XML_ODF_ODT word=dob.obj.scan(/\S+|\n/) if word word.each do |w| # _ - / # | : ! ^ ~ - unless dob =~/^(?:#{Rx[:meta]}|%+ )/m + unless dob.obj =~/^(?:#{Rx[:meta]}|%+ )/m w=w.gsub(/&#(?:126|152);/,'~'). #126 usual gsub(/ /,' ') if w !~/(?:&\S{2,7}?;)+/ @@ -735,9 +736,9 @@ module SiSU_XML_ODF_ODT dob.obj=tidywords(wordlist).join(' ').strip @rcdc=true if @rcdc==false \ and (dob.obj =~/~metadata/ \ - or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o] + or dob.obj =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o] if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ #check - if defined? dob.ocn and dob.ocn =~/\d+/ + if defined? dob.ocn and dob.ocn.to_s =~/\d+/ @p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn) end if dob.is ==:heading \ @@ -859,7 +860,7 @@ WOK env.make_path(@md.file.output_path.odt.dir) filename="#{@env.processing_path.odt}/content.xml" od=File.new(filename,'w+') - @content.compact.each do |para| # this is a hack + @content.flatten.compact.each do |para| # this is a hack, check change does not alter behavior od.puts para unless para =~/\A\s*\Z/ end od.close -- cgit v1.2.3