diff options
| author | Ralph Amissah <ralph@amissah.com> | 2011-03-01 20:41:28 -0500 | 
|---|---|---|
| committer | Ralph Amissah <ralph@amissah.com> | 2011-03-01 20:41:28 -0500 | 
| commit | 05a3fd233ec1ac4475bd797449d1284f6824c005 (patch) | |
| tree | fdd93c057196640ec4907f58f66cf5bc00dfbdf6 /lib | |
| parent | v3: use rb1.9.2 "require_relative" syntax (diff) | |
v3: ruby 1.9 hash symbol syntax adopted
Diffstat (limited to 'lib')
41 files changed, 454 insertions, 455 deletions
| diff --git a/lib/sisu/v3/author_format.rb b/lib/sisu/v3/author_format.rb index 5406913f..847ea888 100644 --- a/lib/sisu/v3/author_format.rb +++ b/lib/sisu/v3/author_format.rb @@ -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_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb index 9e8cff4a..ed36553c 100644 --- a/lib/sisu/v3/cgi_pgsql.rb +++ b/lib/sisu/v3/cgi_pgsql.rb @@ -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) diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb index fd33b52a..0f0e5bb4 100644 --- a/lib/sisu/v3/cgi_sqlite.rb +++ b/lib/sisu/v3/cgi_sqlite.rb @@ -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) diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb index 664bfeb9..1f4d07a1 100644 --- a/lib/sisu/v3/composite.rb +++ b/lib/sisu/v3/composite.rb @@ -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/constants.rb b/lib/sisu/v3/constants.rb index 78441e0a..d94da654 100644 --- a/lib/sisu/v3/constants.rb +++ b/lib/sisu/v3/constants.rb @@ -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/dal.rb b/lib/sisu/v3/dal.rb index 0c9ff607..08557f2f 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -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 diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb index 8ed8bbda..365973eb 100644 --- a/lib/sisu/v3/dal_doc_str.rb +++ b/lib/sisu/v3/dal_doc_str.rb @@ -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_idx.rb b/lib/sisu/v3/dal_idx.rb index a965159d..dd2b1331 100644 --- a/lib/sisu/v3/dal_idx.rb +++ b/lib/sisu/v3/dal_idx.rb @@ -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_metadata.rb b/lib/sisu/v3/dal_metadata.rb index 1e394ab3..31a7e4b2 100644 --- a/lib/sisu/v3/dal_metadata.rb +++ b/lib/sisu/v3/dal_metadata.rb @@ -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 a4c04535..7a0c4365 100644 --- a/lib/sisu/v3/dal_numbering.rb +++ b/lib/sisu/v3/dal_numbering.rb @@ -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_syntax.rb b/lib/sisu/v3/dal_syntax.rb index 5ef5723f..2de931f6 100644 --- a/lib/sisu/v3/dal_syntax.rb +++ b/lib/sisu/v3/dal_syntax.rb @@ -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_import.rb b/lib/sisu/v3/db_import.rb index 2f0ae117..62873518 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -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/defaults.rb b/lib/sisu/v3/defaults.rb index 37793633..87e8c577 100644 --- a/lib/sisu/v3/defaults.rb +++ b/lib/sisu/v3/defaults.rb @@ -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/epub.rb b/lib/sisu/v3/epub.rb index 0465ff86..c39b7800 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -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 diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb index b6a84bd1..61e65544 100644 --- a/lib/sisu/v3/epub_segments.rb +++ b/lib/sisu/v3/epub_segments.rb @@ -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>' @@ -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/git.rb b/lib/sisu/v3/git.rb index 39914480..f5fae44b 100644 --- a/lib/sisu/v3/git.rb +++ b/lib/sisu/v3/git.rb @@ -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 @@ -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_authors.rb b/lib/sisu/v3/harvest_authors.rb index e463c632..dc36a06f 100644 --- a/lib/sisu/v3/harvest_authors.rb +++ b/lib/sisu/v3/harvest_authors.rb @@ -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 11644f68..f00fb7f3 100644 --- a/lib/sisu/v3/harvest_topics.rb +++ b/lib/sisu/v3/harvest_topics.rb @@ -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/html.rb b/lib/sisu/v3/html.rb index 7a1c90cb..2ee031a5 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -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_minitoc.rb b/lib/sisu/v3/html_minitoc.rb index dd3d760f..160881dd 100644 --- a/lib/sisu/v3/html_minitoc.rb +++ b/lib/sisu/v3/html_minitoc.rb @@ -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_scroll.rb b/lib/sisu/v3/html_scroll.rb index f2327150..a6a1a763 100644 --- a/lib/sisu/v3/html_scroll.rb +++ b/lib/sisu/v3/html_scroll.rb @@ -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 263d7399..5fcb6cf0 100644 --- a/lib/sisu/v3/html_segments.rb +++ b/lib/sisu/v3/html_segments.rb @@ -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/manifest.rb b/lib/sisu/v3/manifest.rb index 79e3eb8a..c496c8a6 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -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 5c6bfd99..3810a969 100644 --- a/lib/sisu/v3/manpage.rb +++ b/lib/sisu/v3/manpage.rb @@ -100,7 +100,7 @@ module SiSU_Manpage        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/odf.rb b/lib/sisu/v3/odf.rb index 7ed00e21..f5a11bea 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -72,7 +72,7 @@ module SiSU_ODF      require 'zlib'      require 'find'      require 'fileutils' -    include FileUtils +      include FileUtils      def initialize(opt)        @opt=opt        @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) @@ -104,7 +104,7 @@ module SiSU_ODF        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) diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb index ebb39774..a79b08f3 100644 --- a/lib/sisu/v3/options.rb +++ b/lib/sisu/v3/options.rb @@ -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 5d4c3daa..67716685 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -67,7 +67,7 @@ module SiSU_Param    @@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={},{} @@ -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 @@ -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]}" @@ -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/plaintext.rb b/lib/sisu/v3/plaintext.rb index 8ed1c3cd..8ff64b30 100644 --- a/lib/sisu/v3/plaintext.rb +++ b/lib/sisu/v3/plaintext.rb @@ -112,7 +112,7 @@ module SiSU_Plaintext        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/po4a.rb b/lib/sisu/v3/po4a.rb index 9ac98f00..ba892634 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -163,7 +163,7 @@ module SiSU_po4a        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 diff --git a/lib/sisu/v3/shared_html_lite.rb b/lib/sisu/v3/shared_html_lite.rb index 09d27a45..fca0cfb8 100644 --- a/lib/sisu/v3/shared_html_lite.rb +++ b/lib/sisu/v3/shared_html_lite.rb @@ -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 55f2065d..738ec75a 100644 --- a/lib/sisu/v3/shared_markup_alt.rb +++ b/lib/sisu/v3/shared_markup_alt.rb @@ -4,7 +4,6 @@   * 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_xml.rb b/lib/sisu/v3/shared_xml.rb index 1d06b72e..06b89395 100644 --- a/lib/sisu/v3/shared_xml.rb +++ b/lib/sisu/v3/shared_xml.rb @@ -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 diff --git a/lib/sisu/v3/sst_to_s_xml_sax.rb b/lib/sisu/v3/sst_to_s_xml_sax.rb index ee38d9a7..e698a8f9 100644 --- a/lib/sisu/v3/sst_to_s_xml_sax.rb +++ b/lib/sisu/v3/sst_to_s_xml_sax.rb @@ -131,7 +131,7 @@ module SiSU_simple_xml_model_sax        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 ba401cfa..dc042aad 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -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 @@ -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'] \ diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 0843f22f..31300f8f 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -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.path.processing_tex}/#{fns_l}.#{ps}.landscape.tex",'w+'), +            portrait: File.new("#{@env.path.processing_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 d2afa5bd..a1fb3e72 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -84,11 +84,11 @@ module SiSU_TeX_Pdf      @@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 @@ -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/webrick.rb b/lib/sisu/v3/webrick.rb index fbe5bda3..55157c4f 100644 --- a/lib/sisu/v3/webrick.rb +++ b/lib/sisu/v3/webrick.rb @@ -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 diff --git a/lib/sisu/v3/wikispeak.rb b/lib/sisu/v3/wikispeak.rb index 33cf65bc..72e2e2b0 100644 --- a/lib/sisu/v3/wikispeak.rb +++ b/lib/sisu/v3/wikispeak.rb @@ -143,7 +143,7 @@ module SiSU_Wikispeak        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 ab1156e1..2b791a31 100644 --- a/lib/sisu/v3/xhtml.rb +++ b/lib/sisu/v3/xhtml.rb @@ -119,7 +119,7 @@ module SiSU_XHTML        require_relative 'shared_txt'                     # shared_txt.rb          include SiSU_text_utils        require_relative 'css'                            # css.rb -      @@xml={ :body=>[],:sisu=>[],:open=>[],:close=>[],:head=>[] } +      @@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/xml.rb b/lib/sisu/v3/xml.rb index e5cc9374..9b9bc3f5 100644 --- a/lib/sisu/v3/xml.rb +++ b/lib/sisu/v3/xml.rb @@ -119,7 +119,7 @@ module SiSU_XML_SAX          include SiSU_text_utils        require_relative 'css'                            # css.rb        require_relative 'shared_xhtml'                   # decide use, whether xml rather than xhtml -      @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] } +      @@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 ea792b04..02180617 100644 --- a/lib/sisu/v3/xml_dom.rb +++ b/lib/sisu/v3/xml_dom.rb @@ -115,7 +115,7 @@ module SiSU_XML_DOM        require_relative 'shared_txt'                     # shared_txt.rb          include SiSU_text_utils        require_relative 'shared_xhtml'                   # decide use, whether xml rather than xhtml -      @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=>[] } +      @@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 | 
