diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-03-02 22:54:28 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-03-02 22:54:28 -0500 |
commit | 0569fd776ab4ce33689ca3337acd62f2415b6348 (patch) | |
tree | 4644037b28d876d8637a610f5df1a29535a4ef9a /lib | |
parent | debian/changelog (3.0.1-1) (diff) | |
parent | CHANGELOG_v{1,2,3}, syslink, avoid duplication (diff) |
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib')
117 files changed, 1213 insertions, 1222 deletions
diff --git a/lib/sisu/v3/air.rb b/lib/sisu/v3/air.rb index 3b456f8c..2e678f45 100644 --- a/lib/sisu/v3/air.rb +++ b/lib/sisu/v3/air.rb @@ -1,4 +1,4 @@ -# coding:utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,10 +57,7 @@ =end module SiSU_Air - require "#{SiSU_lib}/particulars" # particulars.rb - #require "#{SiSU_lib}/defaults" # defaults.rb - #require "#{SiSU_lib}/sysenv" # sysenv.rb - #require "#{SiSU_lib}/param" # param.rb + require_relative 'particulars' # particulars.rb class Source @@dal_array=[] @@fns=nil diff --git a/lib/sisu/v3/author_format.rb b/lib/sisu/v3/author_format.rb index d98376bf..847ea888 100644 --- a/lib/sisu/v3/author_format.rb +++ b/lib/sisu/v3/author_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -67,17 +67,17 @@ module FORMAT authors.each do |a| a.strip! if a =~/"(.+?)"/ - @authors << { :the => $1 } + @authors << { the: $1 } @author_array << $1.upcase else #if a =~/,/ x=a.scan(/[^,]+/) x[0].strip! x[1].strip! if x[1] if x.length==1 - @authors << { :the => x[0] } + @authors << { the: x[0] } @author_array << x[0].upcase elsif x.length==2 - @authors << { :the=> x[0], :others => x[1] } + @authors << { the: x[0], others: x[1] } @author_array << "#{x[0].upcase}, #{x[1]}" else #p x.length end @@ -101,11 +101,11 @@ module FORMAT end end { - :last_first_a => authors, - :last_first_format_a => @author_array, - :authors_h => @authors, - :authors_s => authors_string, - :authors_param => @author_param + last_first_a: authors, + last_first_format_a: @author_array, + authors_h: @authors, + authors_s: authors_string, + authors_param: @author_param } end end diff --git a/lib/sisu/v3/cgi.rb b/lib/sisu/v3/cgi.rb index 561bf404..7b01ae98 100644 --- a/lib/sisu/v3/cgi.rb +++ b/lib/sisu/v3/cgi.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,10 +58,10 @@ =end module SiSU_CGI #% database building documents - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/cgi_pgsql" # cgi_pgsql.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'cgi_pgsql' # cgi_pgsql.rb include SiSU_CGI_pgsql - require "#{SiSU_lib}/cgi_sqlite" # cgi_sqlite.rb + require_relative 'cgi_sqlite' # cgi_sqlite.rb class SiSU_search def initialize(opt) @opt=opt diff --git a/lib/sisu/v3/cgi_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb index 5271175c..5f23f22d 100644 --- a/lib/sisu/v3/cgi_pgsql.rb +++ b/lib/sisu/v3/cgi_pgsql.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,8 +57,8 @@ =end module SiSU_CGI_pgsql #% database building documents - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/cgi_sql_common" # cgi_sql_common.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_sql class SiSU_search_pgsql < SiSU_CGI_common def initialize(opt,webserv) @@ -145,7 +145,7 @@ module SiSU_CGI_pgsql @l,@t,@q,@c=l,t,q,cse end def string - search={ :search => [],:flag => false } + 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) @@ -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_sql_common.rb b/lib/sisu/v3/cgi_sql_common.rb index 7e911a00..0ca9dca2 100644 --- a/lib/sisu/v3/cgi_sql_common.rb +++ b/lib/sisu/v3/cgi_sql_common.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb index a2fb45d8..8d2ff53d 100644 --- a/lib/sisu/v3/cgi_sqlite.rb +++ b/lib/sisu/v3/cgi_sqlite.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,8 +57,8 @@ =end module SiSU_CGI_sqlite #% database building documents - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/cgi_sql_common" # cgi_sql_common.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_sql class SiSU_search_sqlite < SiSU_CGI_common def initialize(opt,webserv) @@ -141,7 +141,7 @@ module SiSU_CGI_sqlite @l,@t,@q=l,t,q end def string - search={ :search => [],:flag => false } + 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) @@ -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/character_encoding.rb b/lib/sisu/v3/character_encoding.rb index b785a715..f62d1dc3 100644 --- a/lib/sisu/v3/character_encoding.rb +++ b/lib/sisu/v3/character_encoding.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,7 +59,7 @@ =end module SiSU_character_encode require 'kirbybase' - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb class Characters attr_accessor(:character_encoding,:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name) def initialize(&block) diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb index 174d0a81..674618f9 100644 --- a/lib/sisu/v3/composite.rb +++ b/lib/sisu/v3/composite.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,7 +59,7 @@ =end module SiSU_Assemble require 'fileutils' - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb class Remote_image include FileUtils def initialize @@ -71,7 +71,7 @@ module SiSU_Assemble images end def download_images(download_from,images_array) - path="#{@env.path.processing}/external_document/image" + path="#{@env.processing_path.processing}/external_document/image" mkdir_p(path) unless FileTest.directory?(path) images_array.each do |i| image="#{path}/#{i}" @@ -86,7 +86,7 @@ module SiSU_Assemble SiSU_Env::System_call.new("#{path}/*",output_path,'q').rsync end def download_doc_skin(doc_skin) #first element in array is source url - path="#{@env.path.processing}/external_document/skin/doc" + path="#{@env.processing_path.processing}/external_document/skin/doc" mkdir_p(path) unless FileTest.directory?(path) download_from=doc_skin.shift doc_skin.each do |i| @@ -117,12 +117,12 @@ module SiSU_Assemble end end def write(assembled) - assembled_file=File.new("#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst",'w+') - assembled.each{|a| assembled_file << a } + assembled_file=File.new("#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst",'w+') + assembled.each {|a| assembled_file << a } assembled_file.close end def download_images(download_from,images_array) - path="#{@env.path.processing}/external_document/image" + path="#{@env.processing_path.processing}/external_document/image" mkdir_p(path) unless FileTest.directory?(path) images_array.each do |i| image="#{path}/#{i}" @@ -136,7 +136,7 @@ module SiSU_Assemble end end def download_doc_skin(doc_skin) #first element in array is source url - path="#{@env.path.processing}/external_document/skin/doc" + path="#{@env.processing_path.processing}/external_document/skin/doc" mkdir_p(path) unless FileTest.directory?(path) download_from=doc_skin.shift doc_skin.each do |i| @@ -151,7 +151,7 @@ module SiSU_Assemble end end def insertion(fni,insert_array) - file={ :prepared=>[],:images=>[] } + file={ prepared: [], images: [] } rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ file[:prepared] << "\n% |#{fni}|@|^|>>ok\n" @code_flag=false diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb index e8d414a2..d979a6c9 100644 --- a/lib/sisu/v3/concordance.rb +++ b/lib/sisu/v3/concordance.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,15 +58,15 @@ =end module SiSU_Concordance - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/html_format" # html_format.rb + require_relative 'html_format' # html_format.rb include SiSU_HTML_Format - require "#{SiSU_lib}/html_minitoc" # html_minitoc.rb + require_relative 'html_minitoc' # html_minitoc.rb class Source def initialize(opt) @opt=opt @@ -101,8 +101,8 @@ module SiSU_Concordance class Doc_title include SiSU_Viz #revisit, both requires (html & shared_xml) needed for stand alone operation (sisu -w [filename]) - require "#{SiSU_lib}/shared_xml" # shared_xml.rb - require "#{SiSU_lib}/html" # html.rb + require_relative 'shared_xml' # shared_xml.rb + require_relative 'html' # html.rb def initialize(particulars) @particulars,@md=particulars,particulars.md @data=SiSU_HTML::Source::Html_environment.new(particulars).tuned_file_instructions @@ -171,11 +171,11 @@ WOK end end class Words - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/html_format" # html_format.rb + require_relative 'html_format' # html_format.rb include SiSU_HTML_Format - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Screen @@dp=nil def initialize(particulars) diff --git a/lib/sisu/v3/conf.rb b/lib/sisu/v3/conf.rb index 7af523c2..197a04b3 100644 --- a/lib/sisu/v3/conf.rb +++ b/lib/sisu/v3/conf.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,12 +57,12 @@ =end module SiSU_Initialize - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Screen - require "#{SiSU_lib}/relaxng" # relaxng.rb + require_relative 'relaxng' # relaxng.rb include SiSU_relaxng - require "#{SiSU_lib}/css" # css.rb + require_relative 'css' # css.rb include SiSU_Style class Source def initialize(opt) @@ -79,7 +79,7 @@ module SiSU_Initialize end class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier require 'fileutils' - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include FileUtils #::Verbose def initialize(opt) @opt=opt @@ -161,7 +161,7 @@ module SiSU_Initialize end def trang_rnc_model_output_sax s=@suffix - rnc_src=@env.path.dal + '/sax.' + s[:rnc] + rnc_src=@env.processing_path.dal + '/sax.' + s[:rnc] rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_sax rng_file=@path[:rng] + '/' + @rxng.rng_name.output_sax xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_sax @@ -180,7 +180,7 @@ module SiSU_Initialize end def trang_rnc_model_output_dom s=@suffix - rnc_src=@env.path.dal + '/dom.' + s[:rnc] + rnc_src=@env.processing_path.dal + '/dom.' + s[:rnc] rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_dom rng_file=@path[:rng] + '/' + @rxng.rng_name.output_dom xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_dom @@ -199,7 +199,7 @@ module SiSU_Initialize end def trang_rnc_model_output_xhtml s=@suffix - rnc_src=@env.path.dal + '/xhtml.' + s[:rnc] + rnc_src=@env.processing_path.dal + '/xhtml.' + s[:rnc] rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_xhtml rng_file=@path[:rng] + '/' + @rxng.rng_name.output_xhtml xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_xhtml @@ -217,7 +217,7 @@ module SiSU_Initialize chmod(0644,rnc_file) end def trang_rnc_model_input_sax - rnc_file=@env.path.dal + '/sax.rnc' + rnc_file=@env.processing_path.dal + '/sax.rnc' dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_sax rnc=File.new(rnc_file,'w') rnc << @rxng.rnc_model_output_sax @@ -226,7 +226,7 @@ module SiSU_Initialize schema.relaxng(@opt.cmd) end def trang_rnc_model_input_dom - rnc_file=@env.path.dal + '/dom.rnc' + rnc_file=@env.processing_path.dal + '/dom.rnc' dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_dom rnc=File.new(rnc_file,'w') rnc << @rxng.rnc_model_output_dom @@ -235,8 +235,8 @@ module SiSU_Initialize schema.relaxng(@opt.cmd) end def trang_rnc_model_input_node - rnc_file=@env.path.dal + '/node.rnc' - rng_file=@env.path.dal + '/node.rng' + rnc_file=@env.processing_path.dal + '/node.rnc' + rng_file=@env.processing_path.dal + '/node.rng' dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_node rnc=File.new(rnc_file,'w') rnc << @rxng.rnc_model_input_node diff --git a/lib/sisu/v3/constants.rb b/lib/sisu/v3/constants.rb index df529d31..d94da654 100644 --- a/lib/sisu/v3/constants.rb +++ b/lib/sisu/v3/constants.rb @@ -1,4 +1,4 @@ -# coding:utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ ** Description: system environment, resource control and configuration details =end -Sfx={:txt=>'.txt',:html=>'.html',:xhtml=>'.xhtml',:xml=>'.xml',:epub=>'.epub',:epub_xhtml=>'.xhtml',:odt=>'.odt',:pdf=>'.pdf'} +Sfx={ txt: '.txt', html: '.html', xhtml: '.xhtml', xml: '.xml', epub: '.epub', epub_xhtml: '.xhtml', odt: '.odt', pdf: '.pdf'} Ax,Xx,Mx,Rx,Hx,Dx,Px,Db,Gt,Tex=Array.new(10){{}} Ax[:tab]="\t" Xx[:protect]='☞' @@ -96,9 +96,9 @@ Mx[:nbsp]= '░' #'▭ ' Mx[:br_line]= '╱' #lB ▌ 9612 ┘ ¶ Mx[:br_nl]= '╲' #lB ▌ 』 ┘ Mx[:br_paragraph]= '█' #FB █ 9608 # PP ∥ 8741 #▐ #'┘' #'¶' #FB █ 9608 lB ▌ 9612 RB ▐ 9616 -Mx[:br_obj]= 'break_obj'; Hx[:br_obj]= {:obj=>Mx[:br_obj]} # line sep -Mx[:br_page]= 'break_page'; Hx[:br_page]= {:obj=>Mx[:br_page]} # newpage -Mx[:br_page_new]= 'break_page_new'; Hx[:br_page_new]= {:obj=>Mx[:br_page_new]} # clearpage +Mx[:br_obj]= 'break_obj'; Hx[:br_obj]= { obj: Mx[:br_obj] } # line sep +Mx[:br_page]= 'break_page'; Hx[:br_page]= { obj: Mx[:br_page] } # newpage +Mx[:br_page_new]= 'break_page_new'; Hx[:br_page_new]= { obj: Mx[:br_page_new] } # clearpage Mx[:br_endnotes]= "#{Mx[:mk_o]}ENDNOTES#{Mx[:mk_c]}" Mx[:br_eof]= "#{Mx[:mk_o]}EOF#{Mx[:mk_c]}" Mx[:lnk_o]='⌠'; Mx[:lnk_c]='⌡' #'⌈' '⌋' '⌠' '⌡' #Mx[:lnk_o]='◁'; Mx[:lnk_c]='▷' #‹ › diff --git a/lib/sisu/v3/css.rb b/lib/sisu/v3/css.rb index 37211ecc..463492af 100644 --- a/lib/sisu/v3/css.rb +++ b/lib/sisu/v3/css.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,8 +57,8 @@ =end module SiSU_Style - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'defaults' # defaults.rb class CSS def initialize @vz=SiSU_Env::Get_init.instance.skin diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index 9f1d5372..13414826 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,27 +58,27 @@ =end module SiSU_DAL - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/dal_doc_objects" # dal_doc_objects.rb - require "#{SiSU_lib}/dal_syntax" # dal_syntax.rb + require_relative 'dal_doc_objects' # dal_doc_objects.rb + require_relative 'dal_syntax' # dal_syntax.rb include SiSU_Syntax - require "#{SiSU_lib}/dal_doc_str" # dal_doc_str.rb - require "#{SiSU_lib}/dal_idx" # dal_idx.rb - require "#{SiSU_lib}/dal_numbering" # dal_numbering.rb - require "#{SiSU_lib}/dal_hash_digest" # dal_hash_digest.rb - require "#{SiSU_lib}/dal_endnotes" # dal_endnotes.rb - require "#{SiSU_lib}/dal_images" # dal_images.rb - require "#{SiSU_lib}/dal_metadata" # dal_metadata.rb - require "#{SiSU_lib}/dal_character_check" # dal_character_check.rb - require "#{SiSU_lib}/dal_substitutions_and_insertions" # dal_substitutions_and_insertions.rb - require "#{SiSU_lib}/dal_expand_insertions" # dal_expand_insertions.rb - require "#{SiSU_lib}/i18n" # i18n.rb - require "#{SiSU_lib}/shared_sem" # shared_sem.rb + require_relative 'dal_doc_str' # dal_doc_str.rb + require_relative 'dal_idx' # dal_idx.rb + require_relative 'dal_numbering' # dal_numbering.rb + require_relative 'dal_hash_digest' # dal_hash_digest.rb + require_relative 'dal_endnotes' # dal_endnotes.rb + require_relative 'dal_images' # dal_images.rb + require_relative 'dal_metadata' # dal_metadata.rb + require_relative 'dal_character_check' # dal_character_check.rb + require_relative 'dal_substitutions_and_insertions' # dal_substitutions_and_insertions.rb + require_relative 'dal_expand_insertions' # dal_expand_insertions.rb + require_relative 'i18n' # i18n.rb + require_relative 'shared_sem' # shared_sem.rb class Instantiate < SiSU_Param::Parameters::Instructions def initialize @@flag_vocab=0 @@ -87,8 +87,8 @@ module SiSU_DAL end class Source <Instantiate @@dal_array=[] - @@idx_arr={:sst=>[],:tex=>[],:html=>[],:xhtml=>[]} - @@map_arr={:nametags=>[],:ocn_htmlseg=>[]} + @@idx_arr={ sst: [], tex: [], html: [], xhtml: [] } + @@map_arr={ nametags: [], ocn_htmlseg: [] } @@fns=nil def initialize(opt,fnx=nil) @opt,@fnx=opt,fnx @@ -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 @@ -408,11 +408,11 @@ module SiSU_DAL end end else - hard="#{@dir.path.dal}/#{@md.fns}.meta" + hard="#{@dir.processing_path.dal}/#{@md.fns}.meta" File.unlink(hard) if FileTest.file?(hard) - hard="#{@dir.path.dal}/#{@md.fns}.txt" + hard="#{@dir.processing_path.dal}/#{@md.fns}.txt" File.unlink(hard) if FileTest.file?(hard) - hard="#{@dir.path.dal}/#{@md.fns}.debug.txt" + hard="#{@dir.processing_path.dal}/#{@md.fns}.debug.txt" File.unlink(hard) if FileTest.file?(hard) end end @@ -433,7 +433,7 @@ module SiSU_DAL @data.each {|s| filename_meta.puts s.strip + "\n" unless s.strip.empty?} end else - hard_idx_html="#{@dir.path.dal}/#{@md.fns}.idx.html" + hard_idx_html="#{@dir.processing_path.dal}/#{@md.fns}.idx.html" File.unlink(hard_idx_html) if FileTest.file?(hard_idx_html) end end diff --git a/lib/sisu/v3/dal_character_check.rb b/lib/sisu/v3/dal_character_check.rb index 81f4e16b..bf393b76 100644 --- a/lib/sisu/v3/dal_character_check.rb +++ b/lib/sisu/v3/dal_character_check.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/dal_doc_objects.rb b/lib/sisu/v3/dal_doc_objects.rb index 0f501a79..ad5f8bb7 100644 --- a/lib/sisu/v3/dal_doc_objects.rb +++ b/lib/sisu/v3/dal_doc_objects.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb index 6415f7dd..365973eb 100644 --- a/lib/sisu/v3/dal_doc_str.rb +++ b/lib/sisu/v3/dal_doc_str.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -144,7 +144,7 @@ module SiSU_document_structure_extract t_o=nil when /^%+\s/ #comment t_o=if t_o=~/^%+\s+(.+)/ - h={:obj=>$1} + h={obj: $1} SiSU_document_structure::Object_comment.new.comment(h) else nil end @@ -155,19 +155,19 @@ module SiSU_document_structure_extract obj=$1 note=endnote_test?(obj) obj,tags=extract_tags(obj) - h={:lv=>lv,:ln=>ln,:obj=>obj,:idx=>idx,:tags=>tags} + h={ lv: lv, ln: ln, obj: obj, idx: idx, tags: tags } SiSU_document_structure::Object_heading.new.heading(h) elsif t_o=~/^:?[A-C1-6]\~(\S+?)-\s+(.+)/m name,obj=$1,$2 note=endnote_test?(obj) obj,tags=extract_tags(obj) - h={:lv=>lv,:name=>name,:obj=>obj,:idx=>idx,:autonum_=>false,:tags=>tags} + h={ lv: lv, name: name, obj: obj, idx: idx, autonum_: false, tags: tags} SiSU_document_structure::Object_heading.new.heading(h) elsif t_o=~/^:?[A-C1-6]\~(\S+)\s+(.+)/m name,obj=$1,$2 note=endnote_test?(obj) obj,tags=extract_tags(obj,name) - h={:lv=>lv,:name=>name,:obj=>obj,:idx=>idx,:tags=>tags} + h={ lv: lv, name: name, obj: obj, idx: idx, tags: tags } SiSU_document_structure::Object_heading.new.heading(h) else nil end @@ -179,7 +179,7 @@ module SiSU_document_structure_extract image=image_test(obj) note=endnote_test?(obj) obj,tags=extract_tags(obj) - h={:bullet_=>bullet,:indent=>indent,:obj=>obj,:idx=>idx,:note_=>note,:image_=>image,:tags=>tags} + h={ bullet_: bullet, indent: indent, obj: obj, idx: idx, note_: note, image_: image, tags: tags } SiSU_document_structure::Object_para.new.paragraph(h) else nil end @@ -193,7 +193,7 @@ module SiSU_document_structure_extract image=image_test(t_o) note=endnote_test?(t_o) obj,tags=extract_tags(t_o) - h={:bullet_=>false,:indent=>0,:obj=>obj,:idx=>idx,:note_=>note,:image_=>image,:tags=>tags} + h={ bullet_: false, indent: 0, obj: obj, idx: idx, note_: note, image_: image, tags: tags } SiSU_document_structure::Object_para.new.paragraph(h) end elsif not @@flag['code'] @@ -201,30 +201,30 @@ module SiSU_document_structure_extract @@flag['code']=true @@counter=1 @codeblock_numbered=(t_o =~/^code\{#/) ? true : false - h={:obj=>'code block start'} #introduce a counter + h={ obj: 'code block start' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) elsif t_o =~/^poem\{/ @@flag['poem']=true - h={:obj=>'poem start'} #introduce a counter + h={ obj: 'poem start' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) tuned_file << t_o elsif t_o =~/^group\{/ @@flag['group']=true - h={:obj=>'group text start'} #introduce a counter + h={ obj: 'group text start' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) tuned_file << t_o elsif t_o =~/^block\{/ @@flag['block']=true - h={:obj=>'block text start'} #introduce a counter + h={ obj: 'block text start' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) tuned_file << t_o elsif t_o =~/^alt\{/ @@flag['alt']=true - h={:obj=>'alt text start'} #introduce a counter + h={ obj: 'alt text start' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) tuned_file << t_o elsif t_o =~/^(?:table\{|\{table)[ ~]/ - h={:obj=>'table start'} #introduce a counter + h={ obj: 'table start' } #introduce a counter ins=SiSU_document_structure::Object_comment.new.comment(h) #ins=SiSU_document_structure::Object_layout.new.insert(h) tuned_file << ins if t_o=~/^table\{(?:~h)?\s+/ @@ -240,7 +240,7 @@ module SiSU_document_structure_extract col=$2.scan(/\d+/) heading=false end - @h={:head_=>heading,:cols=>cols,:widths=>col,:idx=>idx} + @h={ head_: heading, cols: cols, widths: col, idx: idx } elsif t_o=~/^\{table(?:~h)?(?:\s+\d+;?)?\}\n.+\Z/m m1,m2,hd=nil,nil,nil tbl=/^\{table(?:~h)?(?:\s+\d+;?)?\}\n(.+)\Z/m.match(t_o)[1] #two table representations should be consolidated as one @@ -264,10 +264,10 @@ module SiSU_document_structure_extract width=100.00/cols cols.times { col << width } end - h={:head_=>hd,:cols=>cols,:widths=>col,:obj=>rows,:idx=>idx,:tags=>tags} + h={ head_: hd, cols: cols, widths: col, obj: rows, idx: idx, tags: tags } t_o=SiSU_document_structure::Object_table.new.table(h) unless h.nil? tuned_file << t_o - h={:obj=>'table end'} #introduce a counter + h={ obj: 'table end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) t_o elsif t_o=~/^\{table(?:~h)?\s+/ @@ -287,10 +287,10 @@ module SiSU_document_structure_extract r.gsub!(/\s*\|\s*/m,"#{Mx[:tc_p]}") #r.gsub!(/\|/m,"#{Mx[:tc_p]}") rows += r + Mx[:tc_c] end - h={:head_=>hd,:cols=>col.length,:widths=>col,:obj=>rows,:idx=>idx,:tags=>tags} + h={ head_: hd, cols: col.length, widths: col, obj: rows, idx: idx, tags: tags } t_o=SiSU_document_structure::Object_table.new.table(h) unless h.nil? tuned_file << t_o - h={:obj=>'table end'} #introduce a counter + h={ obj: 'table end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) t_o end @@ -302,12 +302,12 @@ module SiSU_document_structure_extract and t_o =~/^\}table/ #two table representations should be consolidated as one @@flag['table']=false headings,columns,widths,idx=@h[:head_],@h[:cols],@h[:widths],@h[:idx] - @h={:head_=>headings,:cols=>columns,:widths=>widths,:idx=>idx,:obj=>@rows} + @h={ head_: headings, cols: columns, widths: widths, idx: idx, obj: @rows } t_o=SiSU_document_structure::Object_table.new.table(@h) tuned_file << t_o @h,@rows=nil,'' t_o - h={:obj=>'table end'} #introduce a counter + h={ obj: 'table end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) t_o else @@ -322,11 +322,11 @@ module SiSU_document_structure_extract if t_o =~/^\}code/ @@flag['code']=false obj,tags=extract_tags(@tuned_code.join("\n")) - h={:obj=>obj,:tags=>tags,:number_=>@codeblock_numbered} + h={ obj: obj, tags: tags, number_: @codeblock_numbered } t_o=SiSU_document_structure::Object_block_txt.new.code(h) @tuned_code=[] tuned_file << t_o - h={:obj=>'code block end'} #introduce a counter + h={ obj: 'code block end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) end if @@flag['code'] \ @@ -347,37 +347,37 @@ module SiSU_document_structure_extract if @@flag['poem'] \ and t_o =~/^\}poem/ @@flag['poem']=false - h={:obj=>'poem end'} #introduce a counter + h={ obj: 'poem end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) elsif ( @@flag['group'] \ and t_o =~/^\}group/ ) @@flag['group']=false obj,tags=extract_tags(@tuned_block.join("\n")) - h={:obj=>obj,:tags=>tags} + h={ obj: obj, tags: tags } @tuned_block=[] t_o=SiSU_document_structure::Object_block_txt.new.group(h) tuned_file << t_o - h={:obj=>'group text end'} #introduce a counter + h={ obj: 'group text end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) elsif ( @@flag['block'] \ and t_o =~/^\}block/ ) @@flag['block']=false obj,tags=extract_tags(@tuned_block.join("\n")) - h={:obj=>obj,:tags=>tags} + h={ obj: obj, tags: tags } @tuned_block=[] t_o=SiSU_document_structure::Object_block_txt.new.block(h) tuned_file << t_o - h={:obj=>'block text end'} #introduce a counter + h={ obj: 'block text end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) elsif ( @@flag['alt'] \ and t_o =~/^\}alt/ ) @@flag['alt']=false obj,tags=extract_tags(@tuned_block.join("\n")) - h={:obj=>obj,:tags=>tags} + h={ obj: obj, tags: tags } t_o=SiSU_document_structure::Object_block_txt.new.alt(h) @tuned_block=[] tuned_file << t_o - h={:obj=>'alt text end'} #introduce a counter + h={ obj: 'alt text end' } #introduce a counter t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) end if @@flag['poem'] \ @@ -393,7 +393,7 @@ module SiSU_document_structure_extract poem.each do |v| v.gsub!(/\n/m,"#{Mx[:br_nl]}\n") obj,tags=extract_tags(v) - h={:obj=>obj,:tags=>tags} + h={ obj: obj, tags: tags } t_o=SiSU_document_structure::Object_block_txt.new.verse(h) tuned_file << t_o end @@ -427,32 +427,32 @@ module SiSU_document_structure_extract end if @md.flag_endnotes tuned_file << @pb - h={:ln=>2,:obj=>'Endnotes',:autonum_=>false} + h={ ln: 2, obj: 'Endnotes', autonum_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) - h={:ln=>4,:obj=>'Endnotes',:name=>'endnotes',:autonum_=>false} + h={ ln: 4, obj: 'Endnotes', name: 'endnotes', autonum_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) - h={:obj=>'Endnotes'} + h={ obj: 'Endnotes' } end if @md.book_idx tuned_file << @pb - h={:ln=>2,:obj=>'Index',:autonum_=>false} + h={ ln: 2, obj: 'Index', autonum_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) - h={:ln=>4,:obj=>'Index',:name=>'book_index',:autonum_=>false} + h={ ln: 4, obj: 'Index', name: 'book_index', autonum_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) - h={:obj=>'Index'} + h={ obj: 'Index' } end tuned_file << @pb - h={:ln=>2,:obj=>'Metadata',:autonum_=>false,:ocn_=>false} + h={ ln: 2, obj: 'Metadata', autonum_: false, ocn_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) - h={:ln=>4,:obj=>'SiSU Metadata, document information',:name=>'metadata',:autonum_=>false,:ocn_=>false} + h={ ln: 4, obj: 'SiSU Metadata, document information', name: 'metadata', autonum_: false, ocn_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) tuned_file << @pb - h={:ln=>2,:obj=>'Manifest',:autonum_=>false,:ocn_=>false} + h={ ln: 2, obj: 'Manifest', autonum_: false, ocn_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) - h={:ln=>4,:obj=>'SiSU Manifest, alternative outputs etc.',:name=>'sisu_manifest',:autonum_=>false,:ocn_=>false} + h={ ln: 4, obj: 'SiSU Manifest, alternative outputs etc.', name: 'sisu_manifest', autonum_: false, ocn_: false } tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h) tuned_file - h={:obj=>'eof'} + h={ obj: 'eof' } meta=SiSU_document_structure::Object_metadata.new.metadata(@metadata) [tuned_file,meta] end @@ -465,11 +465,11 @@ module SiSU_document_structure_extract table end def meta_heading(h) - h={:lv=>h[:lv],:ln=>h[:ln],:name=>h[:name],:obj=>h[:obj],:ocn=>'0'} + h={ lv: h[:lv], ln: h[:ln], name: h[:name], obj: h[:obj], ocn: '0' } SiSU_document_structure::Object_heading.new.heading(h) end def meta_para(str) - h={:obj=>str,:ocn_=>false} + h={ obj: str, ocn_: false } SiSU_document_structure::Object_para.new.paragraph(h) end def metadata @@ -480,9 +480,9 @@ module SiSU_document_structure_extract language=l[:l] tr=SiSU_Translate::Source.new(@md,language) meta << @pb - h={:ln=>2,:obj=>'Metadata',:ocn_=>false} + h={ ln: 2, obj: 'Metadata', ocn_: false } meta << SiSU_document_structure::Object_heading.new.heading(h) - h={:ln=>4,:name=>'metadata',:obj=>'Metadata',:autonum_=>false,:ocn_=>false} + h={ ln: 4, name: 'metadata', obj: 'Metadata', autonum_: false, ocn_: false } meta << SiSU_document_structure::Object_heading.new.heading(h) #add ocnm s="Document Manifest @\n #{base_html}/#{@md.fn[:manifest]}" meta << meta_para(s) @@ -723,22 +723,22 @@ module SiSU_document_structure_extract and not @dob.bullet_ @dob=case @dob.obj when /^#{@md.lv1}/ - h={:lv=>'A',:ln=>1} + h={ lv: 'A', ln: 1 } SiSU_document_structure::Object_heading.new.heading(h,@dob) when /^#{@md.lv2}/ - h={:lv=>'B',:ln=>2} + h={ lv: 'B', ln: 2 } SiSU_document_structure::Object_heading.new.heading(h,@dob) when /^#{@md.lv3}/ - h={:lv=>'C',:ln=>3} + h={ lv: 'C', ln: 3 } SiSU_document_structure::Object_heading.new.heading(h,@dob) when /^#{@md.lv4}/ - h={:lv=>'1',:ln=>4} + h={ lv: '1', ln: 4 } SiSU_document_structure::Object_heading.new.heading(h,@dob) when /^#{@md.lv5}/ - h={:lv=>'2',:ln=>5} + h={ lv: '2', ln: 5 } SiSU_document_structure::Object_heading.new.heading(h,@dob) when /^#{@md.lv6}/ - h={:lv=>'3',:ln=>6} + h={ lv: '3', ln: 6 } SiSU_document_structure::Object_heading.new.heading(h,@dob) else @dob end @@ -896,19 +896,19 @@ module SiSU_document_structure_extract elsif dob.obj=~/#{Mx[:pa_non_object_no_heading]}/ dob.obj.gsub!(/#{Mx[:pa_non_object_no_heading]}/,'') if dob.is=='para' - h={:obj=>dob.obj,:ocn_=>false,:ocn=>nil} + h={ obj: dob.obj, ocn_: false, ocn: nil } dob=SiSU_document_structure::Object_para.new.paragraph(h,dob) elsif dob.is=='heading' - h={:obj=>dob.obj,:ocn_=>false,:ocn=>nil,:toc_=>true} + h={ obj: dob.obj, ocn_: false, ocn: nil, toc_: true } dob=SiSU_document_structure::Object_heading.new.heading(h,dob) end elsif dob.obj=~/#{Mx[:pa_non_object_dummy_heading]}/ dob.obj.gsub!(/#{Mx[:pa_non_object_dummy_heading]}/,'') if dob.is=='para' - h={:obj=>dob.obj,:ocn_=>false,:ocn=>nil} + h={ obj: dob.obj, ocn_: false, ocn: nil } dob=SiSU_document_structure::Object_para.new.paragraph(h,dob) elsif dob.is=='heading' - h={:obj=>dob.obj,:ocn_=>false,:ocn=>nil,:toc_=>false} + h={ obj: dob.obj, ocn_: false, ocn: nil, toc_: false } dob=SiSU_document_structure::Object_heading.new.heading(h,dob) end else dob @@ -940,7 +940,7 @@ module SiSU_document_structure_extract data=@data tuned_file=[] hs=[0,false,false,false] - t={:lv =>@s[0],:status =>'open'} + t={ lv: @s[0], status: 'open' } tuned_file << tags(t) if @md.cmd =~/V/ puts "\nXML sisu structure outline --->\n" @@ -1022,11 +1022,11 @@ module SiSU_document_structure_extract when '5'; 8 when '6'; 9 end - h={:tag=>tag,:node=>o[:node],:lv =>o[:lv],:ln =>ln,:status =>o[:status]} + h={ tag: tag, node: o[:node], lv: o[:lv], ln: ln, status: o[:status] } SiSU_document_structure::Object_structure.new.xml_dom(h) #downstream code utilise else ignore like comments end def tag_open(o,tag) - t={:lv =>tag[o.ln],:node =>o.node,:status =>'open'} + t={ lv: tag[o.ln], node: o.node, status: 'open' } t_o=tags(t) t_o end @@ -1035,116 +1035,116 @@ module SiSU_document_structure_extract case hs[0] when 1 if (lev <= 1) and hs[1] - t={:lv =>@s[1],:status =>'close'} + t={ lv: @s[1], status: 'close' } ary << tags(t) end if (lev==0) - t={:lv =>@s[0],:status =>'close'} + t={ lv: @s[0], status: 'close' } ary << tags(t) end when 2 if (lev <= 2) and hs[2] - t={:lv =>@s[2],:status =>'close'} + t={ lv: @s[2], status: 'close' } ary << tags(t) end if (lev <= 1) and hs[1] - t={:lv =>@s[1],:status =>'close'} + t={ lv: @s[1], status: 'close' } ary << tags(t) end if (lev==0) - t={:lv =>@s[0],:status =>'close'} + t={ lv: @s[0], status: 'close' } ary << tags(t) end when 3 if (lev <= 3) and hs[3] - t={:lv =>@s[3],:status =>'close'} + t={ lv: @s[3], status: 'close' } ary << tags(t) end if (lev <= 2) and hs[2] - t={:lv =>@s[2],:status =>'close'} + t={ lv: @s[2], status: 'close' } ary << tags(t) end if (lev <= 1) and hs[1] - t={:lv =>@s[1],:status =>'close'} + t={ lv: @s[1], status: 'close' } ary << tags(t) end if (lev==0) - t={:lv =>@s[0],:status =>'close'} + t={ lv: @s[0], status: 'close' } ary << tags(t) end when 4 if (lev <= 4) - t={:lv =>@s[4],:status =>'close'} + t={ lv: @s[4], status: 'close' } ary << tags(t) end if (lev <= 3) and hs[3] - t={:lv =>@s[3],:status =>'close'} + t={ lv: @s[3], status: 'close' } ary << tags(t) end if (lev <= 2) and hs[2] - t={:lv =>@s[2],:status =>'close'} + t={ lv: @s[2], status: 'close' } ary << tags(t) end if (lev <= 1) and hs[1] - t={:lv =>@s[1],:status =>'close'} + t={ lv: @s[1], status: 'close' } ary << tags(t) end if (lev==0) - t={:lv =>@s[0],:status =>'close'} + t={ lv: @s[0], status: 'close' } ary << tags(t) end when 5 if (lev <= 5) - t={:lv =>@s[5],:status =>'close'} + t={ lv: @s[5], status: 'close' } ary << tags(t) end if (lev <= 4) - t={:lv =>@s[4],:status =>'close'} + t={ lv: @s[4], status: 'close' } ary << tags(t) end if (lev <= 3) and hs[3] - t={:lv =>@s[3],:status =>'close'} + t={ lv: @s[3], status: 'close' } ary << tags(t) end if (lev <= 2) and hs[2] - t={:lv =>@s[2],:status =>'close'} + t={ lv: @s[2], status: 'close' } ary << tags(t) end if (lev <= 1) and hs[1] - t={:lv =>@s[1],:status =>'close'} + t={ lv: @s[1], status: 'close' } ary << tags(t) end if (lev==0) - t={:lv =>@s[0],:status =>'close'} + t={ lv: @s[0], status: 'close' } ary << tags(t) end when 6 if (lev <= 6) - t={:lv =>@s[6],:status =>'close'} + t={ lv: @s[6], status: 'close' } ary << tags(t) end if (lev <= 5) - t={:lv =>@s[5],:status =>'close'} + t={ lv: @s[5], status: 'close' } ary << tags(t) end if (lev <= 4) - t={:lv =>@s[4],:status =>'close'} + t={ lv: @s[4], status: 'close' } ary << tags(t) end if (lev <= 3) and hs[3] - t={:lv =>@s[3],:status =>'close'} + t={ lv: @s[3], status: 'close' } ary << tags(t) end if (lev <= 2) and hs[2] - t={:lv =>@s[2],:status =>'close'} + t={ lv: @s[2], status: 'close' } ary << tags(t) end if (lev <= 1) and hs[1] - t={:lv =>@s[1],:status =>'close'} + t={ lv: @s[1], status: 'close' } ary << tags(t) end if (lev==0) - t={:lv =>@s[0],:status =>'close'} + t={ lv: @s[0], status: 'close' } ary << tags(t) end end diff --git a/lib/sisu/v3/dal_endnotes.rb b/lib/sisu/v3/dal_endnotes.rb index 6811722f..e0b4a57d 100644 --- a/lib/sisu/v3/dal_endnotes.rb +++ b/lib/sisu/v3/dal_endnotes.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/dal_expand_insertions.rb b/lib/sisu/v3/dal_expand_insertions.rb index 1bc66a84..0f925bc0 100644 --- a/lib/sisu/v3/dal_expand_insertions.rb +++ b/lib/sisu/v3/dal_expand_insertions.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/dal_hash_digest.rb b/lib/sisu/v3/dal_hash_digest.rb index 87cf4738..fe432974 100644 --- a/lib/sisu/v3/dal_hash_digest.rb +++ b/lib/sisu/v3/dal_hash_digest.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_hash - require "#{SiSU_lib}/shared_markup_alt.rb" #shared_markup_alt.rb + require_relative 'shared_markup_alt.rb' #shared_markup_alt.rb class Object_digest def initialize(md,data,env=nil) @md,@data,@env=md,data,env diff --git a/lib/sisu/v3/dal_idx.rb b/lib/sisu/v3/dal_idx.rb index ee37690c..dd2b1331 100644 --- a/lib/sisu/v3/dal_idx.rb +++ b/lib/sisu/v3/dal_idx.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -102,10 +102,10 @@ module SiSU_book_index idxl=[] g.each do |i| i.strip! - idxl << { :rough_idx => i, :ocn => ocn, :seg => seg } + idxl << { rough_idx: i, ocn: ocn, seg: seg } end idxl - else { :rough_idx => idx_list, :ocn => ocn, :seg => seg } + else { rough_idx: idx_list, ocn: ocn, seg: seg } end end idx_lst.flatten! @@ -128,20 +128,20 @@ module SiSU_book_index x=if idx_lst.length==1 or idx_lst[0].gsub(/\+\d+/,'')==i the_idx[use]['term_node_lev1']=[] unless the_idx[use]['term_node_lev1'] and defined? the_idx[use]['term_node_lev1'] x=if r - the_idx[use]['term_node_lev1'] << { :ocn => idx[:ocn], :range => "#{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}", :seg => idx[:seg] } + the_idx[use]['term_node_lev1'] << { ocn: idx[:ocn], range: "#{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}", seg: idx[:seg] } "#{i} #{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}" else - the_idx[use]['term_node_lev1'] << { :ocn => idx[:ocn], :seg => idx[:seg] } + the_idx[use]['term_node_lev1'] << { ocn: idx[:ocn], seg: idx[:seg] } "#{i} #{idx[:ocn]}" end else the_idx[use]['term_node_lev2']={} unless the_idx[use]['term_node_lev2'] and defined? the_idx[use]['term_node_lev2'] the_idx[use]['term_node_lev2'][i]=[] unless the_idx[use]['term_node_lev2'][i] and defined? the_idx[use]['term_node_lev2'][i] x=if r - the_idx[use]['term_node_lev2'][i] << { :ocn => idx[:ocn], :range => "#{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}", :seg => idx[:seg] } + the_idx[use]['term_node_lev2'][i] << { ocn: idx[:ocn], range: "#{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}", seg: idx[:seg] } "#{idx_lst[0]}:#{i} #{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}" else - the_idx[use]['term_node_lev2'][i] << { :ocn => idx[:ocn], :seg => idx[:seg] } + the_idx[use]['term_node_lev2'][i] << { ocn: idx[:ocn], seg: idx[:seg] } "#{idx_lst[0]}:#{i} #{idx[:ocn]}" end end @@ -163,15 +163,15 @@ module SiSU_book_index @x=1 idx={} idx[:sst_rel_html_seg],idx[:sst_rel],idx[:html],idx[:xhtml]=[],[],[],[] - h={:obj=>Mx[:br_page]} + h={obj: Mx[:br_page]} o=SiSU_document_structure::Object_layout.new.break(h) idx[:sst_rel_html_seg] << o idx[:sst_rel] << o - h={:lv=>'2',:name=>'index',:obj=>"Index"} + h={lv: '2', name: 'index', obj: "Index"} o=SiSU_document_structure::Object_heading.new.heading(h) idx[:sst_rel_html_seg] << o idx[:sst_rel] << o - h={:lv=>'4',:name=>'idx',:obj=>" [Index] #{Mx[:pa_non_object_dummy_heading]}"} + h={lv: '4', name: 'idx', obj: " [Index] #{Mx[:pa_non_object_dummy_heading]}"} o=SiSU_document_structure::Object_heading.new.heading(h) idx[:sst_rel_html_seg] << o idx[:sst_rel] << o diff --git a/lib/sisu/v3/dal_images.rb b/lib/sisu/v3/dal_images.rb index 693d7e9c..0d541a13 100644 --- a/lib/sisu/v3/dal_images.rb +++ b/lib/sisu/v3/dal_images.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/dal_metadata.rb b/lib/sisu/v3/dal_metadata.rb index e7614fc4..31a7e4b2 100644 --- a/lib/sisu/v3/dal_metadata.rb +++ b/lib/sisu/v3/dal_metadata.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -65,11 +65,11 @@ module SiSU_metadata @tr=SiSU_Translate::Source.new(md,language) end def make_para(obj,ocn) - h={:obj=>obj,:ocn=>0} + h={ obj: obj, ocn: 0 } SiSU_document_structure::Object_para.new.paragraph(h) end def make_heading(obj,ocn,name,lv,ln) - h={:lv=>lv,:ln=>ln,:name=>name,:obj=>obj,:ocn=>0} + h={ lv: lv, ln: ln, name: name, obj: obj, ocn: 0 } SiSU_document_structure::Object_heading.new.heading(h) end def metadata diff --git a/lib/sisu/v3/dal_numbering.rb b/lib/sisu/v3/dal_numbering.rb index 94ff2328..7a0c4365 100644 --- a/lib/sisu/v3/dal_numbering.rb +++ b/lib/sisu/v3/dal_numbering.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -357,15 +357,15 @@ module SiSU_numbering @segname=((dob.is=='heading'|| dob.is=='heading_insert') && dob.ln==4 && (defined? dob.name)) \ ? (dob.name) \ : @segname - tags["#{dob.ocn}"]={:segname=>@segname} + tags["#{dob.ocn}"]={ segname: @segname } ocn_html_seg[dob.ocn]=if dob.is =~/heading/ x=if dob.ln =~/[1-3]/ - {:seg=>nil,:level=> dob.ln} + { seg: nil, level: dob.ln } else #elsif dob.ln =~/[4-6]/ - {:seg=>@seg,:level=> dob.ln} + { seg: @seg, level: dob.ln } end else - {:seg=>@seg,:level=>nil} + { seg: @seg, level: nil } end end dob.tags=dob.tags.uniq if defined? dob.tags @@ -375,7 +375,7 @@ module SiSU_numbering #? (dob.name) \ #: @segname dob.tags.each do |x| - tags[x]={:ocn=>dob.ocn.to_s,:segname=>@segname} #@tags[x.to_s]=[dob.ocn.to_s,@segname.to_s] + tags[x]={ ocn: dob.ocn.to_s, segname: @segname } end end dob diff --git a/lib/sisu/v3/dal_substitutions_and_insertions.rb b/lib/sisu/v3/dal_substitutions_and_insertions.rb index bb6e9d24..84b58756 100644 --- a/lib/sisu/v3/dal_substitutions_and_insertions.rb +++ b/lib/sisu/v3/dal_substitutions_and_insertions.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -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/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb index 6620c3ad..2de931f6 100644 --- a/lib/sisu/v3/dal_syntax.rb +++ b/lib/sisu/v3/dal_syntax.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -78,13 +78,13 @@ module SiSU_Syntax @emph=case emph_set when /bold/ emph_italics=false - {:o =>Mx[:fa_bold_o], :c =>Mx[:fa_bold_c] } + { o: Mx[:fa_bold_o], c: Mx[:fa_bold_c] } when /italics/ emph_italics=true - {:o =>Mx[:fa_italics_o], :c =>Mx[:fa_italics_c] } + { o: Mx[:fa_italics_o], c: Mx[:fa_italics_c] } when /underscore/ emph_italics=false - {:o =>Mx[:fa_underscore_o], :c =>Mx[:fa_underscore_c] } + { o: Mx[:fa_underscore_o], c: Mx[:fa_underscore_c] } else p __LINE__.to_s + '::' + __FILE__ end @http_m=%r{\{.+?\}https?://\S+|https?:\S+|:\S+|\.\.\/\S+|#\S+|\S+?\.png\b|[*]~\S+|^#{Mx[:meta_o]}.+|#{Mx[:gr_o]}(?:code|block|group|alt|verse)(?:-end)?#{Mx[:gr_c]}|#{Mx[:fa_o]}:br#{Mx[:fa_c]}} diff --git a/lib/sisu/v3/db_columns.rb b/lib/sisu/v3/db_columns.rb index 61febc54..268463e2 100644 --- a/lib/sisu/v3/db_columns.rb +++ b/lib/sisu/v3/db_columns.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,8 +58,8 @@ =end module SiSU_DB_columns - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/db_sqltxt" # db_sqltxt.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'db_sqltxt' # db_sqltxt.rb class Columns < SiSU_DB_text::Prepare def initialize(md=nil) @md=md diff --git a/lib/sisu/v3/db_create.rb b/lib/sisu/v3/db_create.rb index 2d4aee0b..35750c4b 100644 --- a/lib/sisu/v3/db_create.rb +++ b/lib/sisu/v3/db_create.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,9 +58,9 @@ =end module SiSU_DB_create - require "#{SiSU_lib}/db_columns" # db_columns.rb + require_relative 'db_columns' # db_columns.rb class Create < SiSU_DB_columns::Columns - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb @@dl=nil def initialize(opt,conn,file,sql_type='pg') @opt,@conn,@file,@sql_type=opt,conn,file,sql_type diff --git a/lib/sisu/v3/db_dbi.rb b/lib/sisu/v3/db_dbi.rb index 3c59afa0..f4d5c891 100644 --- a/lib/sisu/v3/db_dbi.rb +++ b/lib/sisu/v3/db_dbi.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,15 +58,15 @@ =end module SiSU_DB_DBI - require "#{SiSU_lib}/db_columns" # db_columns.rb - require "#{SiSU_lib}/db_tests" # db_tests.rb - require "#{SiSU_lib}/db_create" # db_create.rb - require "#{SiSU_lib}/db_select" # db_select.rb - require "#{SiSU_lib}/db_indexes" # db_indexes.rb - require "#{SiSU_lib}/db_drop" # db_drop.rb - require "#{SiSU_lib}/db_remove" # db_remove.rb - require "#{SiSU_lib}/db_load_tuple" # db_load_tuple.rb - require "#{SiSU_lib}/db_import" # db_import.rb + require_relative 'db_columns' # db_columns.rb + require_relative 'db_tests' # db_tests.rb + require_relative 'db_create' # db_create.rb + require_relative 'db_select' # db_select.rb + require_relative 'db_indexes' # db_indexes.rb + require_relative 'db_drop' # db_drop.rb + require_relative 'db_remove' # db_remove.rb + require_relative 'db_load_tuple' # db_load_tuple.rb + require_relative 'db_import' # db_import.rb class Column_size < SiSU_DB_columns::Column_size # db_columns.rb end class Test < SiSU_DB_tests::Test # db_tests.rb diff --git a/lib/sisu/v3/db_drop.rb b/lib/sisu/v3/db_drop.rb index c2a32179..cbe604e8 100644 --- a/lib/sisu/v3/db_drop.rb +++ b/lib/sisu/v3/db_drop.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,7 +59,7 @@ =end module SiSU_DB_drop class Drop - require "#{SiSU_lib}/response" # response.rb + require_relative 'response' # response.rb def initialize(opt,conn,db_info,sql_type='') @opt,@conn,@db_info,@sql_type=opt,conn,db_info,sql_type @ans=SiSU_Response::Response.new diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb index 2c4c9bad..f1e7f064 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,10 +58,10 @@ =end module SiSU_DB_import - require "#{SiSU_lib}/db_columns" # db_columns.rb - require "#{SiSU_lib}/db_load_tuple" # db_load_tuple.rb - require "#{SiSU_lib}/db_sqltxt" # db_sqltxt.rb - require "#{SiSU_lib}/shared_html_lite" # shared_html_lite.rb + require_relative 'db_columns' # db_columns.rb + require_relative 'db_load_tuple' # db_load_tuple.rb + require_relative 'db_sqltxt' # db_sqltxt.rb + require_relative 'shared_html_lite' # shared_html_lite.rb require 'sqlite3' class Import < SiSU_DB_text::Prepare include SiSU_Param @@ -73,7 +73,7 @@ module SiSU_DB_import @opt,@conn,@file,@sql_type=opt,conn,file,sql_type @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX @env=SiSU_Env::Info_env.new(@opt.fns) - @dal="#{@env.path.dal}" + @dal="#{@env.processing_path.dal}" if @opt.fns.empty? or @opt.cmd.empty?; @fnb='' else @md=SiSU_Param::Parameters.new(@opt).get @@ -116,7 +116,7 @@ module SiSU_DB_import @@dl ||=SiSU_Env::Info_env.new.digest.length end def marshal_load - require "#{SiSU_lib}/dal" # dal.rb + require_relative 'dal' # dal.rb @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here SiSU_Screen::Ansi.new(@opt.cmd,"#{@db.psql.db}::#{@opt.fns}").puts_blue if @opt.cmd =~/vVM/ SiSU_Screen::Ansi.new(@opt.cmd,'Marshal Load',@fnc).puts_grey if @opt.cmd =~/v/ @@ -162,7 +162,7 @@ module SiSU_DB_import puts "Error message: #{e.errstr}" puts "Error SQLSTATE: #{e.state}" SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - sqlfn="#{@env.path.sql}/#{@md.fnb}.sql" + sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" sql=File.new(sqlfn,'w') t_d.each {|i| sql.puts i} p sqlfn @@ -173,7 +173,7 @@ module SiSU_DB_import end rescue SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - sqlfn="#{@env.path.sql}/#{@md.fnb}.sql" + sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" sql=File.new(sqlfn,'w') t_d.each {|i| sql.puts i} p sqlfn @@ -421,17 +421,17 @@ module SiSU_DB_import txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n} end if txt - en={ :type => 'endnotes', - :id => @id_n, - :lid => @col[:lid], - :nr => nr, - :txt => txt, - :body => body, - :ocn => @col[:ocn], - :ocnd => @col[:ocnd], - :ocns => @col[:ocns], - :id_t => @@id_t, - :hash => digest_clean + en={ type: 'endnotes', + id: @id_n, + lid: @col[:lid], + nr: nr, + txt: txt, + body: body, + ocn: @col[:ocn], + ocnd: @col[:ocnd], + ocns: @col[:ocns], + id_t: @@id_t, + hash: digest_clean } t=SiSU_DB_tuple::Load_endnotes.new(@conn,en,@opt,@file) @tuple_array << t.tuple @@ -459,17 +459,17 @@ module SiSU_DB_import txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n} end if txt - en={ :type => 'endnotes_asterisk', - :id => @id_n, - :lid => @col[:lid], - :nr => nr, - :txt => txt, - :body => body, - :ocn => @col[:ocn], - :ocnd => @col[:ocnd], - :ocns => @col[:ocns], - :id_t => @@id_t, - :hash => digest_clean + en={ type: 'endnotes_asterisk', + id: @id_n, + lid: @col[:lid], + nr: nr, + txt: txt, + body: body, + ocn: @col[:ocn], + ocnd: @col[:ocnd], + ocns: @col[:ocns], + id_t: @@id_t, + hash: digest_clean } t=SiSU_DB_tuple::Load_endnotes.new(@conn,en,@opt,@file) @tuple_array << t.tuple @@ -497,17 +497,17 @@ module SiSU_DB_import txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n} end if txt - en={ :type => 'endnotes_plus', - :id => @id_n, - :lid => @col[:lid], - :nr => nr, - :txt => txt, - :body => body, - :ocn => @col[:ocn], - :ocnd => @col[:ocnd], - :ocns => @col[:ocns], - :id_t => @@id_t, - :hash => digest_clean + en={ type: 'endnotes_plus', + id: @id_n, + lid: @col[:lid], + nr: nr, + txt: txt, + body: body, + ocn: @col[:ocn], + ocnd: @col[:ocnd], + ocns: @col[:ocns], + id_t: @@id_t, + hash: digest_clean } t=SiSU_DB_tuple::Load_endnotes.new(@conn,en,@opt,@file) @tuple_array << t.tuple diff --git a/lib/sisu/v3/db_indexes.rb b/lib/sisu/v3/db_indexes.rb index 0f77c96d..de20e4c4 100644 --- a/lib/sisu/v3/db_indexes.rb +++ b/lib/sisu/v3/db_indexes.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/db_load_tuple.rb b/lib/sisu/v3/db_load_tuple.rb index 8beed2a6..183f8fc4 100644 --- a/lib/sisu/v3/db_load_tuple.rb +++ b/lib/sisu/v3/db_load_tuple.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,9 +58,9 @@ =end module SiSU_DB_tuple - require "#{SiSU_lib}/db_columns" # db_columns.rb + require_relative 'db_columns' # db_columns.rb class Load_documents - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param def initialize(conn,col,opt,file) @conn,@col,@opt,@file=conn,col,opt,file diff --git a/lib/sisu/v3/db_remove.rb b/lib/sisu/v3/db_remove.rb index a3acbc5a..025514b1 100644 --- a/lib/sisu/v3/db_remove.rb +++ b/lib/sisu/v3/db_remove.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/db_select.rb b/lib/sisu/v3/db_select.rb index 4ac6e75d..9bf8acbc 100644 --- a/lib/sisu/v3/db_select.rb +++ b/lib/sisu/v3/db_select.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -91,10 +91,10 @@ module SiSU_DB_select file=if @opt.inspect =~/M/ x=if @opt.fns and not @opt.fns.empty? @env=SiSU_Env::Info_env.new(@opt.fns) if @opt.fns - puts "\n#{@env.path.sqlite}/#{@opt.fns}.sql" if @sql_type =~/sqlite/ and @opt.cmd =~/M/ + puts "\n#{@env.processing_path.sqlite}/#{@opt.fns}.sql" if @sql_type =~/sqlite/ and @opt.cmd =~/M/ @db=SiSU_Env::Info_db.new - @job="sqlite3 #{@db.sqlite.db} < #{@env.path.sqlite}/#{@opt.fns}.sql" - File.new("#{@env.path.sqlite}/#{@opt.fns}.sql",'w+') + @job="sqlite3 #{@db.sqlite.db} < #{@env.processing_path.sqlite}/#{@opt.fns}.sql" + File.new("#{@env.processing_path.sqlite}/#{@opt.fns}.sql",'w+') elsif @opt.fns and @opt.fns.inspect =~/create/; nil #sort variations later else nil end diff --git a/lib/sisu/v3/db_sqltxt.rb b/lib/sisu/v3/db_sqltxt.rb index 31e44667..c5a2b79c 100644 --- a/lib/sisu/v3/db_sqltxt.rb +++ b/lib/sisu/v3/db_sqltxt.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/db_tests.rb b/lib/sisu/v3/db_tests.rb index 9854f8b6..babcd683 100644 --- a/lib/sisu/v3/db_tests.rb +++ b/lib/sisu/v3/db_tests.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/dbi.rb b/lib/sisu/v3/dbi.rb index 10374a37..7d4a5445 100644 --- a/lib/sisu/v3/dbi.rb +++ b/lib/sisu/v3/dbi.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,14 +57,14 @@ =end module SiSU_DBI #% database building - require "#{SiSU_lib}/help" # help.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'help' # help.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/db_dbi" # db_dbi.rb + require_relative 'db_dbi' # db_dbi.rb include SiSU_DB_DBI - require "#{SiSU_lib}/shared_html_lite" # shared_html_lite.rb + require_relative 'shared_html_lite' # shared_html_lite.rb include SiSU_Format_Shared class SiSU_SQL def initialize(opt) diff --git a/lib/sisu/v3/defaults.rb b/lib/sisu/v3/defaults.rb index 6286ed17..87e8c577 100644 --- a/lib/sisu/v3/defaults.rb +++ b/lib/sisu/v3/defaults.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,9 +59,9 @@ $latex_run=nil module SiSU_Viz require 'uri' - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/css" # css.rb + require_relative 'css' # css.rb include SiSU_Style class Skin def initialize @@ -153,39 +153,39 @@ module SiSU_Viz def semantic_tags def default { - :pub => 'publication', - :conv => 'convention', - :vol => 'volume', - :pg => 'page', - :cty => 'city', - :org => 'organization', - :uni => 'university', - :dept => 'department', - :fac => 'faculty', - :inst => 'institute', - :co => 'company', - :com => 'company', - :conv => 'convention', - :dt => 'date', - :y => 'year', - :m => 'month', - :d => 'day', - :ti => 'title', - :au => 'author', - :ed => 'editor', #editor? - :v => 'version', #edition - :n => 'name', - :fn => 'firstname', - :mn => 'middlename', - :ln => 'lastname', - :in => 'initials', - :qt => 'quote', - :ct => 'cite', - :ref => 'reference', - :ab => 'abreviation', - :def => 'define', - :desc => 'description', - :trans => 'translate', + pub: 'publication', + conv: 'convention', + vol: 'volume', + pg: 'page', + cty: 'city', + org: 'organization', + uni: 'university', + dept: 'department', + fac: 'faculty', + inst: 'institute', + co: 'company', + com: 'company', + conv: 'convention', + dt: 'date', + y: 'year', + m: 'month', + d: 'day', + ti: 'title', + au: 'author', + ed: 'editor', #editor? + v: 'version', #edition + n: 'name', + fn: 'firstname', + mn: 'middlename', + ln: 'lastname', + in: 'initials', + qt: 'quote', + ct: 'cite', + ref: 'reference', + ab: 'abreviation', + def: 'define', + desc: 'description', + trans: 'translate', } end self diff --git a/lib/sisu/v3/digests.rb b/lib/sisu/v3/digests.rb index 26e91528..3d35fbd7 100644 --- a/lib/sisu/v3/digests.rb +++ b/lib/sisu/v3/digests.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_Digest_view - require "#{SiSU_lib}/particulars" # particulars.rb - require "#{SiSU_lib}/i18n" # i18n.rb - require "#{SiSU_lib}/shared_markup_alt.rb" # shared_markup_alt.rb + require_relative 'particulars' # particulars.rb + require_relative 'i18n' # i18n.rb + require_relative 'shared_markup_alt.rb' # shared_markup_alt.rb pwd=Dir.pwd class Source @@dg=nil diff --git a/lib/sisu/v3/embedded.rb b/lib/sisu/v3/embedded.rb index 51742957..29a71f6b 100644 --- a/lib/sisu/v3/embedded.rb +++ b/lib/sisu/v3/embedded.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_Embedded - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env class Source require 'fileutils' diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index 22c42980..b76beb17 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,18 +58,18 @@ =end module SiSU_EPUB require 'pstore' - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/xhtml_table" # xhtml_table.rb - require "#{SiSU_lib}/epub_format" # epub_format.rb + require_relative 'xhtml_table' # xhtml_table.rb + require_relative 'epub_format' # epub_format.rb include SiSU_EPUB_Format - require "#{SiSU_lib}/epub_segments" # epub_segments.rb + require_relative 'epub_segments' # epub_segments.rb include SiSU_EPUB_seg - require "#{SiSU_lib}/epub_tune" # epub_tune.rb + require_relative 'epub_tune' # epub_tune.rb include SiSU_EPUB_Tune - require "#{SiSU_lib}/epub_concordance" # epub_concordance.rb + require_relative 'epub_concordance' # epub_concordance.rb class Source def initialize(opt) @opt=opt @@ -93,9 +93,9 @@ module SiSU_EPUB : SiSU_Screen::Ansi.new(@opt.cmd,'EPUB',tool).green_title_hi SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.epub}/#{@md.file.base_filename.epub}").flow if @opt.cmd =~/[MV]/ end - @env.path.epub_bld #(@md) - @env.path.epub_cp_images(@md) - dir_epub=@env.path.epub + @env.processing_path.epub_bld #(@md) + @env.processing_path.epub_cp_images(@md) + dir_epub=@env.processing_path.epub SiSU_Env::Info_skin.new(@md).select data=nil SiSU_Env::SiSU_file.new(@md).mkdir.output.epub @@ -110,7 +110,7 @@ module SiSU_EPUB rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure unless @opt.cmd =~/[MV]/ #check maintenance flag - texfiles=Dir["#{@env.path.tune}/#{@opt.fns}*"] + texfiles=Dir["#{@env.processing_path.tune}/#{@opt.fns}*"] texfiles.each do |f| if FileTest.file?(f) File.unlink(f) @@ -173,7 +173,7 @@ module SiSU_EPUB endnote_array = pg.obj.scan(/#{Mx[:en_b_o]}[\d+]+(.+?)#{Mx[:en_b_c]}/m) end endnote_array.flatten.each do |note| - txt_obj={:txt =>note} + txt_obj={ txt: note } format_scroll=SiSU_EPUB_Format::Format_scroll.new(@md,txt_obj) @scr_endnotes << format_scroll.endnote_body end @@ -184,7 +184,7 @@ module SiSU_EPUB end end class Toc - @@toc={ :seg=>[],:seg_mini=>[],:scr=>[],:ncx=>[],:opf=>[] } + @@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] } @@seg_url='' @@firstseg=nil def initialize(md=nil,data='') @@ -197,7 +197,7 @@ module SiSU_EPUB SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey if @md.cmd =~/[MVv]/ toc=nil @@firstseg=nil - @@toc={ :seg=>[],:seg_mini=>[],:scr=>[],:ncx=>[],:opf=>[] } + @@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] } md_opf_a_content,md_opf_a_spine=[],[] @nav_no=1 @@toc[:ncx] << @epub.toc_ncx.open #epub ncx navmap @@ -313,7 +313,7 @@ module SiSU_EPUB %{<b><a href="#{@md.fnl[:pre]}#{link}#{@md.fnl[:mid]}#{Sfx[:epub_xhtml]}#{@md.fnl[:post]}">#{linkname}</a></b>} end toc={} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:seg]=if dob.name =~/^meta/ \ and dob.obj =~/Document Information/ #check @@ -341,7 +341,7 @@ module SiSU_EPUB end %{<b><a href="##{link}">#{linkname}</a></b>} end - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:scr]=if dob.name =~/^meta/ \ and dob.obj =~/Document Information/ @@ -357,14 +357,14 @@ module SiSU_EPUB and ocn !~/#/ p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) end - txt_obj={:txt =>linkname} + txt_obj={ txt: linkname } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev2 toc[:seg_mini]=format_toc.mini_lev2 if p_num title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev2 end @@ -377,14 +377,14 @@ module SiSU_EPUB and ocn !~/#/ p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) end - txt_obj={:txt =>linkname} + txt_obj={ txt: linkname } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev3 toc[:seg_mini]=format_toc.mini_lev3 if p_num title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev3 end @@ -405,13 +405,13 @@ module SiSU_EPUB %{\\1 \\2</a> }) end p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) if ocn - txt_obj={:txt =>seg_link} + txt_obj={ txt: seg_link } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev4 toc[:seg_mini]=format_toc.mini_lev4 title=%{#{p_num.goto}#{linkname}</a>} if p_num - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev4 toc @@ -426,12 +426,12 @@ module SiSU_EPUB lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:epub_xhtml]}#{@md.fnl[:post]}#o#{ocn}"> #{linkname} </a>} - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:seg]=format_toc.lev5 toc[:seg_mini]=format_toc.mini_lev5 title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev5 end @@ -447,12 +447,12 @@ module SiSU_EPUB lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:epub_xhtml]}#{@md.fnl[:post]}#o#{ocn}"> #{linkname} </a>} - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:seg]=format_toc.lev6 toc[:seg_mini]=format_toc.mini_lev6 title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev6 end @@ -513,7 +513,7 @@ module SiSU_EPUB tmp_head=nil doc_title_endnote=@md.title.full.gsub(/(\*+)/,'<sup><a href="#endnotes">\1</a></sup>') tmp_head=doc_title_endnote + "\n" - txt_obj={:txt =>tmp_head} + txt_obj={ txt: tmp_head } format_txt_obj=SiSU_EPUB_Format::Format_text_object.new(@md,txt_obj) toc_shared << format_txt_obj.center_bold segtoc << format_txt_obj.center_bold @@ -521,7 +521,7 @@ module SiSU_EPUB and @md.creator.author creator_endnote=@md.creator.author.gsub(/(\*+)/,%{ <sup><a href="#notes">\\1</a></sup>}) tmp_head=creator_endnote + "\n" - txt_obj={:txt =>tmp_head} + txt_obj={ txt: tmp_head } format_txt_obj=SiSU_EPUB_Format::Format_text_object.new(@md,txt_obj) toc_shared << format_txt_obj.center_bold segtoc << format_txt_obj.center_bold @@ -629,9 +629,9 @@ module SiSU_EPUB def images img_pth=@md.env.path.image_source_include @md.ec[:image].each do |x| - if FileTest.directory?("#{@md.env.path.epub}/OPS/image") \ + if FileTest.directory?("#{@md.env.processing_path.epub}/OPS/image") \ and FileTest.file?("#{img_pth}/#{x}") - cp("#{img_pth}/#{x}","#{@md.env.path.epub}/OPS/image") + cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/OPS/image") end end end @@ -641,13 +641,13 @@ module SiSU_EPUB def output_zip mkdir_p(@md.file.output_path.epub) unless FileTest.directory?(@md.file.output_path.epub) system(" - cd #{@md.env.path.epub} + cd #{@md.env.processing_path.epub} zip -qXr9D #{@epub_doc} * mv #{@epub_doc} #{@md.file.place_file.epub} cd #{Dir.pwd} ") unless @md.cmd.inspect =~/M/ - system("rm -r #{@md.env.path.epub}") + system("rm -r #{@md.env.processing_path.epub}") end end def segtoc diff --git a/lib/sisu/v3/epub_concordance.rb b/lib/sisu/v3/epub_concordance.rb index 88a1109f..e03034dc 100644 --- a/lib/sisu/v3/epub_concordance.rb +++ b/lib/sisu/v3/epub_concordance.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,13 +58,13 @@ =end module SiSU_EPUB_Concordance - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/epub_format" # epub_format.rb + require_relative 'epub_format' # epub_format.rb include SiSU_EPUB_Format class Source def initialize(opt) @@ -96,7 +96,7 @@ module SiSU_EPUB_Concordance class Doc_title include SiSU_Viz #revisit, both requires (html & shared_xml) needed for stand alone operation (sisu -w [filename]) - require "#{SiSU_lib}/epub" # epub.rb + require_relative 'epub' # epub.rb def initialize(particulars) @particulars,@md=particulars,particulars.md @data=SiSU_EPUB::Source::XHtml_environment.new(particulars).tuned_file_instructions @@ -145,18 +145,18 @@ WOK end end class Words - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/epub_format" # epub_format.rb + require_relative 'epub_format' # epub_format.rb include SiSU_EPUB_Format - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Screen def initialize(particulars) @particulars=particulars begin @vz=SiSU_Env::Get_init.instance.skin @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array - @path="#{@env.path.epub}" + @path="#{@env.processing_path.epub}" @freq=Hash.new(0) @rxp_lv1=/^#{Mx[:lv_o]}1:/ #fix Mx[:lv_o] @rxp_lv2=/^#{Mx[:lv_o]}2:/ #fix Mx[:lv_o] diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 893b6015..519ba16b 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb index 7eb43eec..c06f11f2 100644 --- a/lib/sisu/v3/epub_segments.rb +++ b/lib/sisu/v3/epub_segments.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_EPUB_seg - require "#{SiSU_lib}/shared_xhtml" # shared_xhtml.rb - require "#{SiSU_lib}/epub" # epub.rb - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb + require_relative 'shared_xhtml' # shared_xhtml.rb + require_relative 'epub' # epub.rb + require_relative 'shared_metadata' # shared_metadata.rb class Seg_output def initialize(md,outputfile,seg,minitoc,type='') @md,@output_epub_cont_seg,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type @@ -72,7 +72,7 @@ module SiSU_EPUB_seg @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Endnotes',:ocn_display =>''} + txt_obj={ txt: 'Endnotes', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_endnotes] << @seg[:headings] << %{\n<div class="content">\n} << @seg[:endnote_all] << '</div>' @@ -80,7 +80,7 @@ module SiSU_EPUB_seg @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Index',:ocn_display =>''} + txt_obj={ txt: 'Index', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << @seg[:idx] << '</div>' @@ -89,7 +89,7 @@ module SiSU_EPUB_seg @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Metadata',:ocn_display =>''} + txt_obj={ txt: 'Metadata', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << metadata << '</div>' @@ -106,7 +106,7 @@ WOK @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Manifest',:ocn_display =>''} + txt_obj={ txt: 'Manifest', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << manifest << '</div>' @@ -223,7 +223,7 @@ WOK end end if @@is4==1 - dir_epub_cont="#{@md.env.path.epub}/OPS" + dir_epub_cont="#{@md.env.processing_path.epub}/OPS" if newfile==1 \ or dob.obj =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/ newfile=0 @@ -314,7 +314,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>@@heading1,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: @@heading1, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') @@heading1.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -325,7 +325,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading2,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') @@heading2.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -336,7 +336,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading3,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') @@heading3.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -347,7 +347,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading4,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading4, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading4.gsub(clean,'') end @@ -497,7 +497,7 @@ WOK e_n=note_match_seg[/(?:#{Mx[:en_a_o]}(?:\d|#{ast}|#{pls})+|#{Mx[:en_b_o]}(?:#{ast}|#{pls})\d+)\s+(.+?)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,1] try=e_n.split(/<br \/>/) try.each do |e| - txt_obj={:txt =>e} + txt_obj={ txt: e } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) note_match=if e =~/#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}/ format_seg.endnote_body_indent @@ -510,7 +510,7 @@ WOK m=/(?:#{Mx[:en_a_o]}(?:\d|#{ast}|#{pls})+|#{Mx[:en_b_o]}(?:#{ast}|#{pls})\d+)\s+(.+?href=")(#note_ref(?:\d|_a|_b)+".+)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/mi endnote_part_a=note_match_seg[m,1] endnote_part_b=note_match_seg[m,2] - txt_obj={:endnote_part_a =>endnote_part_a,:endnote_part_b =>endnote_part_b} + txt_obj={ endnote_part_a: endnote_part_a, endnote_part_b: endnote_part_b } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) note_match_all_seg=format_seg.endnote_seg_body(@@fn) #BUG WATCH 200408 @@seg[:endnote_all] << note_match_all_seg diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb index b98f9caf..746a112e 100644 --- a/lib/sisu/v3/epub_tune.rb +++ b/lib/sisu/v3/epub_tune.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -56,11 +56,11 @@ ** Description: epub generation, epub pre-processing =end -require "#{SiSU_lib}/param" +require_relative 'param' module SiSU_EPUB_Tune - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen - require "#{SiSU_lib}/epub_format" # epub_format.rb #watch + require_relative 'epub_format' # epub_format.rb #watch @@line_mode='' @@endnote_array=[] @@endnote_call_counter=1 @@ -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/errors.rb b/lib/sisu/v3/errors.rb index aafc6d02..57b961bd 100644 --- a/lib/sisu/v3/errors.rb +++ b/lib/sisu/v3/errors.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Errors - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen class Info_error <Create_file def initialize(error,errorlist,cmd,fns='') diff --git a/lib/sisu/v3/git.rb b/lib/sisu/v3/git.rb index b14645c9..9d1d9332 100644 --- a/lib/sisu/v3/git.rb +++ b/lib/sisu/v3/git.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_Git - require "#{SiSU_lib}/param" # param.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/dal" # dal.rb + require_relative 'param' # param.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'dal' # dal.rb class Source include FileUtils #::Verbose def initialize(opt) @@ -78,7 +78,7 @@ module SiSU_Git fnb=@fnn=@opt.fns[m,1] fnt=@opt.fns[m,2] end - git_path_fnb=@env.path.processing_path_git + '/' + fnb + git_path_fnb=@env.processing_path.git + '/' + fnb #unless @opt.cmd =~/q/ # @opt.cmd=~/[MVvz]/ \ # ? SiSU_Screen::Ansi.new(@opt.cmd,'Git path',@git_path[:fnb]).green_hi_blue \ @@ -87,16 +87,16 @@ module SiSU_Git #end lng=(@md.opt.f_pth[:lng]) ? (@md.opt.f_pth[:lng]) : (@md.i18n[0]) @git_path={ - :fnb=> git_path_fnb, - :src=> git_path_fnb + '/' + Gt[:src] + '/' + lng, - :po=> git_path_fnb + '/' + Gt[:po] + '/' + lng, - :pot=> git_path_fnb + '/' + Gt[:pot], - :conf=> git_path_fnb + '/' + Gt[:conf], - :skin=> git_path_fnb + '/' + Gt[:skin], - :image=>git_path_fnb + '/' + Gt[:image], - :audio=>git_path_fnb + '/' + Gt[:audio], - :video=>git_path_fnb + '/' + Gt[:video], - :conf=> git_path_fnb + '/' + Gt[:conf] + fnb: git_path_fnb, + src: git_path_fnb + '/' + Gt[:src] + '/' + lng, + po: git_path_fnb + '/' + Gt[:po] + '/' + lng, + pot: git_path_fnb + '/' + Gt[:pot], + conf: git_path_fnb + '/' + Gt[:conf], + skin: git_path_fnb + '/' + Gt[:skin], + image: git_path_fnb + '/' + Gt[:image], + audio: git_path_fnb + '/' + Gt[:audio], + video: git_path_fnb + '/' + Gt[:video], + conf: git_path_fnb + '/' + Gt[:conf] } SiSU_DAL::Source.new(@opt).read # -m end @@ -185,9 +185,9 @@ module SiSU_Git and @opt.cmd.inspect !~/m/ ##SiSU_Assemble::Composite.new(@opt).read #SiSU_DAL::Source.new(@opt).read # -m - "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" elsif composite_src - "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" else "#{@env.path.pwd}/#{@opt.fns}" end end @@ -239,7 +239,7 @@ module SiSU_Git if FileTest.file?(skin) cp_r(skin,"#{@git_path[:conf]}/skin") end - {:skin =>skin, :images =>images} + { skin: skin, images: images } end def sisuyaml_rc sisurc=@env.path.sisurc_path diff --git a/lib/sisu/v3/harvest.rb b/lib/sisu/v3/harvest.rb index 82a87ba3..117028e2 100644 --- a/lib/sisu/v3/harvest.rb +++ b/lib/sisu/v3/harvest.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -65,7 +65,7 @@ def help WOK end def css(opt) - require "#{SiSU_lib}/css" # css.rb + require_relative 'css' # css.rb css=SiSU_Style::CSS.new fn_css=SiSU_Env::CSS_default.new style=File.new("#{@env.path.pwd}/#{fn_css.harvest}",'w') @@ -79,17 +79,17 @@ def cases(opt) HARVEST_authors::Songsheet.new(opt).songsheet HARVEST_topics::Songsheet.new(opt).songsheet if opt.cmd.inspect =~/R/ - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(opt).rsync_harvest end else help end end -require "#{SiSU_lib}/options" # options.rb -require "#{SiSU_lib}/harvest_topics" # harvest_topics.rb -require "#{SiSU_lib}/harvest_authors" # harvest_authors.rb -require "#{SiSU_lib}/sysenv" # sysenv.rb +require_relative 'options' # options.rb +require_relative 'harvest_topics' # harvest_topics.rb +require_relative 'harvest_authors' # harvest_authors.rb +require_relative 'sysenv' # sysenv.rb include SiSU_Env @env=SiSU_Env::Info_env.new @@the_idx_topics,@@the_idx_authors={},{} diff --git a/lib/sisu/v3/harvest_authors.rb b/lib/sisu/v3/harvest_authors.rb index 656d11d0..dc36a06f 100644 --- a/lib/sisu/v3/harvest_authors.rb +++ b/lib/sisu/v3/harvest_authors.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,7 +58,7 @@ =end module HARVEST_authors - require "#{SiSU_lib}/author_format" # author_format.rb + require_relative 'author_format' # author_format.rb @@the_idx_authors=[] class Songsheet def initialize(opt) @@ -133,7 +133,7 @@ module HARVEST_authors filename.sub(/\.ss[mt]$/,'') end page="sisu_manifest#{lang}.html" - idx_array <<= { :filename => filename, :file => file, :date => @date, :title => @fulltitle, :author => creator, :page => page } + idx_array <<= { filename: filename, file: file, date: @date, title: @fulltitle, author: creator, page: page } else #p "missing author field: #{@filename} title: #{@title}; author: #{@author_format}" end @@ -155,9 +155,9 @@ module HARVEST_authors idx[:author][:last_first_format_a].each do |author| author.strip! if @@the_idx_authors[author].class==NilClass - @@the_idx_authors[author]={:md => []} + @@the_idx_authors[author]={ md: [] } end - @@the_idx_authors[author][:md] << { :filename => idx[:filename], :file => idx[:file], :author => idx[:author], :title => idx[:title], :date => idx[:date], :page => idx[:page] } + @@the_idx_authors[author][:md] << { filename: idx[:filename], file: idx[:file], author: idx[:author], title: idx[:title], date: idx[:date], page: idx[:page] } end end @the_idx=@@the_idx_authors diff --git a/lib/sisu/v3/harvest_topics.rb b/lib/sisu/v3/harvest_topics.rb index 00471184..f00fb7f3 100644 --- a/lib/sisu/v3/harvest_topics.rb +++ b/lib/sisu/v3/harvest_topics.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,7 +59,7 @@ =end module HARVEST_topics - require "#{SiSU_lib}/author_format" # author_format.rb + require_relative 'author_format' # author_format.rb class Songsheet def initialize(opt) @opt=opt @@ -140,10 +140,10 @@ module HARVEST_topics idxl=[] g.each do |i| i.strip! - idxl << { :filename =>filename,:file =>file,:rough_idx =>i,:title =>@fulltitle,:author =>creator,:page =>page} + idxl << { filename: filename, file: file, rough_idx: i, title: @fulltitle, author: creator, page: page } end idxl - else { :filename =>filename,:file =>file,:rough_idx =>@idx_list,:title =>@fulltitle,:author =>creator,:page =>page} + else { filename: filename, file: file, rough_idx: @idx_list, title: @fulltitle, author: creator, page: page } end else p "missing required field in #{@filename} - [title]: <<#{@title}>>; [author]: <<#{@author_format}>>; [idx]: <<#{@idx_list}>>" if @opt.cmd.inspect =~/[VM]/ @@ -166,7 +166,7 @@ module HARVEST_topics s=n.sub(/(.+?)(?:,.+|$)/,'\1').gsub(/\s+/,'_') names += %{<a href="harvest_authors.html##{s}">#{n}</a>, } end - hash << { :filename =>idx[:filename],:file =>idx[:file],:author =>names,:title =>idx[:title],:page =>idx[:page]} + hash << { filename: idx[:filename], file: idx[:file], author: names, title: idx[:title], page: idx[:page] } end def construct_book_topic_index idx_array=@idx_array @@ -190,7 +190,7 @@ module HARVEST_topics lev0.each do |lv0| lv0=capital(lv0) if @@the_idx_topics[lv0].class==NilClass - @@the_idx_topics[lv0]={:md => []} + @@the_idx_topics[lv0]={ md: [] } end @lv0=lv0 if lev0.length==1 j=@@the_idx_topics[lv0][:md] @@ -201,7 +201,7 @@ module HARVEST_topics lev1.each do |lv1| lv1=capital(lv1) if @@the_idx_topics[@lv0][lv1].class==NilClass - @@the_idx_topics[@lv0][lv1]={:md => []} + @@the_idx_topics[@lv0][lv1]={ md: [] } end @lv1=lv1 if lev1.length==1 j=@@the_idx_topics[@lv0][lv1][:md] @@ -212,7 +212,7 @@ module HARVEST_topics lev2.each do |lv2| lv2=capital(lv2) if @@the_idx_topics[@lv0][@lv1][lv2].class==NilClass - @@the_idx_topics[@lv0][@lv1][lv2]={:md => []} + @@the_idx_topics[@lv0][@lv1][lv2]={ md: [] } end @lv2=lv2 if lev2.length==1 j=@@the_idx_topics[@lv0][@lv1][lv2][:md] @@ -223,7 +223,7 @@ module HARVEST_topics lev3.each do |lv3| lv3=capital(lv3) if @@the_idx_topics[@lv0][@lv1][@lv2][lv3].class==NilClass - @@the_idx_topics[@lv0][@lv1][@lv2][lv3]={:md => []} + @@the_idx_topics[@lv0][@lv1][@lv2][lv3]={ md: [] } end @lv3=lv3 if lev3.length==1 j=@@the_idx_topics[@lv0][@lv1][@lv2][lv3][:md] @@ -234,7 +234,7 @@ module HARVEST_topics lev4.each do |lv4| lv4=capital(lv4) if @@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4].class==NilClass - @@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4]={:md => []} + @@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4]={ md: [] } end @lv4=lv4 if lev4.length==1 j=@@the_idx_topics[@lv0][@lv1][@lv2][@lv3][lv4][:md] diff --git a/lib/sisu/v3/help.rb b/lib/sisu/v3/help.rb index 65bbedef..a0d62644 100644 --- a/lib/sisu/v3/help.rb +++ b/lib/sisu/v3/help.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_Help - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Screen - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb class Help def initialize(request='',color='') @request,@color=request,color @@ -766,16 +766,16 @@ If you have problems check permissions (and if in home directory ownership). #{@cX.green}directory paths as currently set#{@cX.off}: output docs: #{@cX.blue}#{@env.path.webserv}#{@cX.off} cgi scripts: #{@cX.blue}#{@env.path.cgi}#{@cX.off} - processing: #{@cX.blue}#{@env.path.processing}#{@cX.off} - sisu meta markup: #{@cX.blue}#{@env.path.dal}#{@cX.off} - html tuning: #{@cX.blue}#{@env.path.tune}#{@cX.off} - latex: #{@cX.blue}#{@env.path.tex}#{@cX.off} - texinfo: #{@cX.blue}#{@env.path.texi}#{@cX.off} + processing: #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} + sisu meta markup: #{@cX.blue}#{@env.processing_path.dal}#{@cX.off} + html tuning: #{@cX.blue}#{@env.processing_path.tune}#{@cX.off} + latex: #{@cX.blue}#{@env.processing_path.tex}#{@cX.off} + texinfo: #{@cX.blue}#{@env.processing_path.texi}#{@cX.off} images: source: #{@cX.blue}#{@env.path.image_source}#{@cX.off} latex source: #{@cX.blue}#{@env.path.image_source_include}#{@cX.off} note images are also sourced from within your pwd - #{@cX.blue}#{Dir.pwd}/_sisu/image#{@cX.off} if it exists - #{@cX.grey}[ texinfo: #{@env.path.texinfo} - check duplication ]#{@cX.off} + #{@cX.grey}[ texinfo: #{@env.processing_path.texinfo} - check duplication ]#{@cX.off} #{@cX.green}resource configuraton files#{@cX.off} to change the paths specified above, are searched for in the following order: under the current SiSU markup data directory: #{@cX.blue}#{Dir.pwd}/_sisu/sisurc.yml#{@cX.off} @@ -854,11 +854,11 @@ WOK (d) #{@cX.green}processing directories#{@cX.off} sisu creates a number of processing directories, where these should be located can be modified in #{@cX.green}~/.sisu/sisurc.yml#{@cX.off} work directories include the following: - root working directory #{@cX.blue}#{@env.path.processing}#{@cX.off} - metaverse intermediate markup #{@cX.blue}#{@env.path.dal}#{@cX.off} - tune html (for special html/navigation pages) #{@cX.blue}#{@env.path.tune}#{@cX.off} - tex for latex and pdf #{@cX.blue}#{@env.path.tex}#{@cX.off} - texinfo for texinfo and info files #{@cX.blue}#{@env.path.texi}#{@cX.off} + root working directory #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} + metaverse intermediate markup #{@cX.blue}#{@env.processing_path.dal}#{@cX.off} + tune html (for special html/navigation pages) #{@cX.blue}#{@env.processing_path.tune}#{@cX.off} + tex for latex and pdf #{@cX.blue}#{@env.processing_path.tex}#{@cX.off} + texinfo for texinfo and info files #{@cX.blue}#{@env.processing_path.texi}#{@cX.off} These files are usually used only for processing and removed. There is a maintenance flag to keep them. @@ -992,7 +992,7 @@ WOK papersize set (LaTeX/pdf): #{@cX.blue}#{@env.papersize}#{@cX.off} (digest and papersize can be changed in sisurc.yml under default:) #{@cX.green}intermediate processing#{@cX.off} - processing directory: #{@cX.blue}#{@env.path.processing}#{@cX.off} + processing directory: #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} (to keep processing output, use -M flag) #{@cX.green}programs selected for viewing output#{@cX.off} text editor: #{@cX.blue}#{@env.program.text_editor}#{@cX.off} @@ -1314,7 +1314,7 @@ WOK lib (site-ruby): #{@cX.blue}#{Config::CONFIG['rubylibdir']}/#{SiSU_lib}#{@cX.off} or #{@cX.blue}#{Config::CONFIG['sitelibdir']}/#{SiSU_lib}#{@cX.off} conf [etc]: #{@cX.blue}#{@env.path.etc}/sisu#{@cX.off} data (document samples, images, README): #{@cX.blue}#{@env.path.sample_data}#{@cX.off} - processing: #{@cX.blue}#{@env.path.processing}#{@cX.off} + processing: #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} output www: #{@cX.blue}#{@env.path.output}#{@cX.off} Output files, are currently set to be produced in: diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index bad68cde..47988cba 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,19 +58,19 @@ =end module SiSU_HTML require 'pstore' - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/html_table" # html_table.rb - require "#{SiSU_lib}/html_format" # html_format.rb + require_relative 'html_table' # html_table.rb + require_relative 'html_format' # html_format.rb include SiSU_HTML_Format - require "#{SiSU_lib}/html_segments" # html_segments.rb + require_relative 'html_segments' # html_segments.rb include SiSU_HTML_seg - require "#{SiSU_lib}/html_scroll" # html_scroll.rb - require "#{SiSU_lib}/html_promo" # html_promo.rb + require_relative 'html_scroll' # html_scroll.rb + require_relative 'html_promo' # html_promo.rb include SiSU_HTML_promo - require "#{SiSU_lib}/html_tune" # html_tune.rb + require_relative 'html_tune' # html_tune.rb include SiSU_HTML_Tune class Source def initialize(opt) @@ -112,7 +112,7 @@ module SiSU_HTML rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure unless @opt.cmd =~/[MV]/ #check maintenance flag - texfiles=Dir["#{@env.path.tune}/#{@opt.fns}*"] + texfiles=Dir["#{@env.processing_path.tune}/#{@opt.fns}*"] texfiles.each do |f| if FileTest.file?(f) File.unlink(f) @@ -172,7 +172,7 @@ module SiSU_HTML else '_top' end s_lnk_url,s_lnk_lnk=l[:url],l[:say] - txt_obj={:lnk_url =>s_lnk_url,:lnk_txt =>s_lnk_lnk,:target =>target} + txt_obj={ lnk_url: s_lnk_url, lnk_txt: s_lnk_lnk, target: target } lev_dob_ocn=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) @links_guide_toc << lev_dob_ocn.links_guide if s_lnk_lnk end @@ -208,7 +208,7 @@ module SiSU_HTML endnote_array = pg.obj.scan(/#{Mx[:en_b_o]}[\d+]+(.+?)#{Mx[:en_b_c]}/m) end endnote_array.flatten.each do |note| - txt_obj={:txt =>note} + txt_obj={ txt: note } format_scroll=SiSU_HTML_Format::Format_scroll.new(@md,txt_obj) @scr_endnotes << format_scroll.endnote_body end @@ -219,7 +219,7 @@ module SiSU_HTML end end class Toc <Links_guide - @@toc={ :seg=>[],:seg_mini=>[],:scr=>[] } + @@toc={ seg: [], seg_mini: [], scr: [] } @@seg_url='' @@firstseg=nil def initialize(md=nil,data='') @@ -231,7 +231,7 @@ module SiSU_HTML SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey if @md.cmd =~/[MVv]/ toc=nil @@firstseg=nil - @@toc={ :seg=>[],:seg_mini=>[],:scr=>[] } + @@toc={ seg: [], seg_mini: [], scr: [] } @data.each do |dob| if dob.is=='heading' \ or dob.is=='heading_insert' @@ -325,7 +325,7 @@ WOK %{<b><a href="#{@md.fnl[:pre]}#{link}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}">#{linkname}</a></b>} end toc={} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:seg]=if dob.name =~/^meta/ \ and dob.obj =~/Document Information/ @@ -353,7 +353,7 @@ WOK end %{<b><a href="##{link}">#{linkname}</a></b>} end - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=if dob.name =~/^meta/ \ and dob.obj =~/Document Information/ @@ -370,14 +370,14 @@ WOK SiSU_HTML_Format::Paragraph_number.new(@md,ocn) else nil end - txt_obj={:txt =>linkname} + txt_obj={ txt: linkname } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev2 toc[:seg_mini]=format_toc.mini_lev2 if p_num title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev2 end @@ -391,14 +391,14 @@ WOK SiSU_HTML_Format::Paragraph_number.new(@md,ocn) else nil end - txt_obj={:txt =>linkname} + txt_obj={ txt: linkname } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev3 toc[:seg_mini]=format_toc.mini_lev3 if p_num title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev3 end @@ -426,8 +426,8 @@ WOK seg_link.gsub(/sisu_manifest\.html/,"../../manifest/#{@file.base_filename.manifest}") else seg_link end - {:txt =>man_link} - else {:txt =>seg_link} + { txt: man_link } + else { txt: seg_link } end format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc={} @@ -436,8 +436,8 @@ WOK title=%{#{p_num.goto}#{linkname}</a>} if p_num txt_obj=if title=~/sisu_manifest.html/ man_link=title.gsub(/sisu_manifest.html/,"../manifest/#{@file.base_filename.manifest}") - {:txt =>man_link} - else {:txt =>title} + { txt: man_link } + else { txt: title } end format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev4 @@ -454,12 +454,12 @@ WOK lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}##{ocn}"> #{linkname} </a>} - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:seg]=format_toc.lev5 toc[:seg_mini]=format_toc.mini_lev5 title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev5 end @@ -475,12 +475,12 @@ WOK lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}##{ocn}"> #{linkname} </a>} - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:seg]=format_toc.lev6 toc[:seg_mini]=format_toc.mini_lev6 title=%{#{p_num.goto}#{linkname}</a>} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev6 end @@ -542,14 +542,14 @@ WOK tmp_head=nil doc_title_endnote=@md.title.full.gsub(/(\*+)/,'<sup><a href="#endnotes">\1</a></sup>') tmp_head=doc_title_endnote + "\n" - txt_obj={:txt =>tmp_head} + txt_obj={ txt: tmp_head } format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold if defined? @md.creator.author creator_endnote=@md.creator.author.gsub(/(\*+)/,%{ <sup><a href="#notes">\\1</a></sup>}) tmp_head=creator_endnote + "\n" - txt_obj={:txt =>tmp_head} + txt_obj={ txt: tmp_head } format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold diff --git a/lib/sisu/v3/html_format.rb b/lib/sisu/v3/html_format.rb index 76805234..7f13aab3 100644 --- a/lib/sisu/v3/html_format.rb +++ b/lib/sisu/v3/html_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -96,7 +96,7 @@ module SiSU_HTML_Format end end class Head_information - require "#{SiSU_lib}/shared_xml" # shared_xml.rb + require_relative 'shared_xml' # shared_xml.rb include SiSU_Viz attr_reader :md,:rdf,:vz def initialize(md) diff --git a/lib/sisu/v3/html_minitoc.rb b/lib/sisu/v3/html_minitoc.rb index c0731bd2..160881dd 100644 --- a/lib/sisu/v3/html_minitoc.rb +++ b/lib/sisu/v3/html_minitoc.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,7 +58,7 @@ =end module SiSU_HTML_minitoc - require "#{SiSU_lib}/html_tune" # html_tune.rb + require_relative 'html_tune' # html_tune.rb include SiSU_HTML_Tune class Toc_mini @@seg_mini=nil @@ -118,7 +118,7 @@ %{<b><a href="#{@md.fnl[:pre]}#{link}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}">#{txt.obj}</a></b>} end toc={} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc_mini=if txt.name =~/^meta/ and txt.obj=~/Document Information/ format_toc.mini_tail @@ -132,14 +132,14 @@ and txt.ocn !=0 txt.obj.gsub!(@pat_strip_heading_name,'\1') end - txt_obj={:txt =>txt.obj} + txt_obj={ txt: txt.obj } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc_mini=format_toc.mini_lev2 toc_mini end def level_3 txt=@data - txt_obj={:txt =>txt.obj} + txt_obj={ txt: txt.obj } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc_mini=format_toc.mini_lev3 toc_mini @@ -157,7 +157,7 @@ %{<a href="#{@md.fnl[:pre]}\\2#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}" } + %{target="_top">\\1 \\2</a> }) end - txt_obj={:txt =>seg_link} + txt_obj={ txt: seg_link } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc_mini=format_toc.mini_lev4 toc_mini @@ -173,7 +173,7 @@ lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}##{txt.ocn}"> #{txt.obj} </a>} - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc_mini=format_toc.mini_lev5 toc_mini @@ -188,7 +188,7 @@ lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}##{txt.ocn}"> #{txt.obj} </a>} - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc_mini=format_toc.mini_lev6 toc_mini diff --git a/lib/sisu/v3/html_promo.rb b/lib/sisu/v3/html_promo.rb index 20b5de6c..92d184c5 100644 --- a/lib/sisu/v3/html_promo.rb +++ b/lib/sisu/v3/html_promo.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_HTML_promo - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env class Ad def initialize(md) diff --git a/lib/sisu/v3/html_scroll.rb b/lib/sisu/v3/html_scroll.rb index aa33ca9c..a6a1a763 100644 --- a/lib/sisu/v3/html_scroll.rb +++ b/lib/sisu/v3/html_scroll.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,10 +57,10 @@ =end module SiSU_HTML_scroll - require "#{SiSU_lib}/shared_html" # shared_html.rb - require "#{SiSU_lib}/html" # html.rb - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb - require "#{SiSU_lib}/html_promo" # html_promo.rb + require_relative 'shared_html' # shared_html.rb + require_relative 'html' # html.rb + require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'html_promo' # html_promo.rb class Scroll def initialize(md='',data='',endnotes='') @md,@data,@endnotes=md,data,endnotes @@ -79,7 +79,7 @@ module SiSU_HTML_scroll def markup data=@data @rcdc=false - @scr={ :body=>[],:metadata=>[],:owner_details=>[] } + @scr={ body: [], metadata: [], owner_details: [] } data.each do |dob| if defined? dob.name and dob.name =~/^meta/ \ and dob.obj =~/Document Information/ diff --git a/lib/sisu/v3/html_segments.rb b/lib/sisu/v3/html_segments.rb index 03a095ae..5fcb6cf0 100644 --- a/lib/sisu/v3/html_segments.rb +++ b/lib/sisu/v3/html_segments.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,10 +57,10 @@ =end module SiSU_HTML_seg - require "#{SiSU_lib}/shared_html" # shared_html.rb - require "#{SiSU_lib}/html" # html.rb - require "#{SiSU_lib}/html_promo" # html_promo.rb - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb + require_relative 'shared_html' # shared_html.rb + require_relative 'html' # html.rb + require_relative 'html_promo' # html_promo.rb + require_relative 'shared_metadata' # shared_metadata.rb class Seg_output def initialize(md,outputfile,seg,minitoc,type='') @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type @@ -77,7 +77,7 @@ module SiSU_HTML_seg if @title_banner_ @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) end - txt_obj={:txt =>'Endnotes',:ocn_display =>''} + txt_obj={ txt: 'Endnotes', ocn_display: '' } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_endnotes] << @minitoc << @seg[:headings] << %{\n<div class="content">\n} << @seg[:endnote_all] << '</div>' # << '</div>' @@ -87,7 +87,7 @@ module SiSU_HTML_seg if @title_banner_ @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) end - txt_obj={:txt =>'Index',:ocn_display =>''} + txt_obj={ txt: 'Index', ocn_display: '' } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n<div class="content">\n} << @seg[:idx] << '</div>' # << '</div>' @@ -98,7 +98,7 @@ module SiSU_HTML_seg if @title_banner_ @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) end - txt_obj={:txt =>'Metadata',:ocn_display =>''} + txt_obj={ txt: 'Metadata', ocn_display: '' } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n<div class="content">\n} << metadata << '</div>' # << '</div>' @@ -330,7 +330,7 @@ module SiSU_HTML_seg else '' end @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>@@heading1,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: @@heading1, ocn_display: @p_num.ocn_display } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') @@heading1.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -341,7 +341,7 @@ module SiSU_HTML_seg else '' end @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading2,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') @@heading2.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -352,7 +352,7 @@ module SiSU_HTML_seg else '' end @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading3,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') @@heading3.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -363,7 +363,7 @@ module SiSU_HTML_seg else '' end @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading4,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading4, ocn_display: @p_num.ocn_display } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading4.gsub(clean,'') end @@ -495,11 +495,11 @@ module SiSU_HTML_seg and dob.ln.to_s =~/^[56]/ case dob.ln when 5 - txt_obj={:txt =>dob.obj.strip,:ocn =>dob.ocn} + txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) subtoc=format_seg.subtoc_lev5 #keep and make available, this is the subtoc when 6 - txt_obj={:txt =>dob.obj.strip,:ocn =>dob.ocn} + txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) subtoc=format_seg.subtoc_lev6 #keep and make available, this is the subtoc end @@ -525,7 +525,7 @@ module SiSU_HTML_seg e_n=note_match_seg[/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,1] try=e_n.split(/<br \/>/) try.each do |e| - txt_obj={:txt =>e} + txt_obj={ txt: e } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) note_match=if e =~/#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}/ format_seg.endnote_body_indent @@ -538,7 +538,7 @@ module SiSU_HTML_seg m=/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?href=")(#-[\d*+]+".+)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/mi endnote_part_a=note_match_seg[m,1] endnote_part_b=note_match_seg[m,2] - txt_obj={:endnote_part_a =>endnote_part_a,:endnote_part_b =>endnote_part_b} + txt_obj={ endnote_part_a: endnote_part_a, endnote_part_b: endnote_part_b } format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) note_match_all_seg=format_seg.endnote_seg_body(@@fn) #BUG WATCH 200408 @@seg[:endnote_all] << note_match_all_seg diff --git a/lib/sisu/v3/html_table.rb b/lib/sisu/v3/html_table.rb index 515bc77f..04fb602b 100644 --- a/lib/sisu/v3/html_table.rb +++ b/lib/sisu/v3/html_table.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,8 +57,8 @@ =end module SiSU_HTML_table - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/xhtml_table.rb" # xhtml_table.rb + require_relative 'defaults' # defaults.rb + require_relative 'xhtml_table.rb' # xhtml_table.rb class Table_html <SiSU_XHTML_table::Table_xhtml end end diff --git a/lib/sisu/v3/html_tune.rb b/lib/sisu/v3/html_tune.rb index 0ab2e50d..18b4576b 100644 --- a/lib/sisu/v3/html_tune.rb +++ b/lib/sisu/v3/html_tune.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -56,11 +56,11 @@ ** Description: html generation, html pre-processing =end -require "#{SiSU_lib}/param" +require_relative 'param' module SiSU_HTML_Tune - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen - require "#{SiSU_lib}/html_format" # html_format.rb #watch + require_relative 'html_format' # html_format.rb #watch @@line_mode='' @@endnote_array=[] @@endnote_call_counter=1 @@ -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/hub.rb b/lib/sisu/v3/hub.rb index 5e86ea76..7794c08c 100644 --- a/lib/sisu/v3/hub.rb +++ b/lib/sisu/v3/hub.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,8 +58,8 @@ =end module SiSU - require "#{SiSU_lib}/constants" # constants.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'constants' # constants.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Screen @@pwd_the=Dir.pwd class Op @@ -85,7 +85,7 @@ module SiSU Dir.chdir(@pwd) end def select - require "#{SiSU_lib}/#{@req}" + require_relative @req if @req =~/^conf$/ # -C SiSU_Initialize::Source.new(@opt).read end @@ -94,7 +94,7 @@ module SiSU env=SiSU_Env::Info_env.new(fns) if fns =~ /sisupod(?:\.zip)?|\S+?(?:\.ss[mt]\.zip|\.ssp)$/ # env=SiSU_Env::Info_env.new(fns) - require "#{SiSU_lib}/remote" # remote.rb #check + require_relative 'remote' # remote.rb #check pod_name=SiSU_Remote::Remote_download.new(fns).pod.name SiSU_Screen::Ansi.new(@opt.cmd,pod_name).puts_blue unless @opt.cmd =~/q/ @opt.files.shift @@ -111,13 +111,13 @@ module SiSU if @req !~/(?:urls|remote)$/ if @opt.cmd.inspect =~/-P/\ and @req =~ /^po4a$/ - require "#{SiSU_lib}/composite" # composite.rb #pre-processing - SiSU_po4a::Source.new(@opt).read # -P + require_relative 'composite' # composite.rb #pre-processing + SiSU_po4a::Source.new(@opt).read # -P po4a.rb elsif @req=~/^dal$/ \ and FileTest.file?(@opt.fns) \ and @opt.fns =~ /\.(?:(?:-|ssm\.)?sst|ssm)$/ if fns =~ /\.ssm$/ - require "#{SiSU_lib}/composite" # composite.rb #pre-processing + require_relative 'composite' # composite.rb #pre-processing SiSU_Assemble::Composite.new(@opt).read @opt.fns=fns.gsub(/\.ssm$/,'.ssm.sst') end @@ -128,37 +128,37 @@ module SiSU case @req when /^dal$/ if fns =~ /\.ssm$/ - require "#{SiSU_lib}/composite" # composite.rb #pre-processing + require_relative 'composite' # composite.rb #pre-processing SiSU_Assemble::Composite.new(@opt).read @opt.fns=fns.gsub(/\.ssm$/,'.ssm.sst') end - SiSU_DAL::Source.new(@opt).read # -m - when /^git$/; SiSU_Git::Source.new(@opt).read # -g - when /^concordance$/; SiSU_Concordance::Source.new(@opt).read # -w - when /^share_src$/; SiSU_Markup::Source.new(@opt).read # -s - when /^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S - when /^source_kdissert$/; SiSU_Kdi_source::Source.new(@opt).read ## -S - when /^digests$/; SiSU_Digest_view::Source.new(@opt).read # -N - when /^xml_scaffold$/; SiSU_XML_scaffold::Source.new(@opt).read # -k - when /^plaintext$/; SiSU_Plaintext::Source.new(@opt).read # -t -a -# when /^po4a$/; SiSU_po4a::Source.new(@opt).read # -P - #when /^wikispeak$/; SiSU_Wikispeak::Source.new(@opt).read # -g - when /^epub$/; SiSU_EPUB::Source.new(@opt).read # -e - when /^odf$/; SiSU_ODF::Source.new(@opt).read # -o - when /^xml_md_oai_pmh_dc$/; SiSU_XML_metadata::OAI_PMH.new(@opt).read # -O - when /^texpdf$/; SiSU_TeX::Source.new(@opt).read # -p - when /^manpage$/; SiSU_Manpage::Source.new(@opt).read # -i - when /^texinfo$/; SiSU_TexInfo::Source.new(@opt).read # -I - when /^html$/; SiSU_HTML::Source.new(@opt).read # -h -H - when /^xml$/; SiSU_XML_SAX::Source.new(@opt).read # -x - when /^xml_dom$/; SiSU_XML_DOM::Source.new(@opt).read # -X - when /^xml_fictionbook$/; SiSU_XML_Fictionbook::Source.new(@opt).read # -f - when /^xhtml$/; SiSU_XHTML::Source.new(@opt).read # -b - when /^embedded$/; SiSU_Embedded::Source.new(@opt).read # -m (image and other content) - when /^manifest$/; SiSU_Manifest::Source.new(@opt).read # -y - when /^sitemaps$/; SiSU_Sitemaps::Source.new(@opt).read # -Y - when /^zap$/; SiSU_Zap::Source.new(@opt).read # -Z - when /^dbi$/; SiSU_DBI::SiSU_SQL.new(@opt).connect # -D -d + SiSU_DAL::Source.new(@opt).read # -m dal.rb + when /^git$/; SiSU_Git::Source.new(@opt).read # -g git.rb + when /^concordance$/; SiSU_Concordance::Source.new(@opt).read # -w concordance.rb + when /^share_src$/; SiSU_Markup::Source.new(@opt).read # -s share_src.rb + when /^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S sisupod_make.rb +# when /^source_kdissert$/; SiSU_Kdi_source::Source.new(@opt).read # -S share_src_kdissert.rb + when /^digests$/; SiSU_Digest_view::Source.new(@opt).read # -N digests.rb + when /^plaintext$/; SiSU_Plaintext::Source.new(@opt).read # -t -a plaintext.rb +# when /^po4a$/; SiSU_po4a::Source.new(@opt).read # -P po4a.rb + #when /^wikispeak$/; SiSU_Wikispeak::Source.new(@opt).read # -g + when /^epub$/; SiSU_EPUB::Source.new(@opt).read # -e epub.rb + when /^odf$/; SiSU_ODF::Source.new(@opt).read # -o odf.rb + when /^xml_md_oai_pmh_dc$/; SiSU_XML_metadata::OAI_PMH.new(@opt).read # -O + when /^texpdf$/; SiSU_TeX::Source.new(@opt).read # -p texpdf.rb + when /^manpage$/; SiSU_Manpage::Source.new(@opt).read # -i manpage.rb + when /^texinfo$/; SiSU_TexInfo::Source.new(@opt).read # -I texinfo.rb + when /^html$/; SiSU_HTML::Source.new(@opt).read # -h -H html.rb + when /^xhtml$/; SiSU_XHTML::Source.new(@opt).read # -b xhtml.rb + when /^xml$/; SiSU_XML_SAX::Source.new(@opt).read # -x xml.rb + when /^xml_dom$/; SiSU_XML_DOM::Source.new(@opt).read # -X xml_dom.rb + when /^xml_fictionbook$/; SiSU_XML_Fictionbook::Source.new(@opt).read # -f + when /^xml_scaffold$/; SiSU_XML_scaffold::Source.new(@opt).read # -k xml_scaffold.rb + when /^embedded$/; SiSU_Embedded::Source.new(@opt).read # -m embedded.rb (image and other content) #check + when /^manifest$/; SiSU_Manifest::Source.new(@opt).read # -y manifest.rb + when /^sitemaps$/; SiSU_Sitemaps::Source.new(@opt).read # -Y sitemaps.rb + when /^zap$/; SiSU_Zap::Source.new(@opt).read # -Z zap.rb + when /^dbi$/; SiSU_DBI::SiSU_SQL.new(@opt).connect # -D -d dbi.rb end @n_do=@n_do+1 SiSU_Screen::Ansi.new(@opt.cmd,@n_do,"#{@req.upcase} processed").files_processed if @opt.cmd =~/[MVv]/ @@ -206,30 +206,30 @@ module SiSU end def remote_put_base_site_rsync # -CR p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base end def remote_put_base_site_rsync_match # -CCRZ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base_sync end def remote_put_base_site # -Cr p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base end def remote_put_base_site_all # -CCr p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base_all end def cgi # -F - require "#{SiSU_lib}/cgi" # cgi.rb + require_relative 'cgi' # cgi.rb SiSU_CGI::SiSU_search.new(@opt).read end def encoding # -K build character encoding db (uses KirbyBase) - require "#{SiSU_lib}/character_encoding" # character_encoding.rb + require_relative 'character_encoding' # character_encoding.rb SiSU_character_encode::Create.new.db end def termsheet # -t @@ -288,10 +288,10 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ require 'profile' end if @opt.mod.inspect =~/--harvest/ - require "#{SiSU_lib}/harvest" # harvest.rb + require_relative 'harvest' # harvest.rb end if @opt.mod.inspect =~/--convert|--to|--from/ - require "#{SiSU_lib}/sst_convert_markup" # sst_convert_markup.rb + require_relative 'sst_convert_markup' # sst_convert_markup.rb end if @opt.cmd =~/([AabCcDdeFfGgHhIiJjkLMmNnOoPpQqRrSsTtUuVvwWXxYyZ_0-9])/ \ and @opt.cmd =~/^-/ \ @@ -401,12 +401,12 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end end if @get_s.length > 0 #% remote markup file .sst - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Get.new(@opt,@get_s).fns Operations.new.counter end if @get_p.length > 0 #% remote sisupod - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Get.new(@opt,@get_p).sisupod end rescue @@ -504,18 +504,18 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ op('urls','urls') @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil unless @opt.cmd =~/q/ @tell.call.print_brown if @opt.cmd =~/[uUvVM]/ unless @opt.files.join.empty? - if defined? @@env.path.processing \ + if defined? @@env.processing_path.processing \ and @@env.user \ - and FileTest.directory?(@@env.path.processing) \ - and @@env.path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area - cd(@@env.path.processing_base_tmp) do + and FileTest.directory?(@@env.processing_path.processing) \ + and @@env.processing_path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area + cd(@@env.processing_path.processing_base_tmp) do rm_rf(@@env.user) unless @opt.cmd =~/M/ end end elsif @opt.mod.inspect =~/--query/ - require "#{SiSU_lib}/sst_identify_markup" # sst_identify_markup.rb + require_relative 'sst_identify_markup' # sst_identify_markup.rb puts SiSU_Markup::Markup_history.new(@opt).query elsif @opt.mod.inspect =~/--identify/ - require "#{SiSU_lib}/sst_identify_markup" # sst_identify_markup.rb + require_relative 'sst_identify_markup' # sst_identify_markup.rb markup_version=SiSU_Markup::Markup_identify.new(@opt).markup_version? elsif @opt.mod.inspect =~/--about/ #% help instructions if @opt.mod.inspect =~/--about/ \ @@ -524,10 +524,10 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ else SiSU_Help::Help.new('list','color_off').help_request end elsif @opt.mod.inspect =~/--sitemaps/ #% sitemaps - require "#{SiSU_lib}/sitemaps" # sitemaps.rb + require_relative 'sitemaps' # sitemaps.rb SiSU_Sitemaps::Source.new(@opt).read if @opt.cmd =~/R/ - require "#{SiSU_lib}/remote" # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_sitemaps end else #% help instructions @@ -571,15 +571,15 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ require 'jcode' $KCODE='UTF8' end - require "#{SiSU_lib}/constants" # constants.rb - require "#{SiSU_lib}/options" # options.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'constants' # constants.rb + require_relative 'options' # options.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/help" # help.rb + require_relative 'help' # help.rb include SiSU_Help require 'uri' home=ENV['HOME'] diff --git a/lib/sisu/v3/i18n.rb b/lib/sisu/v3/i18n.rb index 1c5efe0a..9fbe8c3e 100644 --- a/lib/sisu/v3/i18n.rb +++ b/lib/sisu/v3/i18n.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -141,7 +141,7 @@ module SiSU_i18n end end module SiSU_Translate - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Param class Source def initialize(md,doc_lang,trans_str='') diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb index 58b78c76..c496c8a6 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,15 +57,15 @@ =end module SiSU_Manifest - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/i18n" # i18n.rb - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'i18n' # i18n.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/html_minitoc" # html_minitoc.rb - require "#{SiSU_lib}/html" # html.rb + require_relative 'html_minitoc' # html_minitoc.rb + require_relative 'html' # html.rb include SiSU_HTML_Format - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz class Source @@ -99,7 +99,7 @@ module SiSU_Manifest private class Output_Info <Source def initialize(md) - @manifest={ :txt=>[],:html=>[] } + @manifest={ txt: [], html: [] } @md,@fns=md,md.fns # @file=SiSU_Env::SiSU_file.new(@md) @env=SiSU_Env::Info_env.new(@md.fns) diff --git a/lib/sisu/v3/manpage.rb b/lib/sisu/v3/manpage.rb index 1227399f..3810a969 100644 --- a/lib/sisu/v3/manpage.rb +++ b/lib/sisu/v3/manpage.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,15 +58,15 @@ =end module SiSU_Manpage - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'dal' # dal.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Param include SiSU_Viz - require "#{SiSU_lib}/manpage_format" # manpage_format.rb + require_relative 'manpage_format' # manpage_format.rb include SiSU_Manpage_format - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'shared_txt' # shared_txt.rb pwd=Dir.pwd @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' @@ -97,10 +97,10 @@ module SiSU_Manpage end private class Scroll <Source - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'defaults' # defaults.rb + require_relative 'shared_txt' # shared_txt.rb include SiSU_text_utils - @@endnotes={ :para=>[],:end=>[] } + @@endnotes={ para: [], end: [] } def initialize(md,data) @md,@data=md,data @brace_url=SiSU_Viz::Skin.new.url_decoration @@ -108,7 +108,7 @@ module SiSU_Manpage @tab="\t" @br="\n" @@dostype='unix endnotes' - @manpage={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] } + @manpage={ body: [], open: [], close: [], head: [], metadata: [], tail: [], endnotes: [] } end def songsheet manpage=markup(@data) @@ -398,7 +398,7 @@ WOK content << manpage[:metadata] content << manpage[:tail] Output.new(@md,content).manpage - @@endnotes={ :para=>[],:end=>[] } + @@endnotes={ para: [], end: [] } end end class Output <Source diff --git a/lib/sisu/v3/manpage_format.rb b/lib/sisu/v3/manpage_format.rb index 4d58712f..3751258a 100644 --- a/lib/sisu/v3/manpage_format.rb +++ b/lib/sisu/v3/manpage_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Manpage_format - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz class Paragraph_number diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index ce696fdd..204f0e50 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,22 +57,22 @@ =end module SiSU_ODF - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'dal' # dal.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Viz - require "#{SiSU_lib}/odf_format" # odf_format.rb + require_relative 'odf_format' # odf_format.rb include SiSU_ODF_format - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'shared_txt' # shared_txt.rb @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 class Source require 'zlib' require 'find' require 'fileutils' - include FileUtils + include FileUtils def initialize(opt) @opt=opt @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) @@ -101,10 +101,10 @@ module SiSU_ODF end private class Scroll <Source - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'defaults' # defaults.rb + require_relative 'shared_txt' # shared_txt.rb @@img_count=0 - @@odf={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] } + @@odf={ body: [], open: [], close: [], head: [], metadata: [], tail: [], endnotes: [] } @@docstart=true @@fns=nil def initialize(particulars) @@ -207,7 +207,7 @@ module SiSU_ODF w=/([0-9]+\.\d{0,3})/.match(w).captures.join image_source=image_src(i) pwd=Dir.pwd - cp("#{image_source}/#{i}","#{@env.path.processing_odf}/Pictures/#{i}") if image_source + cp("#{image_source}/#{i}","#{@env.processing_path.odf}/Pictures/#{i}") if image_source img=if i.to_s =~/jpg|png|gif/ \ and h.to_s =~/\d/ \ and w.to_s =~/\d/ @@ -506,7 +506,7 @@ module SiSU_ODF odf_tail #($1,$2) fix=[] bullet=image_src('bullet_09.png') - cp("#{bullet}/bullet_09.png","#{@env.path.processing_odf}/Pictures/.") #if image_src('bullet_09.png') + cp("#{bullet}/bullet_09.png","#{@env.processing_path.odf}/Pictures/.") #if image_src('bullet_09.png') odf_metadata data.each do |dob| #p dob.obj if dob.obj =~safe_characters and @md.cmd =~/V/ #KEEP @@ -686,9 +686,9 @@ module SiSU_ODF def odf #%odf output env=SiSU_Env::SiSU_file.new(@md) env.mkdir - env.make_path(@env.path.processing_odf) + env.make_path(@env.processing_path.odf) env.make_path(@md.file.output_path.odt) - filename="#{@env.path.processing_odf}/content.xml" + filename="#{@env.processing_path.odf}/content.xml" od=File.new(filename,'w+') @content.each do |para| # this is a hack od.puts para unless para =~/\A\s*\Z/ @@ -697,7 +697,7 @@ module SiSU_ODF opendoc=@md.fn[:odf] mkdir_p(@md.file.output_path.odt) unless FileTest.directory?(@md.file.output_path.odt) system(" - cd #{@env.path.processing_odf} + cd #{@env.processing_path.odf} zip -qr #{opendoc} * mv #{opendoc} #{@md.file.place_file.odt} cd #{Dir.pwd} @@ -730,9 +730,9 @@ page break notes?? [you could add a note number for every object/paragraph!] - cd(@env.path.processing_odf) + cd(@env.processing_path.odf) structure=[] - Find.find(@env.path.processing_odf) do |f| + Find.find(@env.processing_path.odf) do |f| structure << puts f end open(opendoc,'wb') do |f| diff --git a/lib/sisu/v3/odf_format.rb b/lib/sisu/v3/odf_format.rb index bd169a34..8736d7d1 100644 --- a/lib/sisu/v3/odf_format.rb +++ b/lib/sisu/v3/odf_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_ODF_format - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz class Paragraph_number diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb index 7aee2e7d..a79b08f3 100644 --- a/lib/sisu/v3/options.rb +++ b/lib/sisu/v3/options.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,7 +59,7 @@ =end module SiSU_commandline require "pathname" - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb class Options attr_accessor :cmd,:mod,:f_pths,:files,:paths,:f_pth,:pth,:fns,:fnb,:fnc,:fncb,:what def initialize(a) @@ -158,10 +158,10 @@ module SiSU_commandline u=/.+?\/([^\/]+)(?:(?:\/(?:en|fr|es)$)|$)/ t=/.+\/(en|fr|es)/ f_pths << { - :pth => pt.split[0].realpath.to_s, - :f => pt.split[1].to_s, - :pth_stub => pt.split[0].realpath.to_s[u,1], - :lng => (pt.split[0].realpath.to_s[t,1]) \ + pth: pt.split[0].realpath.to_s, + f: pt.split[1].to_s, + pth_stub: pt.split[0].realpath.to_s[u,1], + lng: (pt.split[0].realpath.to_s[t,1]) \ ? pt.split[0].realpath.to_s[t,1] \ : nil } diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index be870235..9dfbc70f 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,15 +59,15 @@ module SiSU_Param require 'uri' require 'pstore' - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/param_identify_markup" # param_identify_markup.rb - require "#{SiSU_lib}/help" # help.rb + require_relative 'param_identify_markup' # param_identify_markup.rb + require_relative 'help' # help.rb include SiSU_Help @@date=SiSU_Env::Info_date.new @@symlnk=Create_system_link.new @@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=nil - @doc={ :initialise=>nil,:markup=>'',:lnks=>'',:stmp=>'',:req=>{} } + @doc={ initialise: nil, markup: '', lnks: '', stmp: '', req: {} } @@yaml=@@yamladdr=nil @@trigger=nil @@lv,@@flag={},{} @@ -84,7 +84,7 @@ module SiSU_Param end Instantiate.new.param_instantiate @env=SiSU_Env::Info_env.new(@fns) - @pstorefile="#{@env.path.dal}/#{@fns}.pstore" + @pstorefile="#{@env.processing_path.dal}/#{@fns}.pstore" end def get if @opt.f_pth[:pth] != Dir.pwd #BUG check @@ -184,13 +184,13 @@ module SiSU_Param authors.each_with_index do |a,i| b=((a =~/\s*\|\s*/) ? (a.split(/\|/)) : [a]) if b[0] =~/"(.+?)"/ - @name_a_h << { :the => $1 } + @name_a_h << { the: $1 } else x=b[0].scan(/[^,]+/) if x.length==1 - @name_a_h << { :the => x[0].strip } + @name_a_h << { the: x[0].strip } elsif x.length==2 - @name_a_h << { :the => x[0].strip, :others => x[1].strip } + @name_a_h << { the: x[0].strip, others: x[1].strip } else #p x.length end end @@ -214,7 +214,7 @@ module SiSU_Param "#{a[:the].strip}" + z end end - {:name_a_h =>@name_a_h,:name_str =>name_str} + { name_a_h: @name_a_h, name_str: name_str } else nil end end @@ -664,7 +664,7 @@ module SiSU_Param page_new=x[/(:?[\dA-C],?)+/] if x=~/new|clear/ page_break=x[/(:?[\dA-C],?)+/] if x =~/break/ end - {:page_new =>page_new, :page_break =>page_break} + { page_new: page_new, page_break: page_break } end def language l=if @h['language'] && (@h['language']=~/\S{2,}/) @@ -682,7 +682,7 @@ module SiSU_Param m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided rgx='\b(' + m + ')\b' y=((x =~/i/) ? (/#{rgx}/i) : (/#{rgx}/)) - { :str =>'\b(?:' + m + ')\b', :regx => y } + { str: '\b(?:' + m + ')\b', regx: y } else nil end z @@ -695,7 +695,7 @@ module SiSU_Param m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided rgx='\b(' + m + ')\b' y=((x =~/i/) ? (/#{rgx}/i) : (/#{rgx}/)) - { :str =>'\b(?:' + m + ')\b', :regx => y } + { str: '\b(?:' + m + ')\b', regx: y } else nil end z @@ -827,7 +827,7 @@ module SiSU_Param end end class Instructions - @doc={ :lv=>[] } + @doc={ lv: [] } @doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','','' @@publisher='SiSU scribe' attr_accessor :cmd,:make,:mod,:env,:path,:file,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_publisher,:contributor,:date,:date_created,:date_issued,:date_available,:date_valid,:date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:type,:format,:identifier,:source,:language,:language_original,:relation,:coverage,:rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:num_top,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:markup_version,:markup_declared,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,:links,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:en,:notes,:dgst,:dgst_skin,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy @@ -865,7 +865,7 @@ module SiSU_Param def extract @user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'] @programs,@wc,@language,@language_original={},{},{},{} - @en={ :sum=>0,:mark=>0,:note=>0,:mismatch=>0 } + @en={ sum: 0, mark: 0, note: 0, mismatch: 0 } @prog=SiSU_Env::Info_settings.new @sys=SiSU_Env::System_call.new @env=SiSU_Env::Info_env.new(@fns) #watch @@ -905,8 +905,8 @@ module SiSU_Param and not @opt.cmd =~/P/ #watch @env_out_root=@env.path.output @dir_out="#{@env.path.output}/#{@fnb}" - @dir_tex=@env.path.processing_tex - @dir_lout=@env.path.lout + @dir_tex=@env.processing_path.tex + @dir_lout=@env.processing_path.lout @@publisher='SiSU http://www.jus.uio.no/sisu' end @txt_path=@txt_path ||= @env.path.output @@ -923,7 +923,7 @@ module SiSU_Param skip unless fns_array # consider @markup_version=SiSU_Markup_type::Markup_identify.new(fns_array,@opt).markup_version? #% determine markup version if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?[\d.]*|sisu-[\d.]+)$/ #check markup and markup version - if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)(?:[0-9]+)?(?:\.[0-9]+)?(?:\.[0-9]+)?$/ #check markup and markup version + if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)(?:(?:[0-9]+?)(?:\.[0-9]+?)(?:\.[0-9]+))?$/ #check markup and markup version @markup_version_declared=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([\d.]+)$/)[1] sm_a,sm_b,sm_c=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3] sm_c ||=0 @@ -1253,7 +1253,7 @@ module SiSU_Param @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) @flv.each do |l| lang=SiSU_Env::Standardise_language.new.file_to_language(l) - c={ :a=>'',:b=>'',:c=>'' } + 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]}" @@ -1369,7 +1369,7 @@ module SiSU_Param class Store def initialize(md,env) @md=md - @pstorefile="#{env.path.dal}/#{md.fns}.pstore" + @pstorefile="#{env.processing_path.dal}/#{md.fns}.pstore" end def store File.unlink(@pstorefile) if FileTest.file?(@pstorefile) @@ -1390,9 +1390,9 @@ module SiSU_Param @@symlnk=SiSU_Env::Create_system_link.new @@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=nil @doc={ - :initialise=>nil, - :markup=>'',:lnks=>'',:stmp=>'',:prefix_a=>'',:prefix_b=>'', - :req=>{} + initialise: nil, + markup: '', lnks: '', stmp: '', prefix_a: '', prefix_b: '', + req: {} } @@yaml=@@yamladdr=nil @@flag={} diff --git a/lib/sisu/v3/param_identify_markup.rb b/lib/sisu/v3/param_identify_markup.rb index 85c93a35..3dcda84c 100644 --- a/lib/sisu/v3/param_identify_markup.rb +++ b/lib/sisu/v3/param_identify_markup.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/particulars.rb b/lib/sisu/v3/particulars.rb index 39219534..1c03d304 100644 --- a/lib/sisu/v3/particulars.rb +++ b/lib/sisu/v3/particulars.rb @@ -1,4 +1,4 @@ -# coding:utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,11 +59,11 @@ =end module SiSU_Particulars require 'singleton' - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/dal" # dal.rb + require_relative 'dal' # dal.rb class Combined_singleton include Singleton def get_all(opt) diff --git a/lib/sisu/v3/plaintext.rb b/lib/sisu/v3/plaintext.rb index 8b910642..8ff64b30 100644 --- a/lib/sisu/v3/plaintext.rb +++ b/lib/sisu/v3/plaintext.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,13 +58,13 @@ =end module SiSU_Plaintext - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'dal' # dal.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/plaintext_format" # plaintext_format.rb + require_relative 'plaintext_format' # plaintext_format.rb include SiSU_Plaintext_format - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'shared_txt' # shared_txt.rb include SiSU_Param include SiSU_Viz pwd=Dir.pwd @@ -109,10 +109,10 @@ module SiSU_Plaintext end private class Scroll <Source - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'defaults' # defaults.rb + require_relative 'shared_txt' # shared_txt.rb include SiSU_text_utils - @@endnotes={ :para=>[],:end=>[] } + @@endnotes={ para: [], end: [] } def initialize(data,md,wrap_width) @data,@md,@wrap_width=data,md,wrap_width @env=SiSU_Env::Info_env.new(@md.fns) @@ -128,7 +128,7 @@ module SiSU_Plaintext when /--unix/; "\n" else "\n" end - @plaintext={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[] } + @plaintext={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end def songsheet plaintext=markup(@data) @@ -385,7 +385,7 @@ WOK content << "#{@br}#{divider*@wrap_width}#{@br}" if @md.stmp =~/\w+/ #not used? content << plaintext[:tail] Output.new(content,@md).plaintext - @@endnotes={ :para=>[],:end=>[] } + @@endnotes={ para: [], end: [] } end end class Output <Source diff --git a/lib/sisu/v3/plaintext_format.rb b/lib/sisu/v3/plaintext_format.rb index 74059157..61e43db1 100644 --- a/lib/sisu/v3/plaintext_format.rb +++ b/lib/sisu/v3/plaintext_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Plaintext_format - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz class Paragraph_number diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb index ea5a5eeb..ba892634 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,11 +58,11 @@ =end module SiSU_po4a - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'dal' # dal.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb - require "#{SiSU_lib}/po4a_set" # po4a_set.rb + require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'po4a_set' # po4a_set.rb include SiSU_Param include SiSU_Viz pwd=Dir.pwd @@ -160,10 +160,10 @@ module SiSU_po4a end private class Scroll <Source - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/po4a_set" # po4a_set.rb + require_relative 'defaults' # defaults.rb + require_relative 'po4a_set' # po4a_set.rb include SiSU_po4a_utils - @@endnotes={ :para=>[],:end=>[] } + @@endnotes={ para: [], end: [] } def initialize(fn,data_src,data_trn,md_src,md_trn,wrap_width) @fn,@data_src,@data_trn,@md_src,@md_trn,@wrap_width=fn,data_src,data_trn,md_src,md_trn,wrap_width @md=(md_trn.nil?) \ @@ -174,7 +174,7 @@ module SiSU_po4a @tab="\t" @@endnotes_=(@md.mod.inspect =~/--endnote/) ? true : false # --footnote @br=(@md.mod.inspect =~/--dos/) ? "\r\n" : "\n" # --unix - @pot={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[] } + @pot={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end def songsheet ############## BUG @fn changes value @@ -905,7 +905,7 @@ GSUB content << pot[:body] content << @@endnotes[:end] if @@endnotes_ Output.new(fn,content,@md).po4a - @@endnotes={ :para=>[],:end=>[] } + @@endnotes={ para: [], end: [] } end end class Output <Source @@ -944,7 +944,7 @@ GSUB end def po4a_git unless @md.cmd =~/M/ - require "#{SiSU_lib}/git" # git.rb + require_relative 'git' # git.rb git=SiSU_Git::Source.new(@md.opt) git.create_file_structure_git unless FileTest.directory?(@file.output_path.pot_git) if @md.opt.f_pth[:lng] =='en' diff --git a/lib/sisu/v3/po4a_set.rb b/lib/sisu/v3/po4a_set.rb index 289ea95e..88369e81 100644 --- a/lib/sisu/v3/po4a_set.rb +++ b/lib/sisu/v3/po4a_set.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/relaxng.rb b/lib/sisu/v3/relaxng.rb index b3921d00..b26fd6f5 100644 --- a/lib/sisu/v3/relaxng.rb +++ b/lib/sisu/v3/relaxng.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_relaxng - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb class RelaxNG def gpl3_or_later @gpl3_or_later =<<RELAXNG diff --git a/lib/sisu/v3/remote.rb b/lib/sisu/v3/remote.rb index 37dcd471..d3e4d653 100644 --- a/lib/sisu/v3/remote.rb +++ b/lib/sisu/v3/remote.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Remote - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env pwd=Dir.pwd class Put @@ -111,7 +111,7 @@ module SiSU_Remote def fns require 'open-uri' require 'pp' - require "#{SiSU_lib}/composite" # composite.rb + require_relative 'composite' # composite.rb @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ @rgx_skin=/@skin:\s+(\S+)/ threads=[] diff --git a/lib/sisu/v3/response.rb b/lib/sisu/v3/response.rb index 0b2bc107..e398d22d 100644 --- a/lib/sisu/v3/response.rb +++ b/lib/sisu/v3/response.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/rexml.rb b/lib/sisu/v3/rexml.rb index ba7ea5d1..d3053ee9 100644 --- a/lib/sisu/v3/rexml.rb +++ b/lib/sisu/v3/rexml.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,9 +59,9 @@ module SiSU_Rexml # load XML file for REXML parsing require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir'] - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Viz class Rexml diff --git a/lib/sisu/v3/screen_text_color.rb b/lib/sisu/v3/screen_text_color.rb index e583551b..d4855ccd 100644 --- a/lib/sisu/v3/screen_text_color.rb +++ b/lib/sisu/v3/screen_text_color.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/share_src.rb b/lib/sisu/v3/share_src.rb index 421ccf9f..5a31f368 100644 --- a/lib/sisu/v3/share_src.rb +++ b/lib/sisu/v3/share_src.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Markup - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env pwd=Dir.pwd class Source @@ -82,7 +82,7 @@ module SiSU_Markup unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@file.output_path.src) else req=@opt.fns.gsub(/(.+?\.ssm)$/,'\1.sst') - file="#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + file="#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" if FileTest.file?(file); cp(file,"#{@file.output_path.src}/#{req}") else print "did not find #{file} to copy" end diff --git a/lib/sisu/v3/share_src_kdissert.rb b/lib/sisu/v3/share_src_kdissert.rb index 1fbdc6f5..755bd1b0 100644 --- a/lib/sisu/v3/share_src_kdissert.rb +++ b/lib/sisu/v3/share_src_kdissert.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Kdi_source - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env pwd=Dir.pwd class Source diff --git a/lib/sisu/v3/shared_html.rb b/lib/sisu/v3/shared_html.rb index 2f8deaea..4d8816c8 100644 --- a/lib/sisu/v3/shared_html.rb +++ b/lib/sisu/v3/shared_html.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,8 +57,8 @@ =end module SiSU_HTML_shared - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/html_table" # html_table.rb + require_relative 'defaults' # defaults.rb + require_relative 'html_table' # html_table.rb class Table_html < SiSU_HTML_table::Table_html end end diff --git a/lib/sisu/v3/shared_html_lite.rb b/lib/sisu/v3/shared_html_lite.rb index 2ac4b01a..fca0cfb8 100644 --- a/lib/sisu/v3/shared_html_lite.rb +++ b/lib/sisu/v3/shared_html_lite.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,11 +58,11 @@ =end module SiSU_Format_Shared - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz class CSS_Format - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'defaults' # defaults.rb + require_relative 'particulars' # particulars.rb @@fns=nil def initialize(md,t_o) @md,@t_o=md,t_o @@ -204,36 +204,36 @@ GSUB %{<p class="toc#{@lv}" header="#{@hname}"><a href="##{@ocn}">#{@txt}</a></p>\n} #<< "\n" end def lev_toc - h={:txt =>txt,:class =>"toc#{@lv}",:type =>'toc'} + h={ txt: txt, class: "toc#{@lv}", type: 'toc' } tag_para(h) end def lev4_plus txt=markup_object(@t_o) - h={:txt =>txt,:class =>"h#{@lv}",:type =>'substantive',:id =>@ocn,:header =>@hname} + h={ txt: txt, class: "h#{@lv}", type: 'substantive', id: @ocn, header: @hname } tag_header(h) end def lev4_minus txt=markup_object(@t_o) - h={:txt =>txt,:class =>"h#{@t_o.ln}",:type =>'substantive',:id =>@ocn} + h={ txt: txt, class: "h#{@t_o.ln}", type: 'substantive', id: @ocn } tag_para(h) end def norm_comment - h={:txt =>@t_o.obj,:class =>'norm',:type =>'comment'} + h={ txt: @t_o.obj, class: 'norm', type: 'comment' } tag_para(h) end def norm txt=markup_object(@t_o) - h={:txt =>txt,:class =>'norm',:type =>'substantive',:id =>@ocn} + h={ txt: txt, class: 'norm', type: 'substantive', id: @ocn } tag_para(h) end def code txt=markup_object(@t_o) - h={:txt =>"<tt>#{txt}</tt>",:class =>'code',:type =>'substantive',:id =>@ocn} + h={ txt: "<tt>#{txt}</tt>", class: 'code', type: 'substantive', id: @ocn } tag_para(h) end def indent(t) txt=markup_object(@t_o) - h={:txt =>txt,:class =>"indent#{t}",:type =>'substantive',:id =>@ocn} + h={ txt: txt, class: "indent#{t}", type: 'substantive', id: @ocn } tag_para(h) end def para_table diff --git a/lib/sisu/v3/shared_markup_alt.rb b/lib/sisu/v3/shared_markup_alt.rb index 8eebea29..738ec75a 100644 --- a/lib/sisu/v3/shared_markup_alt.rb +++ b/lib/sisu/v3/shared_markup_alt.rb @@ -1,10 +1,9 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU * Description: a framework for document structuring, publishing and search - #___# * Author: Ralph Amissah @@ -227,7 +226,7 @@ module SiSU_text_representation def dgst en_dgst,img_dgst={},{} txt_dgst=digest(txt) - {:txt=>txt,:dgst_txt=>txt_dgst} + { txt: txt, dgst_txt: txt_dgst } end self end @@ -237,7 +236,7 @@ module SiSU_text_representation end def dgst txt_dgst=digest(txt) - {:txt=>txt,:dgst_txt=>txt_dgst} + { txt: txt, dgst_txt: txt_dgst } end self end @@ -275,7 +274,7 @@ module SiSU_text_representation image_name = i + ' [image missing]' image_dgst = '' end - line_image << {:img_dgst=>image_dgst[1],:img_name=>image_name,:img_type=>img_type} + line_image << { img_dgst: image_dgst[1], img_name: image_name, img_type: img_type } end end line_image @@ -287,7 +286,7 @@ module SiSU_text_representation note_no=e.gsub(/^([\d*+]+)\s+.+/,'\1') e=digest(stripped_clean(e)) note_dgst=digest(e) - en_dgst << {:note_number=>note_no,:note_dgst=>note_dgst} + en_dgst << { note_number: note_no, note_dgst: note_dgst } end end en_dgst @@ -307,7 +306,7 @@ module SiSU_text_representation imgs=@t_o.obj.scan(rgx_image).flatten line_image=images(imgs) end - dgst={:is=>@t_o.is,:ocn=>@t_o.ocn,:dgst_stripped_txt=>txt_stripped_dgst,:dgst_markedup_txt=>txt_markup_reverted_dgst} + dgst={ is: @t_o.is, ocn: @t_o.ocn, dgst_stripped_txt: txt_stripped_dgst, dgst_markedup_txt: txt_markup_reverted_dgst } dgst[:endnotes]=endnotes_dgst if endnotes_dgst and endnotes_dgst.length > 0 dgst[:images]=line_image if line_image and line_image.length > 0 end diff --git a/lib/sisu/v3/shared_metadata.rb b/lib/sisu/v3/shared_metadata.rb index 1a3bd0a9..167af5c4 100644 --- a/lib/sisu/v3/shared_metadata.rb +++ b/lib/sisu/v3/shared_metadata.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -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/shared_sem.rb b/lib/sisu/v3/shared_sem.rb index cb3ef2b4..ca14a9e4 100644 --- a/lib/sisu/v3/shared_sem.rb +++ b/lib/sisu/v3/shared_sem.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,7 +58,7 @@ =end module SiSU_sem - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb class Tags def initialize(para,md) @para,@md=para,md diff --git a/lib/sisu/v3/shared_txt.rb b/lib/sisu/v3/shared_txt.rb index 998736a1..6f25a06b 100644 --- a/lib/sisu/v3/shared_txt.rb +++ b/lib/sisu/v3/shared_txt.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/shared_xhtml.rb b/lib/sisu/v3/shared_xhtml.rb index 0b167424..f357e9af 100644 --- a/lib/sisu/v3/shared_xhtml.rb +++ b/lib/sisu/v3/shared_xhtml.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,8 +57,8 @@ =end module SiSU_XHTML_shared - require "#{SiSU_lib}/defaults" # defaults.rb - require "#{SiSU_lib}/xhtml_table" # xhtml_table.rb + require_relative 'defaults' # defaults.rb + require_relative 'xhtml_table' # xhtml_table.rb class Table_xhtml < SiSU_XHTML_table::Table_xhtml end end diff --git a/lib/sisu/v3/shared_xml.rb b/lib/sisu/v3/shared_xml.rb index afc0b855..06b89395 100644 --- a/lib/sisu/v3/shared_xml.rb +++ b/lib/sisu/v3/shared_xml.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_XML_munge class Trans - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb def initialize(md) @md=md @sys=SiSU_Env::System_call.new @@ -70,39 +70,39 @@ module SiSU_XML_munge def semantic_tags def default { - :pub => 'publication', - :conv => 'convention', - :vol => 'volume', - :pg => 'page', - :cty => 'city', - :org => 'organization', - :uni => 'university', - :dept => 'department', - :fac => 'faculty', - :inst => 'institute', - :co => 'company', - :com => 'company', - :conv => 'convention', - :dt => 'date', - :y => 'year', - :m => 'month', - :d => 'day', - :ti => 'title', - :au => 'author', - :ed => 'editor', #editor? - :v => 'version', #edition - :n => 'name', - :fn => 'firstname', - :mn => 'middlename', - :ln => 'lastname', - :in => 'initials', - :qt => 'quote', - :ct => 'cite', - :ref => 'reference', - :ab => 'abreviation', - :def => 'define', - :desc => 'description', - :trans => 'translate', + pub: 'publication', + conv: 'convention', + vol: 'volume', + pg: 'page', + cty: 'city', + org: 'organization', + uni: 'university', + dept: 'department', + fac: 'faculty', + inst: 'institute', + co: 'company', + com: 'company', + conv: 'convention', + dt: 'date', + y: 'year', + m: 'month', + d: 'day', + ti: 'title', + au: 'author', + ed: 'editor', #editor? + v: 'version', #edition + n: 'name', + fn: 'firstname', + mn: 'middlename', + ln: 'lastname', + in: 'initials', + qt: 'quote', + ct: 'cite', + ref: 'reference', + ab: 'abreviation', + def: 'define', + desc: 'description', + trans: 'translate', } end self @@ -514,7 +514,7 @@ module SiSU_XML_munge end end module SiSU_XML_tags #Format - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz class RDF @@ -707,6 +707,6 @@ WOK end end module SiSU_Tables - require "#{SiSU_lib}/xml_tables" # xml_tables.rb + require_relative 'xml_tables' # xml_tables.rb end __END__ diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb index 5607bb1f..21255bb7 100644 --- a/lib/sisu/v3/sisupod_make.rb +++ b/lib/sisu/v3/sisupod_make.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -61,9 +61,9 @@ module SiSU_Doc include SiSU_Env class Source include FileUtils #::Verbose - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/response" # response.rb - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'response' # response.rb + require_relative 'particulars' # particulars.rb def initialize(opt) @opt=opt m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @@ -71,7 +71,7 @@ module SiSU_Doc @env=SiSU_Env::Info_env.new(@opt.fns) @ver=SiSU_Env::Info_version.instance.get_version @ans=SiSU_Response::Response.new - pod_path="#{@env.path.processing}/sisupod" + pod_path="#{@env.processing_path.processing}/sisupod" @v=if @opt.cmd =~/[VM]/; 'v' else '' end @@ -82,7 +82,7 @@ module SiSU_Doc else @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1') end mkdir_p(pod_path) unless FileTest.directory?(pod_path) - rm_rf("#{@env.path.processing}sisupod/*") if FileTest.directory?("#{@env.path.processing}sisupod") + rm_rf("#{@env.processing_path.processing}sisupod/*") if FileTest.directory?("#{@env.processing_path.processing}sisupod") end def read unless @opt.cmd =~/q/ @@ -146,7 +146,7 @@ module SiSU_Doc "#{@env.path.pwd}/_sisu/skin", "#{@env.path.home}/.sisu/skin", '/etc/sisu/skin', - "#{@env.path.processing}/external_document/skin" + "#{@env.processing_path.processing}/external_document/skin" ] sk_doc,sk_dir="doc/#{skin}.rb","dir/skin_#{@env.stub_pwd}.rb" skin_path.each do |v| #document skin priority 1 @@ -171,7 +171,7 @@ module SiSU_Doc @rgx_skin=/^\s+:skin:\s+(\S+)/ @rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/ use_file=@opt.fns =~/(?:\.ssm|\.ssm\.sst)$/ \ - ? "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" \ + ? "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" \ : @opt.fns file_array=IO.readlines(use_file,'') skin,images,doc_import=[],[],[] @@ -195,7 +195,7 @@ module SiSU_Doc else skin_source=select end - docskin_place="#{@env.path.processing}/sisupod/_sisu/skin/#{skin_source[:type]}" + docskin_place="#{@env.processing_path.processing}/sisupod/_sisu/skin/#{skin_source[:type]}" if skin_source[:type] =~/dir/ docskin_with_path="#{docskin_place}/skin_#{@env.stub_pwd}.rb" docskin=[docskin_with_path.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')] @@ -225,7 +225,7 @@ module SiSU_Doc images.delete_if {|x| x =~/https?:\/\// } #images.sort! image_path_pwd='_sisu/image' - path_pod_conf="#{@env.path.processing}/sisupod/_sisu" + path_pod_conf="#{@env.processing_path.processing}/sisupod/_sisu" images_path_pod="#{path_pod_conf}/image" #unattractive hard coding ... ! images_pwd="#{@env.path.pwd}/#{image_path_pwd}" @@ -251,24 +251,24 @@ module SiSU_Doc if doc_import.flatten.length > 0 \ and @opt.fns =~/\.ssm\.sst$/ doc_import.flatten.each do |f| - cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}") + cp_r("#{@env.path.pwd}/#{f}","#{@env.processing_path.processing}/sisupod/#{f}") end end if x[:f] \ and x[:f].length > 1 #store multiple document language versions, sisupod x[:f].each do |f| - cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}") + cp_r("#{@env.path.pwd}/#{f}","#{@env.processing_path.processing}/sisupod/#{f}") end elsif @opt.fns =~/\.ssm\.sst/ ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm') - cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}") - else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}") + cp_r("#{@env.path.pwd}/#{ssm}","#{@env.processing_path.processing}/sisupod/#{ssm}") + else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.processing_path.processing}/sisupod/#{@opt.fns}") end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end def sisupod_7zip #look at later mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) system(%{ - cd #{@env.path.processing} + cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt #7zip -qz #{@opt.fns}.7z sisu_zip.txt < sisu_zip.txt 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@zipfile}.7z sisu_zip.txt @@ -282,7 +282,7 @@ module SiSU_Doc def sisupod_zip mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) system(%{ - cd #{@env.path.processing} + cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt zip -qz #{@zipfile}.zip sisu_zip.txt < sisu_zip.txt zip -qr #{@zipfile}.zip sisupod diff --git a/lib/sisu/v3/sitemaps.rb b/lib/sisu/v3/sitemaps.rb index 57d36590..2241b5e6 100644 --- a/lib/sisu/v3/sitemaps.rb +++ b/lib/sisu/v3/sitemaps.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,11 +57,11 @@ =end module SiSU_Sitemaps - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/shared_xml" # shared_xml.rb + require_relative 'shared_xml' # shared_xml.rb include SiSU_XML_munge class Source require 'fileutils' diff --git a/lib/sisu/v3/spell.rb b/lib/sisu/v3/spell.rb index 76f92e0b..4b8b892a 100644 --- a/lib/sisu/v3/spell.rb +++ b/lib/sisu/v3/spell.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/sst_convert_markup.rb b/lib/sisu/v3/sst_convert_markup.rb index 6849a9af..6a3a9851 100644 --- a/lib/sisu/v3/sst_convert_markup.rb +++ b/lib/sisu/v3/sst_convert_markup.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,13 +59,9 @@ =end module SiSU_Modify - require "#{SiSU_lib}/sst_identify_markup" # sst_identify_markup.rb - #require "#{SiSU_lib}/sst_from_kdissert" # sst_from_kdissert.rb - #require "#{SiSU_lib}/sst_to_s_xml_sax" # sst_to_s_xml_sax.rb - #require "#{SiSU_lib}/sst_to_s_xml_dom" # sst_to_s_xml_dom.rb - #require "#{SiSU_lib}/sst_to_s_xml_node" # sst_to_s_xml_node.rb - require "#{SiSU_lib}/sst_from_xml" # sst_from_xml.rb - require "#{SiSU_lib}/response" # response.rb + require_relative 'sst_identify_markup' # sst_identify_markup.rb + require_relative 'sst_from_xml' # sst_from_xml.rb + require_relative 'response' # response.rb class Convert_markup require 'fileutils' include FileUtils #::Verbose @@ -194,7 +190,7 @@ WOK SiSU_sst_from_xml::Convert.new(@opt).read end def convert_footnotes - require "#{SiSU_lib}/sst_do_inline_footnotes" + require_relative 'sst_do_inline_footnotes' SiSU_Convert_footnotes::Source.new(@opt).read end def conversion @@ -300,7 +296,7 @@ WOK end end #%% files to match for this conversion set -------------------------> -require "#{SiSU_lib}/options" # options.rb +require_relative 'options' # options.rb argv=$* @opt=SiSU_commandline::Options.new(argv) case @opt.mod.inspect diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb index e9154c6d..18252515 100644 --- a/lib/sisu/v3/sst_do_inline_footnotes.rb +++ b/lib/sisu/v3/sst_do_inline_footnotes.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,15 +59,15 @@ =end module SiSU_Convert_footnotes - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/dal_syntax" # dal_syntax.rb + require_relative 'dal_syntax' # dal_syntax.rb include SiSU_Syntax - require "#{SiSU_lib}/i18n" # i18n.rb + require_relative 'i18n' # i18n.rb class Instantiate < SiSU_Param::Parameters::Instructions @@flag={} #Beware!! def initialize @@ -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/ @@ -184,7 +184,7 @@ module SiSU_Convert_footnotes def song reset data=@data - @metafile="#{@env.path.dal}/#{@md.fns}.meta" + @metafile="#{@env.processing_path.dal}/#{@md.fns}.meta" my_make_source_file=SiSU_Env::Create_file.new(@md.fns) data=data.join.split("\n\n") data_new=[] @@ -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/sst_from_xml.rb b/lib/sisu/v3/sst_from_xml.rb index f07f6a31..a948357a 100644 --- a/lib/sisu/v3/sst_from_xml.rb +++ b/lib/sisu/v3/sst_from_xml.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,7 +58,7 @@ =end module SiSU_sst_from_xml - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb class Convert require 'rexml/document' include REXML diff --git a/lib/sisu/v3/sst_identify_markup.rb b/lib/sisu/v3/sst_identify_markup.rb index ba7d5826..6f6cf865 100644 --- a/lib/sisu/v3/sst_identify_markup.rb +++ b/lib/sisu/v3/sst_identify_markup.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU diff --git a/lib/sisu/v3/sst_to_s_xml_sax.rb b/lib/sisu/v3/sst_to_s_xml_sax.rb index 15289779..e698a8f9 100644 --- a/lib/sisu/v3/sst_to_s_xml_sax.rb +++ b/lib/sisu/v3/sst_to_s_xml_sax.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,21 +57,21 @@ =end module SiSU_simple_xml_model_sax - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/dal_doc_str" # dal_doc_str.rb - require "#{SiSU_lib}/shared_xml" # shared_xml.rb + require_relative 'dal_doc_str' # dal_doc_str.rb + require_relative 'shared_xml' # shared_xml.rb include SiSU_XML_munge - require "#{SiSU_lib}/shared_sem" # shared_sem.rb - require "#{SiSU_lib}/xml_format" # xml_format.rb + require_relative 'shared_sem' # shared_sem.rb + require_relative 'xml_format' # xml_format.rb include SiSU_XML_format - require "#{SiSU_lib}/rexml" # rexml.rb + require_relative 'rexml' # rexml.rb include SiSU_Rexml @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0 @@tablefoot='' @@ -128,10 +128,10 @@ module SiSU_simple_xml_model_sax end end class Scroll - require "#{SiSU_lib}/shared_txt" # shared_txt.rb - require "#{SiSU_lib}/css" # css.rb + require_relative 'shared_txt' # shared_txt.rb + require_relative 'css' # css.rb include SiSU_text_utils - @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] } + @@xml={ body: [], open: [], close: [], head: [] } def initialize(data='',particulars='') @data,@env,@md=data,particulars.env,particulars.md @vz=SiSU_Env::Get_init.instance.skin diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index a7105d69..d4d0f16d 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,7 +59,7 @@ @@cX=nil @@current_document=Dir.pwd #nil #'' module SiSU_Env - require "#{SiSU_lib}/constants" # constants.rb + require_relative 'constants' # constants.rb require 'fileutils' include FileUtils::Verbose require 'singleton' @@ -114,7 +114,7 @@ module SiSU_Env "#{@@home}/#{prcss_dir_stub}" else prcss_dir_stub end - processing_path=tmp_processing_individual + processing_pth=tmp_processing_individual processing_dir=prcss_dir processing_git="#{Dir.pwd}/#{Gt[:grotto]}" user=ENV['USER'] @@ -184,9 +184,9 @@ module SiSU_Env WEBSERV_SQLITE => out + '/www/sqlite', OUTPUT_LOCAL => @@home + '/sisu_www', PROCESSING_DIR => processing_dir, - PROCESSING_PATH => processing_path, + PROCESSING_PATH => processing_pth, PROCESSING_DIR_TMP_ROOT => prcss_dir_tmp_root, - PROCESSING_PATH_TMP_BASE => processing_path, + PROCESSING_PATH_TMP_BASE => processing_pth, PROCESSING_DAL => 'dal', PROCESSING_TUNE => 'tune', PROCESSING_LATEX => 'tex', @@ -269,7 +269,7 @@ module SiSU_Env include Singleton @@noyaml=false @@rc,@@sisurc_path,@@vz,@@tx=nil,nil,nil,nil - @@ad={ :promo=>nil,:promo_list=>nil,:flag_promo=>false } + @@ad={ promo: nil, promo_list: nil, flag_promo: false } attr_accessor :yaml def initialize super() @@ -493,7 +493,7 @@ module SiSU_Env if FileTest.file?("#{@fn[:m]}.#{@fn[:t]}"); x << "#{@fn[:m]}.#{@fn[:t]}" end dir=SiSU_Env::Info_env.new(@fns) - @m << {:m => 'sisu_manifest.html', :l => 'English' } #fix later, default language + @m << { m: 'sisu_manifest.html', l: 'English' } #fix later, default language langs.each do |l| lng=SiSU_Env::Standardise_language.new(l) fns_c="#{@fn[:m]}~#{lng.code}.#{@fn[:t]}" @@ -502,12 +502,12 @@ module SiSU_Env fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_c) lng=fn_set_lang[:l] fn=SiSU_Env::Env_call.new(fns_c).lang(fn_set_lang[:c]) - @m << {:m => fn[:manifest], :l => lng } + @m << { m: fn[:manifest], l: lng } elsif FileTest.file?(fns_l) fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_l) @fnl=dir.i18n.lang_filename(fn_set_lang[:c]) fn=SiSU_Env::Env_call.new(fns_l).lang(fn_set_lang[:c]) - @m << {:m => fn[:manifest], :l => lng } + @m << { m: fn[:manifest], l: lng } end end @m.uniq! @@ -523,48 +523,48 @@ module SiSU_Env end def lang(code) @fn={ - :html => filename(code,'','.html'), - :book_index => filename(code,'book_index','.html'), - :concordance => filename(code,'concordance','.html'), - :sax => filename(code,'sax','.xml'), - :dom => filename(code,'dom','.xml'), - :docbook => filename(code,'docbook','.xml'), - :xhtml => filename(code,'scroll','.xhtml'), - :pdf_l => filename(code,'','.pdf'), - :pdf_p => filename(code,'','.pdf'), - :pdf_l_a4 => filename(code,"a4",'.pdf'), - :pdf_p_a4 => filename(code,"a4",'.pdf'), - :pdf_l_a5 => filename(code,"a5",'.pdf'), - :pdf_p_a5 => filename(code,"a5",'.pdf'), - :pdf_l_b5 => filename(code,"b5",'.pdf'), - :pdf_p_b5 => filename(code,"b5",'.pdf'), - :pdf_l_letter => filename(code,"letter",'.pdf'), - :pdf_p_letter => filename(code,"letter",'.pdf'), - :pdf_l_legal => filename(code,"legal",'.pdf'), - :pdf_p_legal => filename(code,"legal",'.pdf'), - :toc => filename(code,'toc','.html'), - :doc => filename(code,fnb,'.html'), - :index => filename(code,'index','.html'), - :po => filename(code,@fns,'.po'), - :pot => filename(code,@fns,'.pot'), - :odf => filename(code,'','.odt'), - :epub => filename(code,'','.epub'), - :plain => filename(code,'','.txt'), - :manpage => filename(code,'','.1'), #fix, section number - :wiki => filename(code,'wiki','.txt'), - :digest => filename(code,'digest','.txt'), - :metadata => filename(code,'metadata','.html'), #chk - :manifest => filename(code,'manifest','.html'), - :oai_pmh => filename(code,'oai_pmh','.xml'), - :sitemap => filename(code,'sitemap','.xml'), - :sitemap_touch => filename(code,"sitemap_#{fnb}",'.xml'), - :sxs => filename(code,fnb,'.sxs.xml'), - :sxd => filename(code,fnb,'.sxd.xml'), - :sxn => filename(code,fnb,'.sxn.xml'), - :sisupod => filename(nil,@fnz,''), - :book_idx_html => filename(code,'book_index','.html'), - :book_idx_epub => filename(code,'book_index','.xhtml'), - :epub_concord => filename(code,'concordance','.xhtml'), + html: filename(code,'','.html'), + book_index: filename(code,'book_index','.html'), + concordance: filename(code,'concordance','.html'), + sax: filename(code,'sax','.xml'), + dom: filename(code,'dom','.xml'), + docbook: filename(code,'docbook','.xml'), + xhtml: filename(code,'scroll','.xhtml'), + pdf_l: filename(code,'','.pdf'), + pdf_p: filename(code,'','.pdf'), + pdf_l_a4: filename(code,"a4",'.pdf'), + pdf_p_a4: filename(code,"a4",'.pdf'), + pdf_l_a5: filename(code,"a5",'.pdf'), + pdf_p_a5: filename(code,"a5",'.pdf'), + pdf_l_b5: filename(code,"b5",'.pdf'), + pdf_p_b5: filename(code,"b5",'.pdf'), + pdf_l_letter: filename(code,"letter",'.pdf'), + pdf_p_letter: filename(code,"letter",'.pdf'), + pdf_l_legal: filename(code,"legal",'.pdf'), + pdf_p_legal: filename(code,"legal",'.pdf'), + toc: filename(code,'toc','.html'), + doc: filename(code,fnb,'.html'), + index: filename(code,'index','.html'), + po: filename(code,@fns,'.po'), + pot: filename(code,@fns,'.pot'), + odf: filename(code,'','.odt'), + epub: filename(code,'','.epub'), + plain: filename(code,'','.txt'), + manpage: filename(code,'','.1'), #fix, section number + wiki: filename(code,'wiki','.txt'), + digest: filename(code,'digest','.txt'), + metadata: filename(code,'metadata','.html'), #chk + manifest: filename(code,'manifest','.html'), + oai_pmh: filename(code,'oai_pmh','.xml'), + sitemap: filename(code,'sitemap','.xml'), + sitemap_touch: filename(code,"sitemap_#{fnb}",'.xml'), + sxs: filename(code,fnb,'.sxs.xml'), + sxd: filename(code,fnb,'.sxd.xml'), + sxn: filename(code,fnb,'.sxn.xml'), + sisupod: filename(nil,@fnz,''), + book_idx_html: filename(code,'book_index','.html'), + book_idx_epub: filename(code,'book_index','.xhtml'), + epub_concord: filename(code,'concordance','.xhtml'), } @fn end @@ -979,7 +979,7 @@ module SiSU_Env @stub_pod end def sisupod - #path.processing + #processing_path.processing # sisupod # sisu # content.sst [file content] @@ -989,13 +989,13 @@ module SiSU_Env # skin/ # doc [relevant skin if any other than default] # image [all images for specific document gathered here] - sisupod_processing_path="#{path.processing}/sisupod" + sisupod_processing_path="#{processing_path.processing}/sisupod" if FileTest.directory?(sisupod_processing_path) \ or FileTest.file?(sisupod_processing_path) rm_rf(sisupod_processing_path) end paths=[] - paths=["#{path.processing}/sisupod/_sisu/skin/doc","#{path.processing}/sisupod/_sisu/skin/dir","#{path.processing}/sisupod/_sisu/skin/site","#{path.processing}/sisupod/_sisu/image"] + paths=["#{processing_path.processing}/sisupod/_sisu/skin/doc","#{processing_path.processing}/sisupod/_sisu/skin/dir","#{processing_path.processing}/sisupod/_sisu/skin/site","#{processing_path.processing}/sisupod/_sisu/image"] paths.each {|x| mkdir_p(x) unless FileTest.directory?(x) } end def defaults #multiple default directories @@ -1043,7 +1043,7 @@ module SiSU_Env @rc=SiSU_Env::Get_init.instance.sisu_yaml.rc @ad=SiSU_Env::Get_init.instance.ads @vz=SiSU_Env::Get_init.instance.skin - @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false } + @flag={ ad: false, md: false, sk: false, rc: false } def promo? @flag[:ad]=if @md.flag_promo && @ad[:flag_promo] @flag[:md]=true @@ -1221,7 +1221,7 @@ WOK def widget_static @rc=SiSU_Env::Get_init.instance.sisu_yaml.rc @vz=SiSU_Env::Get_init.instance.skin - @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false } + @flag={ ad: false, md: false, sk: false, rc: false } def search? flag=if defined? @rc['search'] \ and defined? @rc['search']['sisu'] \ @@ -1328,7 +1328,7 @@ WOK def source_file_path file=@fns.gsub(/\.ssm(?:\.sst)?/,'.ssm.sst') pth=unless file =~/\.ssm\.sst$/; "#{Dir.pwd}" - else "#{path.composite_file}" + else "#{processing_path.composite_file}" end end def source_file_with_path @@ -1339,12 +1339,12 @@ WOK fns_array=if RUBY_VERSION < '1.9' x=unless fns =~/\.ssm.sst$/ IO.readlines(fns,'') - else IO.readlines("#{path.composite_file}/#{fns}",'') + else IO.readlines("#{processing_path.composite_file}/#{fns}",'') end else #ruby version >= '1.9' x=unless fns =~/\.ssm.sst$/ IO.readlines(fns,'r:utf-8') - else IO.readlines("#{path.composite_file}/#{fns}",'r:utf-8') + else IO.readlines("#{processing_path.composite_file}/#{fns}",'r:utf-8') end end end @@ -1478,19 +1478,80 @@ WOK def output #web/webserv output directory... subdirectory into which further subdirectories are made based on file names "#{path.webserv}/#{@stub_pwd}" end + def feed + (defined? @rc['webserv']['feed']) \ + ? ("#{public_output}/#{@rc['webserv']['feed']}") \ + : (defaults[:webserv_feed]) + end + def feed_home + "#{public_output}/#{@rc['webserv']['feed_home']}" + end + def scripts #used previously only to include tla version info + if defined? @rc['project']['path']; "#{home}/#{@rc['project']['path']}" + end + end + def cgi + (defined? @rc['webserv']['cgi']) \ + ? "#{@rc['webserv']['cgi']}" \ + : (defaults[:webserv_cgi]) + end + def php + (defined? @rc['webserv']['php']) \ + ? "#{public_output}/#{@rc['webserv']['php']}" \ + : (defaults[:webserv_php]) + end + # programs + def output_tell + url.webserv_map_pwd + end + def image_source #image repository source directory + image_path=if defined? @rc['image']['path'] \ + and defined? @rc['image']['public'] + pth="#{@rc['image']['path']}" + "#{pth}/#{@rc['image']['public']}" + else "#{share}/image" + end + end + def image_source_sisu_includes + "#{share}/image" + end + def image_source_include #image repository source directory + image_path=if defined? @rc['image']['path'] \ + and defined? @rc['image']['public'] \ + and FileTest.directory?("#{@rc['image']['path']}/#{@rc['image']['public']}")==true + "#{@rc['image']['path']}/#{@rc['image']['public']}" + elsif FileTest.directory?("#{@@pwd}/#{defaults[:image_stub]}")==true + "#{@@pwd}/#{defaults[:image_stub]}" + else + "#{share}/image" + end + end + def image_external + "#{processing}/external_document/image" + end + def image_source_include_local + if FileTest.directory?(defaults[:image_local]); defaults[:image_local] + end + end + def image_source_include_remote + if FileTest.directory?(image_external); image_external + end + end + self + end + def processing_path def encoding pth="#{processing}/#{defaults[:processing_encoding]}" mkdir_p(pth) unless FileTest.directory?(pth) pth end -#def processing def processing_base_tmp defaults[:processing_path_tmp_base] end - def processing_dir_tmp_root + def tmp_root_dir defaults[:processing_dir_tmp_root] end - def processing_path_root + def root_dir proposed_path_base=if defined? @rc['processing']['path'] \ and not @rc['processing']['path'].nil? \ and not @rc['processing']['path'].empty? @@ -1517,30 +1578,30 @@ WOK else defaults[:processing_dir_tmp_root] end end - def processing_path_usr? - case processing_path_root + def usr_dir? + case root_dir when /^\/home/; false else true end end - def processing_path - (processing_path_usr?) \ - ? ("#{processing_path_root}/#{user}/#{stub_pwd}") \ - : ("#{processing_path_root}/#{stub_pwd}") # see defaults[:processing_path] + def stub_dir + (usr_dir?) \ + ? ("#{root_dir}/#{user}/#{stub_pwd}") \ + : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] end def processing #processing directory, used/needed for sisu work files, has sub-directories (dal,tex etc) - unless FileTest.directory?(processing_path_root) - mkdir_p(processing_path_root) - File.chmod(0777,processing_path_root) + unless FileTest.directory?(root_dir) + mkdir_p(root_dir) + File.chmod(0777,root_dir) end - if processing_path_usr? - processing_path_usr="#{processing_path_root}/#{user}" + if usr_dir? + processing_path_usr="#{root_dir}/#{user}" mkdir_p(processing_path_usr) unless FileTest.directory?(processing_path_usr) File.chmod(0700,processing_path_usr) end - mkdir_p(processing_path) unless FileTest.directory?(processing_path) - File.chmod(0700,processing_path) - path_processing=[processing_path,defaults[:processing_path],defaults[:processing_path_home]] + mkdir_p(stub_dir) unless FileTest.directory?(stub_dir) + File.chmod(0700,stub_dir) + path_processing=[stub_dir,defaults[:processing_path],defaults[:processing_path_home]] processing=nil path_processing.each do |v| # processing=v @@ -1553,36 +1614,6 @@ WOK end processing end - def processing_path_git - proposed_dir=if defined? @rc['git']['dir'] \ - and not @rc['git']['dir'].nil? \ - and not @rc['git']['dir'].empty? - x=(@rc['git']['dir'] =~/^(?:~|home)$/) \ - ? home + '/' + 'sisu:' \ - : @rc['git']['dir'] + '/' + 'sisu:' - else defaults[:processing_git] - end - end - def processing_git - unless FileTest.directory?(processing_path_git) - mkdir_p(processing_path_git) - File.chmod(0700,processing_path_git) - end - processing_path_git - end - def epub - "#{processing}/epub/#{@fnb}" - end - def sql - pth="#{processing}/sql" - mkdir_p(pth) unless FileTest.directory?(pth) - pth - end - def composite_file - pth=path.dal #"#{processing}/composite" - mkdir_p(pth) unless FileTest.directory?(pth) - pth - end def dal pth=if defined? @rc['processing']['dal'] \ and not @rc['processing']['dal'].nil? \ @@ -1603,21 +1634,44 @@ WOK mkdir_p(pth) unless FileTest.directory?(pth) pth end - def processing_odf + def composite_file + pth=processing_path.dal #"#{processing}/composite" + mkdir_p(pth) unless FileTest.directory?(pth) + pth + end + def git + pth=if defined? @rc['git']['dir'] \ + and not @rc['git']['dir'].nil? \ + and not @rc['git']['dir'].empty? + x=(@rc['git']['dir'] =~/^(?:~|home)$/) \ + ? home + '/' + 'sisu:' \ + : @rc['git']['dir'] + '/' + 'sisu:' + else defaults[:processing_git] + end + unless FileTest.directory?(pth) + mkdir_p(git) + File.chmod(0700,git) + end + pth + end + def odf pth="#{processing}/odf" mkdir_p(pth) unless FileTest.directory?(pth) pth end + def epub + "#{processing}/epub/#{@fnb}" + end def epub_bld #(md) - mkdir_p(path.epub) unless FileTest.directory?(path.epub) - mkdir_p("#{path.epub}/META-INF") unless FileTest.directory?("#{path.epub}/META-INF") - mkdir_p("#{path.epub}/OPS/image") unless FileTest.directory?("#{path.epub}/OPS/image") - mkdir_p("#{path.epub}/OPS/css") unless FileTest.directory?("#{path.epub}/OPS/css") + mkdir_p(processing_path.epub) unless FileTest.directory?(processing_path.epub) + mkdir_p("#{processing_path.epub}/META-INF") unless FileTest.directory?("#{processing_path.epub}/META-INF") + mkdir_p("#{processing_path.epub}/OPS/image") unless FileTest.directory?("#{processing_path.epub}/OPS/image") + mkdir_p("#{processing_path.epub}/OPS/css") unless FileTest.directory?("#{processing_path.epub}/OPS/css") images=%W[bullet_09.png arrow_next_red.png arrow_prev_red.png arrow_up_red.png] - path.epub + processing_path.epub end def epub_cp_images(md) - pth="#{path.epub}/OPS/image" + pth="#{processing_path.epub}/OPS/image" mkdir_p(pth) unless FileTest.directory?(pth) src="#{path.share}/image" images=%W[bullet_09.png arrow_next_red.png arrow_prev_red.png arrow_up_red.png] @@ -1626,7 +1680,7 @@ WOK end pth end - def processing_tex + def tex pth=if defined? @rc['processing']['latex'] \ and not @rc['processing']['latex'].nil? \ and not @rc['processing']['latex'].empty? @@ -1662,6 +1716,11 @@ WOK mkdir_p(pth) unless FileTest.directory?(pth) pth end + def sql + pth="#{processing}/sql" + mkdir_p(pth) unless FileTest.directory?(pth) + pth + end def sqlite pth=if defined? @rc['processing']['sqlite'] \ and not @rc['processing']['sqlite'].nil? \ @@ -1682,66 +1741,6 @@ WOK mkdir_p(pth) unless FileTest.directory?(pth) pth end -#end - def feed - (defined? @rc['webserv']['feed']) \ - ? ("#{public_output}/#{@rc['webserv']['feed']}") \ - : (defaults[:webserv_feed]) - end - def feed_home - "#{public_output}/#{@rc['webserv']['feed_home']}" - end - def scripts #used previously only to include tla version info - if defined? @rc['project']['path']; "#{home}/#{@rc['project']['path']}" - end - end - def cgi - (defined? @rc['webserv']['cgi']) \ - ? "#{@rc['webserv']['cgi']}" \ - : (defaults[:webserv_cgi]) - end - def php - (defined? @rc['webserv']['php']) \ - ? "#{public_output}/#{@rc['webserv']['php']}" \ - : (defaults[:webserv_php]) - end - # programs - def output_tell - url.webserv_map_pwd - end - def image_source #image repository source directory - image_path=if defined? @rc['image']['path'] \ - and defined? @rc['image']['public'] - pth="#{@rc['image']['path']}" - "#{pth}/#{@rc['image']['public']}" - else "#{share}/image" - end - end - def image_source_sisu_includes - "#{share}/image" - end - def image_source_include #image repository source directory - image_path=if defined? @rc['image']['path'] \ - and defined? @rc['image']['public'] \ - and FileTest.directory?("#{@rc['image']['path']}/#{@rc['image']['public']}")==true - "#{@rc['image']['path']}/#{@rc['image']['public']}" - elsif FileTest.directory?("#{@@pwd}/#{defaults[:image_stub]}")==true - "#{@@pwd}/#{defaults[:image_stub]}" - else - "#{share}/image" - end - end - def image_external - "#{processing}/external_document/image" - end - def image_source_include_local - if FileTest.directory?(defaults[:image_local]); defaults[:image_local] - end - end - def image_source_include_remote - if FileTest.directory?(image_external); image_external - end - end self end def url @@ -2197,12 +2196,12 @@ WOK : (defaults[:papersize].downcase) end def odf_structure - rm_rf("#{path.processing}/odf") - system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{path.processing}") + rm_rf("#{processing_path.processing}/odf") + system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{processing_path.processing}") end def sisupod_gen(fns_pod) pwd=Dir.pwd - sisupod_processing_path="#{path.processing}/sisupod" + sisupod_processing_path="#{processing_path.processing}/sisupod" if FileTest.directory?(sisupod_processing_path) \ or FileTest.file?(sisupod_processing_path) rm_rf(sisupod_processing_path) @@ -2211,7 +2210,7 @@ WOK mkdir_p(sisupod_processing_path) end if FileTest.file?("#{Dir.pwd}/#{fns_pod}") - system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{path.processing}") + system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{processing_path.processing}") else SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}").warn unless @cmd=~/q/ end @@ -2840,37 +2839,37 @@ WOK end def marshal def dal_content - "#{@env.path.dal}/#{@fns}.content.rbm" + "#{@env.processing_path.dal}/#{@fns}.content.rbm" end def dal_idx_sst_rel_html_seg - "#{@env.path.dal}/#{@fns}.idx_sst.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_sst.rbm" end def dal_idx_sst_rel - "#{@env.path.dal}/#{@fns}.idx_tex.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_tex.rbm" end def dal_idx_html - "#{@env.path.dal}/#{@fns}.idx_html.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_html.rbm" end def dal_idx_xhtml - "#{@env.path.dal}/#{@fns}.idx_xhtml.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_xhtml.rbm" end def dal_metadata - "#{@env.path.dal}/#{@fns}.metadata.rbm" + "#{@env.processing_path.dal}/#{@fns}.metadata.rbm" end def dal_map_nametags - "#{@env.path.dal}/#{@fns}.map_name_tags.rbm" + "#{@env.processing_path.dal}/#{@fns}.map_name_tags.rbm" end def dal_map_ocn_htmlseg - "#{@env.path.dal}/#{@fns}.map_ocn_htmlseg.rbm" + "#{@env.processing_path.dal}/#{@fns}.map_ocn_htmlseg.rbm" end def html_tune - "#{@env.path.tune}/#{@fns}.marshal_tune" + "#{@env.processing_path.tune}/#{@fns}.marshal_tune" end self end def write_file_processing def html_tune - File.new("#{@env.path.tune}/#{@fns}.tune",'w+') + File.new("#{@env.processing_path.tune}/#{@fns}.tune",'w+') end self end @@ -2952,10 +2951,10 @@ WOK def mkdir #check moved from SiSU_file, existing mkdir def processing def dal - mkdir_p(@env.path.dal) unless FileTest.directory?(@env.path.dal) + mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal) end def tune - mkdir_p(@env.path.tune) unless FileTest.directory?(@env.path.tune) + mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune) end self end @@ -2990,8 +2989,8 @@ WOK mkdir_p(output_path.base) unless FileTest.directory?(output_path.base) mkdir_p("#{output_path.base}/#{@md.fnb}") unless FileTest.directory?("#{output_path.base}/#{@md.fnb}") mkdir_p("#{output_path.base}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base}/#{@env.path.style}") - mkdir_p(@env.path.dal) unless FileTest.directory?(@env.path.dal) - mkdir_p(@env.path.tune) unless FileTest.directory?(@env.path.tune) + mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal) + mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune) end def mkdir txt_path="#{output_path.base}/#{@md.fnb}" @@ -3409,13 +3408,13 @@ WOK end def po_git ft=Gt[:po] - pth=@env.path.processing_path_git + '/' + @md.fnb + '/' + ft + '/' + lang_part + pth=@env.processing_path.git + '/' + @md.fnb + '/' + ft + '/' + lang_part mkdir_p(pth) unless FileTest.directory?(pth) pth end def pot_git ft=Gt[:pot] - @env.path.processing_path_git + '/' + @md.fnb + '/' + ft + @env.processing_path.git + '/' + @md.fnb + '/' + ft end def md_harvest "#{output_path.base}/sisu_site_metadata" @@ -3501,7 +3500,7 @@ WOK #@env.path.output end def mkdir_pdf - Dir.mkdir(@env.path.tex) unless FileTest.directory?(@env.path.tex) + Dir.mkdir(@env.processing_path.tex) unless FileTest.directory?(@env.processing_path.tex) end def file_generic(output_file='') filename="#{@env.path.output}/#{@fnb}/#{output_file}" @@ -3511,17 +3510,17 @@ WOK File.new('/tmp/errorlog.sisu','w+') end def file_txt - File.new("#{@env.path.dal}/#{@fns}.txt",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.txt",'w+') end def file_debug - File.new("#{@env.path.dal}/#{@fns}.debug.txt",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.debug.txt",'w+') end def metaverse def file_meta - File.new("#{@env.path.dal}/#{@fns}.meta",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.meta",'w+') end def file_meta_idx_html - File.new("#{@env.path.dal}/#{@fns}.idx.html",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.idx.html",'w+') end self end @@ -3529,7 +3528,7 @@ WOK File.new("#{Dir.pwd}/#{@fns}.fn",'w+') end def meta - "#{@env.path.dal}/#{@fns}.meta" + "#{@env.processing_path.dal}/#{@fns}.meta" end def file_semantic filename_semantic="./semantic.yaml" @@ -3540,7 +3539,7 @@ WOK @@filename_rss=File.new(filename_rss,'w+') end def epub - @pth=@env.path.epub + @pth=@env.processing_path.epub def xhtml_index filename_index="#{@pth}/OPS/index.xhtml" File.new(filename_index,'w+') @@ -3567,7 +3566,7 @@ WOK self end def file_texinfo - File.new("#{@env.path.texinfo}/#{@fnb}.texinfo",'w+') + File.new("#{@env.processing_path.texinfo}/#{@fnb}.texinfo",'w+') end end class Clear <Info_env #todo unify with SiSU_file @@ -3736,8 +3735,8 @@ WOK def select # skin loading logic here load "#{SiSU_lib}/defaults.rb" skin_path=[] - @env.sys.rc_path.each{|x| skin_path << "#{x}/skin"} - skin_path << "#{@env.path.processing}/external_document/skin" + @env.sys.rc_path.each {|x| skin_path << "#{x}/skin"} + skin_path << "#{@env.processing_path.processing}/external_document/skin" skin=true if @pwd_stub =~/^sisupod$/ \ and @md.mod.inspect !~/--trust/ @@ -3900,7 +3899,7 @@ WOK end end class Create_site < Info_env - require "#{SiSU_lib}/css" # css.rb + require_relative 'css' # css.rb include SiSU_Style def initialize(cmd) @cmd=cmd @@ -3959,7 +3958,7 @@ WOK cp_images(src,dest) end def cp_external_images - src="#{@env.path.processing}/external_document/image" + src="#{@env.processing_path.processing}/external_document/image" dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external" cp_images(src,dest) end @@ -4026,10 +4025,10 @@ WOK end end module SiSU_Screen - require "#{SiSU_lib}/screen_text_color" # screen_text_color.rb + require_relative 'screen_text_color' # screen_text_color.rb end module SiSU_Errors - require "#{SiSU_lib}/errors" # errors.rb + require_relative 'errors' # errors.rb end __END__ https? intro check 2007-09-22 @@ -4041,7 +4040,7 @@ fns_array=unless fns =~/\.ssm.sst$/ end else if RUBY_VERSION < '1.9' - IO.readlines("#{path.composite_file}/#{fns}",'') - else IO.readlines("#{path.composite_file}/#{fns}",'r:utf-8') + IO.readlines("#{processing_path.composite_file}/#{fns}",'') + else IO.readlines("#{processing_path.composite_file}/#{fns}",'r:utf-8') end end diff --git a/lib/sisu/v3/termsheet.rb b/lib/sisu/v3/termsheet.rb index b08b57c0..b09bd5ac 100644 --- a/lib/sisu/v3/termsheet.rb +++ b/lib/sisu/v3/termsheet.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,8 +58,8 @@ sample files must be provided - (saved till later as may confuse) =end -require "#{SiSU_lib}/sysenv" # sysenv.rb -require "#{SiSU_lib}/param" # param.rb +require_relative 'sysenv' # sysenv.rb +require_relative 'param' # param.rb include SiSU_Param @do,@done,@used,@html_output,@txt_input,@txt_output,@@report=Array.new(7){[]} @@info=nil @@ -121,7 +121,7 @@ WOK @@report << @done << @used << "\n" @done,@used=[],[] end -require "#{SiSU_lib}/param" # param.rb +require_relative 'param' # param.rb @argv=$* @proc="#{@argv[0].to_s}" if @proc =~ /^-?[wft]/ diff --git a/lib/sisu/v3/texinfo.rb b/lib/sisu/v3/texinfo.rb index fcd4a5b3..14602fb7 100644 --- a/lib/sisu/v3/texinfo.rb +++ b/lib/sisu/v3/texinfo.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,12 +57,12 @@ =end module SiSU_TexInfo - require "#{SiSU_lib}/html" # html.rb - require "#{SiSU_lib}/param" # param.rb + require_relative 'html' # html.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz #include Stamp ... needed removed arbitrarily 2005w05/1 (warnings about undefined flags) - require "#{SiSU_lib}/texinfo_format" # texinfo_format.rb + require_relative 'texinfo_format' # texinfo_format.rb include SiSU_Texinfo_format @tex_file=[] @@tabular="{tabular}" @@ -85,7 +85,7 @@ module SiSU_TexInfo case @opt.fns when /\.(?:-|ssm\.)?sst$/ Dir.mkdir(@env.path.output) unless FileTest.directory?("#{@env.path.output}") - Dir.mkdir(@env.path.texi) unless FileTest.directory?(@env.path.tex) + Dir.mkdir(@env.processing_path.texi) unless FileTest.directory?(@env.processing_path.texi) end rescue; STDERR.puts SiSU_Screen::Ansi.new(@opt.cmd,$!,$@).rescue ensure @@ -359,7 +359,7 @@ module SiSU_TexInfo def output data=@data data.compact! - filename=%{#{@env.path.texi}/#{@md.fnb}.texinfo} + filename=%{#{@env.processing_path.texi}/#{@md.fnb}.texinfo} filename_texinfo=File.new(filename,'w+') puts filename if @md.cmd =~/M/ data.each {|s| (filename_texinfo.puts s,"\n") if s} @@ -373,7 +373,7 @@ module SiSU_TexInfo case sfx when /(?:-|ssm\.)?sst$/ @env=SiSU_Env::Info_env.new(@md.fns,@md.cmd) - Dir.chdir(@env.path.texi) + Dir.chdir(@env.processing_path.texi) texinfo=SiSU_Env::System_call.new("#{fnb}.texinfo") texinfo.makeinfo end diff --git a/lib/sisu/v3/texinfo_format.rb b/lib/sisu/v3/texinfo_format.rb index 69d98240..b9fb3256 100644 --- a/lib/sisu/v3/texinfo_format.rb +++ b/lib/sisu/v3/texinfo_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,7 +58,7 @@ =end module SiSU_Texinfo_format @@table_pg_break_counter=1 - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz class Texinfo diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index e0646603..9497d51f 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,13 +58,13 @@ =end module SiSU_TeX require 'pstore' - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/texpdf_format" # texpdf_format.rb + require_relative 'texpdf_format' # texpdf_format.rb include SiSU_TeX_Pdf - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb + require_relative 'shared_metadata' # shared_metadata.rb @tex_file=@@tex_footnote_array=@@tex_col_w=[] @@tabular="{tabular}" @@column_instruct=@@squigle_close=@@tex_line_mode=@@tex_word_mode=@@line_mode='' @@ -74,10 +74,10 @@ module SiSU_TeX @@date ||=SiSU_Env::Info_date.new class Source require 'pstore' - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Viz - require "#{SiSU_lib}/dal" # dal.rb + require_relative 'dal' # dal.rb include SiSU_DAL include SiSU_TeX def initialize(opt) @@ -91,7 +91,7 @@ module SiSU_TeX case @opt.fns when /\.(?:-|ssm\.)?sst$/ SiSU_Env::SiSU_file.new(@md).mkdir - Dir.mkdir(@env.path.processing_tex) unless FileTest.directory?(@env.path.processing_tex) + Dir.mkdir(@env.processing_path.tex) unless FileTest.directory?(@env.processing_path.tex) end rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure @@ -123,7 +123,7 @@ module SiSU_TeX rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure unless @opt.cmd =~/[MV]/ #check maintenance flag - texfiles=Dir["#{@env.path.processing_tex}/#{@opt.fns}*"] + texfiles=Dir["#{@env.processing_path.tex}/#{@opt.fns}*"] texfiles.each do |f| if FileTest.file?(f) File.unlink(f) @@ -206,8 +206,8 @@ module SiSU_TeX if @md.fns =~/\.(?:-|ssm\.)?sst$/ case @md.fns when /\.(?:-|ssm\.)?sst$/ - if FileTest.directory?(@env.path.processing_tex)==true - Dir.chdir(@env.path.processing_tex) + if FileTest.directory?(@env.processing_path.tex)==true + Dir.chdir(@env.processing_path.tex) texfile=@md.fns.gsub(/$/,".#{ps}.tex") texfile=texfile.gsub(/~/,'-') if File.exist?(texfile) \ @@ -216,7 +216,7 @@ module SiSU_TeX #p "#{__FILE__}:#{__LINE__} texpdf generation disabled" if @md.cmd.inspect =~/M/ #%% disable temporarily, re-enable latex_do(texfile,ps) else - puts "\tzero file size #{@env.path.processing_tex}/#{texfile}" + puts "\tzero file size #{@env.processing_path.tex}/#{texfile}" end end end @@ -265,12 +265,12 @@ module SiSU_TeX end class LaTeX_create @@tex_head={ - 'a4'=> {:p => nil, :l => nil}, - 'a5'=> {:p => nil, :l => nil}, - 'b5'=> {:p => nil, :l => nil}, - 'letter'=>{:p => nil, :l => nil}, - 'legal'=> {:p => nil, :l => nil}, - 'book'=> {:p => nil, :l => nil} + 'a4'=> { p: nil, l: nil }, + 'a5'=> { p: nil, l: nil }, + 'b5'=> { p: nil, l: nil }, + 'letter'=>{ p: nil, l: nil }, + 'legal'=> { p: nil, l: nil }, + 'book'=> { p: nil, l: nil } } @@prefix_b=nil def initialize(particulars) @@ -278,7 +278,7 @@ module SiSU_TeX @md=@particulars.md @env=SiSU_Env::Info_env.new(@md.fns) #@env=@particulars.env @data=@particulars.dal_array # dal file drawn here - @st={ :tex=>{} } + @st={ tex: {} } @tex_ml=SiSU_TeX_Pdf::Use_TeX.new(@md) @vz=SiSU_Env::Get_init.instance.skin @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern @@ -373,14 +373,14 @@ module SiSU_TeX @block={} @dob=dob @md.papersize_array.each do |ps| - @@tableheader={ ps => { :p => 0, :l => 0 }} - dob.tmp={:tmp =>dob.tmp,:paper_size =>ps} + @@tableheader={ ps => { p: 0, l: 0 } } + dob.tmp={ tmp: dob.tmp, paper_size: ps } format_l=SiSU_TeX_Pdf::Format_text_object.new(md,dob) - dob.tmp={:tmp =>dob.tmp,:paper_size =>ps} + dob.tmp={ tmp: dob.tmp, paper_size: ps } format_p=SiSU_TeX_Pdf::Format_text_object.new(md,dob) @block[ps]={ - :l => format_l.longtable_landscape, - :p => format_p.longtable_portrait + l: format_l.longtable_landscape, + p: format_p.longtable_portrait } end @dob.tmp=@block @@ -403,7 +403,7 @@ module SiSU_TeX end def markup_common(dob) tex_f=nil - txt_obj={:dal =>dob} + txt_obj={ dal: dob } if dob.of=='block' @lineone=case dob.is when /block|group|alt|verse/ @@ -499,7 +499,7 @@ module SiSU_TeX '\begin{multicols}{2}' + br + idx_str + br + '\end{multicols}' - dob.tmp={:l =>l,:p =>p} + dob.tmp={ l: l, p: p } elsif dob.ln==2 \ and dob.obj=~/Metadata\b/ tst.heading_major @@ -508,7 +508,7 @@ module SiSU_TeX h=tst.level4 metadata=Metadata::TeX_metadata.new(@md).metadata_tex dob.tmp=h.tmp + ' ' + '\begin{scriptsize}' + metadata.join(br) + '\end{scriptsize}' - else dob.tmp='' # dob.tmp={:l =>'',:p =>''} + else dob.tmp='' # dob.tmp={ l: '', p: '' } end when 'para' if dob.bullet_ @@ -557,9 +557,9 @@ module SiSU_TeX home=@vz.txt_home.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex title=@md.title.full.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex @md.papersize_array.each do |ps| - txt_obj={:txt =>"#{home}: - #{title}",:paper_size =>ps,:orientation =>'portrait'} + txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: 'portrait' } orient_portrait=SiSU_TeX_Pdf::Format_head.new(@md,txt_obj) - txt_obj={:txt =>"#{home}: - #{title}",:paper_size =>ps,:orientation =>'landscape'} + txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: 'landscape' } orient_landscape=SiSU_TeX_Pdf::Format_head.new(@md,txt_obj) @@tex_head[ps][:p]=orient_portrait.document_head_with_orientation @@tex_head[ps][:l]=orient_landscape.document_head_with_orientation @@ -587,7 +587,7 @@ WOK end @copymark='' #check and remove as now is superflous x={} - txt_obj={:title =>@md.title.full} + txt_obj={ title: @md.title.full } x[:l]=SiSU_TeX_Pdf::Format_text_object.new(@md,txt_obj).title_landscape x[:p]=SiSU_TeX_Pdf::Format_text_object.new(@md,txt_obj).title_portrait @tex_file << x @@ -653,8 +653,8 @@ WOK if dob.tmp[ps] if (dob.tmp[ps][:p] and dob.tmp[ps][:l]) dob.tmp[ps]={ - :p => markup_common(dob.tmp[ps][:p]), - :l => markup_common(dob.tmp[ps][:l]) + p: markup_common(dob.tmp[ps][:p]), + l: markup_common(dob.tmp[ps][:l]) } else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ end @@ -663,8 +663,8 @@ WOK elsif dob.tmp.class==Hash \ and (dob.tmp[:p] and dob.tmp[:l]) dob = { - :p => markup_common(dob.tmp[:p]), - :l => markup_common(dob.tmp[:l]) + p: markup_common(dob.tmp[:p]), + l: markup_common(dob.tmp[:l]) } else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ end @@ -721,8 +721,8 @@ WOK if defined? dob.tmp and dob.tmp[ps] if (dob.tmp[ps][:p] and dob.tmp[ps][:l]) para_hash[ps]={ - :p => number_paras_numbering(dob.tmp[ps][:p]), - :l => number_paras_numbering(dob.tmp[ps][:l]) + p: number_paras_numbering(dob.tmp[ps][:p]), + l: number_paras_numbering(dob.tmp[ps][:l]) } dob.tmp=para_hash else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ @@ -731,8 +731,8 @@ WOK end elsif (dob.tmp[:p] and dob.tmp[:l]) dob.tmp = { - :p => number_paras_numbering(dob.tmp[:p]), - :l => number_paras_numbering(dob.tmp[:l]) + p: number_paras_numbering(dob.tmp[:p]), + l: number_paras_numbering(dob.tmp[:l]) } else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ end @@ -780,8 +780,8 @@ WOK fns_l=@md.fns.gsub(/~/,'-') #this is a sorry fix, but necessary as it appears latex programs like not ~ @md.papersize_array.each do |ps| file={ - :landscape =>File.new("#{@env.path.processing_tex}/#{fns_l}.#{ps}.landscape.tex",'w+'), - :portrait =>File.new("#{@env.path.processing_tex}/#{fns_l}.#{ps}.tex",'w+') + landscape: File.new("#{@env.processing_path.tex}/#{fns_l}.#{ps}.landscape.tex",'w+'), + portrait: File.new("#{@env.processing_path.tex}/#{fns_l}.#{ps}.tex",'w+') } file[:portrait] << @@tex_head[ps][:p] file[:landscape] << @@tex_head[ps][:l] @@ -805,10 +805,10 @@ WOK file[:landscape].puts morph.tmp,"\n" end elsif morph.class==Hash #inserted headers and the like, only - h={:ps =>ps,:h =>morph,:filename =>file} + h={ ps: ps, h: morph, filename: file } output_morph_hash(h) elsif morph.tmp.class==Hash #tables & images? - h={:ps =>ps,:h =>morph.tmp,:filename =>file} + h={ ps: ps, h: morph.tmp, filename: file } output_morph_hash(h) end end @@ -817,12 +817,12 @@ WOK file[:landscape].close end @@tex_head={ - 'a4'=> {:p => nil, :l => nil}, - 'a5'=> {:p => nil, :l => nil}, - 'b5'=> {:p => nil, :l => nil}, - 'letter'=>{:p => nil, :l => nil}, - 'legal'=> {:p => nil, :l => nil}, - 'book'=> {:p => nil, :l => nil} + 'a4'=> { p: nil, l: nil }, + 'a5'=> { p: nil, l: nil }, + 'b5'=> { p: nil, l: nil }, + 'letter'=>{ p: nil, l: nil }, + 'legal'=> { p: nil, l: nil }, + 'book'=> { p: nil, l: nil } } array=[] end diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 7264f29b..a1fb3e72 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -79,16 +79,16 @@ module SiSU_TeX_Pdf end class Format_text_object require 'iconv' - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb attr_accessor :string,:string1,:orientation,:url,:dir,:tex @@sys=SiSU_Env::System_call.new @@tex_pattern_margin_number=/\\begin\{tiny\}\\hspace\{0mm\}\\end\{tiny\}\{\\marginpar.+?\}\}\}/ @@tableheader={ - 'a4' => { :p => 0, :l => 0 }, - 'a5' => { :p => 0, :l => 0 }, - 'b5' => { :p => 0, :l => 0 }, - 'letter' => { :p => 0, :l => 0 }, - 'legal' => { :p => 0, :l => 0 } + 'a4' => { p: 0, l: 0 }, + 'a5' => { p: 0, l: 0 }, + 'b5' => { p: 0, l: 0 }, + 'letter' => { p: 0, l: 0 }, + 'legal' => { p: 0, l: 0 } } @@sys=SiSU_Env::System_call.new def initialize(md,dob=nil) @@ -595,7 +595,7 @@ module SiSU_TeX_Pdf images_hash use_images_hash={} images_hash.each do |k,t| - use_images_hash[k]={ :l =>t, :p =>t} + use_images_hash[k]={ l: t, p: t} end dob.tmp=use_images_hash dob @@ -612,7 +612,7 @@ module SiSU_TeX_Pdf end end class Format_head - require "#{SiSU_lib}/i18n" # defaults.rb + require_relative 'i18n' # defaults.rb def initialize(md,t_o) @md,@t_o=md,t_o @env=SiSU_Env::Info_env.new(@md.fns) @@ -639,7 +639,7 @@ module SiSU_TeX_Pdf otherlang=[] lang_char_arr.slice(1..9).each { |ch| otherlang << @lang.tex_name(ch) } otherlang=otherlang.join(',') - { :mainlang=>mainlang, :otherlang=>otherlang } + { mainlang: mainlang, otherlang: otherlang } end def tex_head_encode texpdf_font=if defined? @md.make.texpdf_font \ diff --git a/lib/sisu/v3/update.rb b/lib/sisu/v3/update.rb index 8a65c99e..7c35a5aa 100644 --- a/lib/sisu/v3/update.rb +++ b/lib/sisu/v3/update.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Update_control_flag - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Param class Check diff --git a/lib/sisu/v3/urls.rb b/lib/sisu/v3/urls.rb index 5cc69e7b..127a17c2 100644 --- a/lib/sisu/v3/urls.rb +++ b/lib/sisu/v3/urls.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_urls - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen class Source attr_reader :opt @@ -140,7 +140,7 @@ module SiSU_urls if x =~/^m/ \ and @opt.cmd=~/m/ \ and x=~/^[#{opt.cmd}]/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.dal}/#{@opt.fns}.meta").maintenance if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.processing_path.dal}/#{@opt.fns}.meta").maintenance if @opt.cmd =~/[MVv]/ end if x=~/^([hHw])/ \ and @opt.cmd=~/[hHw]/ \ @@ -156,8 +156,8 @@ module SiSU_urls fns=@opt.fns.gsub(/~/,'-') unless @opt.cmd =~/q/ tell=if y =~/landscape/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.landscape.tex") - else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.tex") + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.processing_path.tex}/#{fns}.landscape.tex") + else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.processing_path.tex}/#{fns}.tex") end tell.maintenance if @opt.cmd =~/[MVv]/ end @@ -170,7 +170,7 @@ module SiSU_urls if x=~/^e/ \ and @opt.cmd=~/e/ \ and x=~/^[#{@opt.cmd}]/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.epub}/OPS/toc.xhtml").maintenance if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.processing_path.epub}/OPS/toc.xhtml").maintenance if @opt.cmd =~/[MVv]/ end if x !~/^[me]/ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{tool} #{@env.path.output}/#{@fnb}/#{y}").maintenance if @opt.cmd =~/[MVv]/ @@ -226,11 +226,11 @@ module SiSU_urls end if x=~/^I/ \ and @opt.cmd =~/I/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.processing_path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -").result end if x=~/^i/ \ and @opt.cmd =~/i/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_viewer} #{@env.path.manpage}/#{@fnb}.1").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_viewer} #{@env.processing_path.manpage}/#{@fnb}.1").result end if x=~/^N/ \ and @opt.cmd =~/N/ @@ -243,7 +243,7 @@ module SiSU_urls if x=~/^P/ \ and @opt.cmd =~/P/ if @opt.fns =~/\S+?~\S{2}(?:_\S{2})?\.ss[mt]/ - f=y.gsub(/\pot/,'po') + f=y.gsub(/\.pot$/,'.po') SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@md.file.output_path.po}/#{f}").result else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@md.file.output_path.pot}/#{y}").result @@ -318,9 +318,9 @@ module SiSU_urls when /^Y/ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/sitemap/#{y}") when /^I/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -") + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.processing_path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -") when /^i/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_viewer} #{@env.path.manpage}/#{@fnb}.1") + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_viewer} #{@env.processing_path.manpage}/#{@fnb}.1") end unless @opt.cmd =~/q/ tellx.result if tellx diff --git a/lib/sisu/v3/webrick.rb b/lib/sisu/v3/webrick.rb index ba324fff..55157c4f 100644 --- a/lib/sisu/v3/webrick.rb +++ b/lib/sisu/v3/webrick.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -64,15 +64,15 @@ def brick(port,get='') port=SiSU_Env::Info_port.new.webrick begin s=HTTPServer.new( - :Port => port, - :DocumentRoot => Dir::pwd + '/htdocs', - :CGIPathEnv => ENV['PATH'] + Port: port, + DocumentRoot: Dir::pwd + '/htdocs', + CGIPathEnv: ENV['PATH'] ) cgi_dir=File.expand_path(cgidir) @mount.each { |x,y| # mount subdirectories s.mount(x, HTTPServlet::FileHandler, y, true) } - s.mount('/cgi-bin', HTTPServlet::FileHandler, cgi_dir, {:FancyIndexing=>true}) + s.mount('/cgi-bin', HTTPServlet::FileHandler, cgi_dir, { FancyIndexing: true }) trap("INT"){ s.shutdown } s.start rescue; SiSU_Errors::Info_error.new($!,$@,'-W',nil).error #fix @@ -85,7 +85,7 @@ begin # require 'time' require 'fileutils' include FileUtils - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen @cX=SiSU_Screen::Ansi.new('yes').cX @env=SiSU_Env::Info_env.new @@ -169,7 +169,7 @@ WOK get=@argv.shift if @argv[0] =~/pwd/ #% argv brick(@port,get) rescue; - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb SiSU_Errors::Info_error.new($!,$@,'-W',nil).error #fix ensure end diff --git a/lib/sisu/v3/wikispeak.rb b/lib/sisu/v3/wikispeak.rb index 8e64b08e..72e2e2b0 100644 --- a/lib/sisu/v3/wikispeak.rb +++ b/lib/sisu/v3/wikispeak.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,14 +57,14 @@ =end module SiSU_Wikispeak - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'dal' # dal.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Param include SiSU_Viz - require "#{SiSU_lib}/plaintext_format" # plaintext_format.rb + require_relative 'plaintext_format' # plaintext_format.rb include Format - require "#{SiSU_lib}/shared_txt" + require_relative 'shared_txt' pwd=Dir.pwd @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' @@ -92,7 +92,7 @@ module SiSU_Wikispeak end private class Split_text_object <Source - require "#{SiSU_lib}/plaintext_format" # plaintext_format.rb + require_relative 'plaintext_format' # plaintext_format.rb include Format include SiSU_Viz @@alt_id_count=0 @@ -140,10 +140,10 @@ module SiSU_Wikispeak end end class Scroll <Source - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_txt' # shared_txt.rb include SiSU_text_utils @@endnotes_para=[] - @@wiki={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] } + @@wiki={ body: [], open: [], close: [], head: [], metadata: [], tail: [], endnotes: [] } @@dp=nil def initialize(data,md) @data,@md=data,md diff --git a/lib/sisu/v3/xhtml.rb b/lib/sisu/v3/xhtml.rb index b1855653..2b791a31 100644 --- a/lib/sisu/v3/xhtml.rb +++ b/lib/sisu/v3/xhtml.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,19 +57,19 @@ ** Notes: tidy -xml scroll.xhtml >> index.tidy =end module SiSU_XHTML - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/shared_xml" # shared_xml.rb + require_relative 'shared_xml' # shared_xml.rb include SiSU_XML_munge - require "#{SiSU_lib}/xml_format" # xml_format.rb + require_relative 'xml_format' # xml_format.rb include SiSU_XML_format - require "#{SiSU_lib}/rexml" # rexml.rb + require_relative 'rexml' # rexml.rb include SiSU_Rexml - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb + require_relative 'shared_metadata' # shared_metadata.rb @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0 @@tablefoot='' class Source @@ -115,11 +115,11 @@ module SiSU_XHTML end end class Scroll - require "#{SiSU_lib}/shared_xhtml" # shared_xhtml.rb #check already called - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_xhtml' # shared_xhtml.rb #check already called + require_relative 'shared_txt' # shared_txt.rb include SiSU_text_utils - require "#{SiSU_lib}/css" # css.rb - @@xml={ :body=>[],:sisu=>[],:open=>[],:close=>[],:head=>[] } + require_relative 'css' # css.rb + @@xml={ body: [], sisu: [], open: [], close: [], head: [] } def initialize(particulars) @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array @vz=SiSU_Env::Get_init.instance.skin @@ -328,7 +328,7 @@ WOK end if dob.obj =~/.*<:#>.*$/ #investigate removal dob.obj=if dob.obj =~ /#{Mx[:pa_o]}:i[1-9]#{Mx[:pa_c]}/ - txt_obj={:txt =>dob} + txt_obj={ txt: dob } format_text=Format_text_object.new(@md,txt_obj) format_text.scr_inden_ocn_e_no_paranum end diff --git a/lib/sisu/v3/xhtml_table.rb b/lib/sisu/v3/xhtml_table.rb index 6d8ef7a2..8aa0f753 100644 --- a/lib/sisu/v3/xhtml_table.rb +++ b/lib/sisu/v3/xhtml_table.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_XHTML_table - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb class Table_xhtml @@tablehead=0 @@tablefoot=[] #watch diff --git a/lib/sisu/v3/xml.rb b/lib/sisu/v3/xml.rb index a3767177..9b9bc3f5 100644 --- a/lib/sisu/v3/xml.rb +++ b/lib/sisu/v3/xml.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,19 +57,19 @@ =end module SiSU_XML_SAX - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/shared_xml" # shared_xml.rb + require_relative 'shared_xml' # shared_xml.rb include SiSU_XML_munge - require "#{SiSU_lib}/xml_format" # xml_format.rb + require_relative 'xml_format' # xml_format.rb include SiSU_XML_format - require "#{SiSU_lib}/rexml" # rexml.rb + require_relative 'rexml' # rexml.rb include SiSU_Rexml - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb + require_relative 'shared_metadata' # shared_metadata.rb @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0 @@tablefoot='' class Source @@ -115,11 +115,11 @@ module SiSU_XML_SAX end end class Scroll - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_txt' # shared_txt.rb include SiSU_text_utils - require "#{SiSU_lib}/css" # css.rb - require "#{SiSU_lib}/shared_xhtml" # decide use, whether xml rather than xhtml - @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] } + require_relative 'css' # css.rb + require_relative 'shared_xhtml' # decide use, whether xml rather than xhtml + @@xml={ body: [], open: [], close: [], head: [] } def initialize(particulars) @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array @vz=SiSU_Env::Get_init.instance.skin @@ -353,11 +353,11 @@ WOK end elsif dob.obj =~/(#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ elsif dob.obj =~/MetaData/ - txt_obj={:txt =>'<br /><a name="metadata">MetaData</a>'} + txt_obj={ txt: '<br /><a name="metadata">MetaData</a>' } format_scroll=Format_scroll.new(@md,txt_obj) dob.obj=format_scroll.bold_para elsif dob.obj =~/(Owner Details)/ -# txt_obj={:txt =>'<br /><a name="owner.details">Owner Details</a>'} +# txt_obj={ txt: '<br /><a name="owner.details">Owner Details</a>' } # format_scroll=Format_scroll.new(@md,txt_obj) # @@xml[:owner_details]=format_scroll.bold_para dob.obj='' @@ -368,7 +368,7 @@ WOK end if dob.obj =~/.*<:#>.*$/ #investigate removal dob.obj=if dob.obj =~ /#{Mx[:pa_o]}:i[1-9]#{Mx[:pa_c]}/ - txt_obj={:txt =>dob} + txt_obj={ txt: dob } format_text=Format_text_object.new(@md,txt_obj) format_text.scr_inden_ocn_e_no_paranum end diff --git a/lib/sisu/v3/xml_dom.rb b/lib/sisu/v3/xml_dom.rb index 726e48d5..02180617 100644 --- a/lib/sisu/v3/xml_dom.rb +++ b/lib/sisu/v3/xml_dom.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -54,20 +54,20 @@ ** Notes: tidy -xml dom.xml >> index.tidy =end module SiSU_XML_DOM - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/shared_xml" # shared_xml.rb + require_relative 'dal' # dal.rb + require_relative 'shared_xml' # shared_xml.rb include SiSU_XML_munge - require "#{SiSU_lib}/xml_format" # xml_format.rb + require_relative 'xml_format' # xml_format.rb include SiSU_XML_format - require "#{SiSU_lib}/rexml" # rexml.rb + require_relative 'rexml' # rexml.rb include SiSU_Rexml - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb + require_relative 'shared_metadata' # shared_metadata.rb @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0 @@tablefoot='' class Source @@ -112,10 +112,10 @@ module SiSU_XML_DOM end end class Scroll - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_txt' # shared_txt.rb include SiSU_text_utils - require "#{SiSU_lib}/shared_xhtml" # decide use, whether xml rather than xhtml - @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=>[] } + require_relative 'shared_xhtml' # decide use, whether xml rather than xhtml + @@xml={ body: [], open: [], close: [], head: [], sc: [] } def initialize(particulars) @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array @vz=SiSU_Env::Get_init.instance.skin @@ -423,7 +423,7 @@ WOK end elsif dob.obj =~/(#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ elsif dob.obj =~/(MetaData)/ - txt_obj={:txt =>'<br /><a name="metadata">MetaData</a>'} + txt_obj={ txt: '<br /><a name="metadata">MetaData</a>' } format_scroll=Format_scroll.new(@md,txt_obj) dob.obj=format_scroll.bold_para elsif dob.obj =~/(Owner Details)/ @@ -435,7 +435,7 @@ WOK end if dob.obj =~/.*<:#>.*$/ dob.obj=if dob.obj =~ /#{Mx[:pa_o]}:i[1-9]#{Mx[:pa_c]}/ - txt_obj={:txt =>dob.obj} + txt_obj={ txt: dob.obj } format_text=Format_text_object.new(@md,txt_obj) format_text.scr_inden_ocn_e_no_paranum end diff --git a/lib/sisu/v3/xml_fictionbook.rb b/lib/sisu/v3/xml_fictionbook.rb index 6463c0ec..09a9e5aa 100644 --- a/lib/sisu/v3/xml_fictionbook.rb +++ b/lib/sisu/v3/xml_fictionbook.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,12 +57,12 @@ =end module SiSU_XML_Fictionbook - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'dal' # dal.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/shared_txt" # shared_txt.rb + require_relative 'shared_txt' # shared_txt.rb include SiSU_text_utils - require "#{SiSU_lib}/shared_xml" # shared_xml.rb + require_relative 'shared_xml' # shared_xml.rb include SiSU_XML_munge include SiSU_Param pwd=Dir.pwd diff --git a/lib/sisu/v3/xml_format.rb b/lib/sisu/v3/xml_format.rb index 7771717f..dd41a094 100644 --- a/lib/sisu/v3/xml_format.rb +++ b/lib/sisu/v3/xml_format.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -58,7 +58,7 @@ =end module SiSU_XML_format - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param include SiSU_Viz class Paragraph_number diff --git a/lib/sisu/v3/xml_md_oai_pmh_dc.rb b/lib/sisu/v3/xml_md_oai_pmh_dc.rb index c885068f..392be4fd 100644 --- a/lib/sisu/v3/xml_md_oai_pmh_dc.rb +++ b/lib/sisu/v3/xml_md_oai_pmh_dc.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_XML_metadata - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env - require "#{SiSU_lib}/param" # param.rb + require_relative 'param' # param.rb include SiSU_Param class OAI_PMH def initialize(opt) diff --git a/lib/sisu/v3/xml_scaffold.rb b/lib/sisu/v3/xml_scaffold.rb index 621c3d5d..1e423bea 100644 --- a/lib/sisu/v3/xml_scaffold.rb +++ b/lib/sisu/v3/xml_scaffold.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,10 +57,10 @@ =end module SiSU_XML_scaffold - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'particulars' # particulars.rb include SiSU_Particulars - require "#{SiSU_lib}/dal" # dal.rb - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'dal' # dal.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env pwd=Dir.pwd class Source diff --git a/lib/sisu/v3/xml_tables.rb b/lib/sisu/v3/xml_tables.rb index 7e0fb51f..c762a282 100644 --- a/lib/sisu/v3/xml_tables.rb +++ b/lib/sisu/v3/xml_tables.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Tables - require "#{SiSU_lib}/defaults" # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz class Table #_xml @@tablehead=0 diff --git a/lib/sisu/v3/zap.rb b/lib/sisu/v3/zap.rb index 4c4b18bb..1cb176d0 100644 --- a/lib/sisu/v3/zap.rb +++ b/lib/sisu/v3/zap.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,7 +57,7 @@ =end module SiSU_Zap - require "#{SiSU_lib}/sysenv" # sysenv.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env pwd=Dir.pwd class Source |