From f2ab439c41468ba64c8658bf1d17f802e906857c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Mar 2011 20:43:35 -0500 Subject: v3: space between each and opening curly brace e.g. "x.each {|y| p y}" --- CHANGELOG_v3 | 2 ++ data/doc/sisu/v3/CHANGELOG | 2 ++ lib/sisu/v3/cgi_pgsql.rb | 4 ++-- lib/sisu/v3/cgi_sqlite.rb | 4 ++-- lib/sisu/v3/composite.rb | 2 +- lib/sisu/v3/dal.rb | 2 +- lib/sisu/v3/dal_substitutions_and_insertions.rb | 16 ++++++++-------- lib/sisu/v3/epub_tune.rb | 2 +- lib/sisu/v3/html_tune.rb | 2 +- lib/sisu/v3/shared_metadata.rb | 18 +++++++++--------- lib/sisu/v3/sst_do_inline_footnotes.rb | 18 +++++++++--------- lib/sisu/v3/sysenv.rb | 2 +- 12 files changed, 39 insertions(+), 35 deletions(-) diff --git a/CHANGELOG_v3 b/CHANGELOG_v3 index 6c1de705..81aaab62 100644 --- a/CHANGELOG_v3 +++ b/CHANGELOG_v3 @@ -31,6 +31,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.2.orig.tar.gz * ruby 1.9 hash symbol syntax adopted + * space between each and opening curly brace e.g. "x.each {|y| p y}" + * use "encoding: utf-8" (instead of coding) * urls, param, two unrelated regex fixes, check diff --git a/data/doc/sisu/v3/CHANGELOG b/data/doc/sisu/v3/CHANGELOG index 57a404ed..34b927af 100644 --- a/data/doc/sisu/v3/CHANGELOG +++ b/data/doc/sisu/v3/CHANGELOG @@ -31,6 +31,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.2.orig.tar.gz * ruby 1.9 hash symbol syntax adopted + * space between each and opening curly brace e.g. "x.each {|y| p y}" + * use "encoding: utf-8" (instead of coding) * urls, param, two unrelated regex fixes, check diff --git a/lib/sisu/v3/cgi_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb index ed36553c..5f23f22d 100644 --- a/lib/sisu/v3/cgi_pgsql.rb +++ b/lib/sisu/v3/cgi_pgsql.rb @@ -172,10 +172,10 @@ module SiSU_CGI_pgsql def search_query1 <<-'WOK_SQL' @search_text,@search_endnotes=[],[] - search[:text].each{|x| @search_text << "#{x} AND " } + search[:text].each {|x| @search_text << "#{x} AND " } @search_text=@search_text.join.gsub!(/AND\s+$/,'') #watch @search_text.gsub!(/(doc_objects\.clean~[*]?\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean~[*]?\(\s*'[^']+'\s*\))+)/,'(\1)') - search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } + search[:endnotes].each {|x| @search_endnotes << "#{x} AND " } @search_endnotes=@search_endnotes.join.gsub!(/AND\s+$/,'') #watch @search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') end diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb index 0f0e5bb4..8d2ff53d 100644 --- a/lib/sisu/v3/cgi_sqlite.rb +++ b/lib/sisu/v3/cgi_sqlite.rb @@ -163,10 +163,10 @@ module SiSU_CGI_sqlite def search_query1 <<-'WOK_SQL' @search_text,@search_endnotes=[],[] - search[:text].each{|x| @search_text << "#{x} AND " } + search[:text].each {|x| @search_text << "#{x} AND " } @search_text=@search_text.join.gsub!(/AND\s+$/,'') @search_text.gsub!(/(doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') - search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } + search[:endnotes].each {|x| @search_endnotes << "#{x} AND " } @search_endnotes=@search_endnotes.join.gsub!(/AND\s+$/,'') @search_text.gsub!(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') end diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb index 1f4d07a1..b91e455b 100644 --- a/lib/sisu/v3/composite.rb +++ b/lib/sisu/v3/composite.rb @@ -118,7 +118,7 @@ module SiSU_Assemble end def write(assembled) assembled_file=File.new("#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst",'w+') - assembled.each{|a| assembled_file << a } + assembled.each {|a| assembled_file << a } assembled_file.close end def download_images(download_from,images_array) diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index 08557f2f..1e1de19b 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -261,7 +261,7 @@ module SiSU_DAL SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"~meta/#{@opt.fns}.meta").output if @opt.cmd =~/v/i SiSU_Screen::Ansi.new(@opt.cmd,"dal -> #{cf.meta}").txt_grey if @opt.cmd =~/M/ end - dal.each{|s| dal_array << s} + dal.each {|s| dal_array << s} dal_array end def read_fnm diff --git a/lib/sisu/v3/dal_substitutions_and_insertions.rb b/lib/sisu/v3/dal_substitutions_and_insertions.rb index 85362226..84b58756 100644 --- a/lib/sisu/v3/dal_substitutions_and_insertions.rb +++ b/lib/sisu/v3/dal_substitutions_and_insertions.rb @@ -83,53 +83,53 @@ module SiSU_substitute_and_insert i=$1 if defined? ins.insert1 para=[] - ins.insert1.split(/\n\n/).each{|x| para << x } + ins.insert1.split(/\n\n/).each {|x| para << x } else p "skin #{i} not found in #{@skin.select}" end when /^\s*<:(insert2)>\s*$/ i=$1 if defined? ins.insert2 para=[] - ins.insert2.split(/\n\n/).each{|x| para << x } + ins.insert2.split(/\n\n/).each {|x| para << x } else p "skin #{i} not found in #{@skin.select}" end when /^\s*<:(insert3)>\s*$/ i=$1 if defined? ins.insert3 para=[] - ins.insert3.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert3.split(/\n\n/).each {|x| para << x << "\n"} else p "skin #{i} not found in #{@skin.select}" end when /^\s*<:(insert4)>\s*$/ i=$1 if defined? ins.insert4 para=[] - ins.insert4.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert4.split(/\n\n/).each {|x| para << x << "\n"} else p "skin #{i} not found in #{@skin.select}" end when /^\s*<:(insert5)>\s*$/ i=$1 if defined? ins.insert5 para=[] - ins.insert5.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert5.split(/\n\n/).each {|x| para << x << "\n"} else p "skin #{i} not found in #{@skin.select}" end when /^\s*<:(insert6)>\s*$/ i=$1 if defined? ins.insert6 para=[] - ins.insert6.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert6.split(/\n\n/).each {|x| para << x << "\n"} else p "skin #{i} not found in #{@skin.select}" end when /^\s*<:(insert7)>\s*$/ i=$1 if defined? ins.insert7 para=[] - ins.insert7.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert7.split(/\n\n/).each {|x| para << x << "\n"} else p "skin #{i} not found in #{@skin.select}" end end - para.each{|x| data_expand << x } + para.each {|x| data_expand << x } else data_expand << para end data_expand.flatten! diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb index 8190a7f6..746a112e 100644 --- a/lib/sisu/v3/epub_tune.rb +++ b/lib/sisu/v3/epub_tune.rb @@ -82,7 +82,7 @@ module SiSU_EPUB_Tune def hard_output @filename_tune=@file.write_file_processing.html_tune data=[] - @data.each{|x| x.obj.strip; data << x if not x.obj.empty?} #1.9 array? + @data.each {|x| x.obj.strip; data << x if not x.obj.empty?} #1.9 array? data.each do |dob| @filename_tune.puts dob, "\n" #check end diff --git a/lib/sisu/v3/html_tune.rb b/lib/sisu/v3/html_tune.rb index c32fbbd1..18b4576b 100644 --- a/lib/sisu/v3/html_tune.rb +++ b/lib/sisu/v3/html_tune.rb @@ -82,7 +82,7 @@ module SiSU_HTML_Tune def hard_output @filename_tune=@file.write_file_processing.html_tune data=[] - @data.each{|x| x.obj.strip; data << x if not x.obj.empty?} #1.9 array? + @data.each {|x| x.obj.strip; data << x if not x.obj.empty?} #1.9 array? data.each do |dob| @filename_tune.puts dob, "\n" end diff --git a/lib/sisu/v3/shared_metadata.rb b/lib/sisu/v3/shared_metadata.rb index 3613038b..167af5c4 100644 --- a/lib/sisu/v3/shared_metadata.rb +++ b/lib/sisu/v3/shared_metadata.rb @@ -1245,7 +1245,7 @@ if @md.title @md.title.language, @md.title.language_char ] - x.each{|y| p y if y} + x.each {|y| p y if y} end if @md.creator x=[ @@ -1266,7 +1266,7 @@ if @md.creator @md.creator.prepared_by, @md.creator.prepared_by_detail ] - x.each{|y| p y if y} + x.each {|y| p y if y} end if @md.rights x=[ @@ -1279,7 +1279,7 @@ if @md.rights @md.rights.license, @md.rights.all ] - x.each{|y| p y if y} + x.each {|y| p y if y} end if @md.classify x=[ @@ -1295,7 +1295,7 @@ if @md.classify @md.classify.pg, @md.classify.isbn, ] - x.each{|y| p y if y} + x.each {|y| p y if y} end if @md.date x=[ @@ -1307,7 +1307,7 @@ if @md.date @md.date.published, @md.date.valid ] - x.each{|y| p y if y} + x.each {|y| p y if y} end #if @md.language # p @md.language.document @@ -1330,13 +1330,13 @@ if @md.make @md.make.ad, @md.make.manpage ] - x.each{|y| p y if y} + x.each {|y| p y if y} end if @md.current_publisher # @md.publisher x=[ @md.current_publisher ] - x.each{|y| p y if y} + x.each {|y| p y if y} end if @md.original x=[ @@ -1347,7 +1347,7 @@ if @md.original @md.original.institution, @md.original.nationality ] - x.each{|y| p y if y} + x.each {|y| p y if y} end if @md.notes x=[ @@ -1357,5 +1357,5 @@ if @md.notes @md.notes.history, @md.notes.prefix ] - x.each{|y| p y if y} + x.each {|y| p y if y} end diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb index d22cf096..254283d7 100644 --- a/lib/sisu/v3/sst_do_inline_footnotes.rb +++ b/lib/sisu/v3/sst_do_inline_footnotes.rb @@ -133,7 +133,7 @@ module SiSU_Convert_footnotes dal=SiSU_Convert_footnotes::Make.new(@md,file_array).song SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.fns}.fn").output if @md.cmd =~/v/ SiSU_Screen::Ansi.new(@opt.cmd,"#{@md.fns}.fn -> #{@md.fns}.fn").txt_red unless @md.cmd =~/q/ - dal.each{|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?} + dal.each {|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?} dal_array else SiSU_Screen::Ansi.new(@md.cmd,'no footnote conversion done, problem with source file','to override use --convert=footnote-force (this is not advised)').warn if @cmd !~/q/ @@ -277,29 +277,29 @@ module SiSU_Convert_footnotes case para when /^\s*<:insert1>\s*$/ para=[] - ins.insert1.split(/\n\n/).each{|x| para << x } + ins.insert1.split(/\n\n/).each {|x| para << x } when /^\s*<:insert2>\s*$/ para=[] - ins.insert2.split(/\n\n/).each{|x| para << x } + ins.insert2.split(/\n\n/).each {|x| para << x } when /^\s*<:insert3>\s*$/ para=[] - ins.insert3.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert3.split(/\n\n/).each {|x| para << x << "\n"} para=ins.insert3 when /^\s*<:insert4>\s*$/ para=[] - ins.insert4.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert4.split(/\n\n/).each {|x| para << x << "\n"} para=ins.insert4 when /^\s*<:insert5>\s*$/ para=[] - ins.insert5.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert5.split(/\n\n/).each {|x| para << x << "\n"} when /^\s*<:insert6>\s*$/ para=[] - ins.insert6.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert6.split(/\n\n/).each {|x| para << x << "\n"} when /^\s*<:insert7>\s*$/ para=[] - ins.insert7.split(/\n\n/).each{|x| para << x << "\n"} + ins.insert7.split(/\n\n/).each {|x| para << x << "\n"} end - para.each{|x| tuned_file << x } + para.each {|x| tuned_file << x } else tuned_file << para end tuned_file.compact! diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index dc042aad..1383b728 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -3736,7 +3736,7 @@ WOK def select # skin loading logic here load "#{SiSU_lib}/defaults.rb" skin_path=[] - @env.sys.rc_path.each{|x| skin_path << "#{x}/skin"} + @env.sys.rc_path.each {|x| skin_path << "#{x}/skin"} skin_path << "#{@env.path.processing}/external_document/skin" skin=true if @pwd_stub =~/^sisupod$/ \ -- cgit v1.2.3