diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-02-05 18:38:18 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-02-05 18:38:18 -0500 |
commit | 9f8f2879231f7ffa5fa1906babd31ea6af88331a (patch) | |
tree | f819b41031608703385f02d1532598ee40dcb477 /lib/sisu/v5 | |
parent | debian/changelog (5.3.1-1) (diff) | |
parent | manual Rakefile, README & minor config adjustment (diff) |
Merge tag 'sisu_5.3.2' into debian/sid
SiSU 5.3.2
Diffstat (limited to 'lib/sisu/v5')
-rw-r--r-- | lib/sisu/v5/ao_idx.rb | 17 | ||||
-rw-r--r-- | lib/sisu/v5/ao_images.rb | 12 | ||||
-rw-r--r-- | lib/sisu/v5/sysenv.rb | 5 | ||||
-rw-r--r-- | lib/sisu/v5/utils.rb | 46 |
4 files changed, 54 insertions, 26 deletions
diff --git a/lib/sisu/v5/ao_idx.rb b/lib/sisu/v5/ao_idx.rb index aa5f6609..43d5aeda 100644 --- a/lib/sisu/v5/ao_idx.rb +++ b/lib/sisu/v5/ao_idx.rb @@ -67,6 +67,7 @@ module SiSU_AO_BookIndex @rgx_idx=/#{Mx[:idx_o]}(?:.+?)#{Mx[:idx_c]}\s*/ @rgx_idx_ocn_seg=/(.+?)~(\d+)~(\S+)/ @rgx_idx_ocn=/(.+?)~(\d+)/ + @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier @env ||=SiSU_Env::InfoEnv.new(@md.fns) end def indexing_song @@ -199,15 +200,15 @@ module SiSU_AO_BookIndex if x['node_0_terms'].is_a?(Array) x['node_0_terms'].each do |a| if a[:range] - idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}/#{a[:seg]}.html##{a[:ocn]}#{Mx[:rel_c]}, } + idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}/#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}#{Mx[:rel_c]}, } idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:ocn]}#{Mx[:rel_c]}, } - idx[:html][@q]=idx[:html][@q] + %{<a href="#{a[:seg]}.html##{a[:ocn]}">#{a[:range]}</a>, } + idx[:html][@q]=idx[:html][@q] + %{<a href="#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}">#{a[:range]}</a>, } idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{a[:seg]}.xhtml#o#{a[:ocn]}">#{a[:range]}</a>, } print a[:range] + ', ' if @md.opt.act[:verbose_plus][:set]==:on elsif a[:ocn] - idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:seg]}.html##{a[:ocn]}#{Mx[:rel_c]}, } + idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}#{Mx[:rel_c]}, } idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:ocn]}#{Mx[:rel_c]}, } - idx[:html][@q]=idx[:html][@q] + %{<a href="#{a[:seg]}.html##{a[:ocn]}">#{a[:ocn]}</a>, } + idx[:html][@q]=idx[:html][@q] + %{<a href="#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}">#{a[:ocn]}</a>, } idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{a[:seg]}.xhtml#o#{a[:ocn]}">#{a[:ocn]}</a>, } print a[:ocn] + ', ' if @md.opt.act[:verbose_plus][:set]==:on else p 'error' @@ -227,15 +228,15 @@ module SiSU_AO_BookIndex print "\n\t" + k + ', ' if @md.opt.act[:verbose_plus][:set]==:on y.each do |z| if z[:range] - idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{z[:ocn]}#{Mx[:rel_c]}, } + idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}#{Mx[:rel_c]}, } idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:ocn]}#{Mx[:rel_c]}, } - idx[:html][@q]=idx[:html][@q] + %{<a href="#{z[:seg]}.html##{z[:ocn]}">#{z[:range]}</a>, } + idx[:html][@q]=idx[:html][@q] + %{<a href="#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}">#{z[:range]}</a>, } idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{z[:seg]}.xhtml#o#{z[:ocn]}">#{z[:range]}</a>, } print z[:range] + ', ' if @md.opt.act[:verbose_plus][:set]==:on elsif z[:ocn] - idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{z[:ocn]}#{Mx[:rel_c]}, } + idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}#{Mx[:rel_c]}, } idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:ocn]}#{Mx[:rel_c]}, } - idx[:html][@q]=idx[:html][@q] + %{<a href="#{z[:seg]}.html##{z[:ocn]}">#{z[:ocn]}</a>, } + idx[:html][@q]=idx[:html][@q] + %{<a href="#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}">#{z[:ocn]}</a>, } idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{z[:seg]}.xhtml#o#{z[:ocn]}">#{z[:ocn]}</a>, } print z[:ocn] + ', ' if @md.opt.act[:verbose_plus][:set]==:on else p 'error' diff --git a/lib/sisu/v5/ao_images.rb b/lib/sisu/v5/ao_images.rb index d01c98b8..b72f66a3 100644 --- a/lib/sisu/v5/ao_images.rb +++ b/lib/sisu/v5/ao_images.rb @@ -62,12 +62,12 @@ =end module SiSU_AO_Images class Images - #begin - # require 'RMagick' - # include Magick - #rescue LoadError - # SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('RMagic NOT FOUND (LoadError)') - #end + begin + require 'RMagick' + include Magick + rescue LoadError + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('RMagic NOT FOUND') + end def initialize(md,data) @md,@data=md,data end diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index f2b5bd27..537e52ca 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -5201,7 +5201,10 @@ WOK fh=default_hash_build(fh,Sfx[:html]) fh[:lng]=lang_code?(fh[:lng]) fnh=if output_dir_structure.dump_or_redirect? - @md.fnb + '.concordance' + ft + { + fn: 'concordance', + ft: fh[:ft], + } else { fn: 'concordance', diff --git a/lib/sisu/v5/utils.rb b/lib/sisu/v5/utils.rb index 1c04d886..4894df9d 100644 --- a/lib/sisu/v5/utils.rb +++ b/lib/sisu/v5/utils.rb @@ -95,23 +95,29 @@ module SiSU_Utils end def var(v,x) h={ c: nil, m: '' } - if v.class == Hash + if v.is_a?(Hash) h[:c] = (defined? v[:c]) ? v[:c] : '' h[:m] = (defined? v[:m]) ? v[:m] : '' - else - if v.class == Symbol + elsif (v.is_a?(Symbol) \ + and x.is_a?(String)) + if v.is_a?(Symbol) h[:c]=v - elsif v.class == String + elsif v.is_a?(String) h[:m]=v end - if x.class == Symbol - h[:c]=x - elsif x.class == String + if x.is_a?(String) h[:m]=x end - h[:c] = (defined? h[:c]) ? h[:c] : '' - h[:m] = (defined? h[:m]) ? h[:m] : '' + elsif (v.is_a?(Symbol) \ + or v.is_a?(String)) + if v.is_a?(Symbol) + h[:c]=v + elsif v.is_a?(String) + h[:m]=v + end end + h[:c] = (defined? h[:c]) ? h[:c] : '' + h[:m] = (defined? h[:m]) ? h[:m] : '' h[:c]=ansi(h[:c]) h[:m]=message(h[:m]) h @@ -128,10 +134,28 @@ module SiSU_Utils puts set(v,x) end def warn(v=nil,x=nil) - STDERR.puts set(v,'*WARN* ' + x) + if (v.is_a?(Symbol) \ + and x.is_a?(String)) + x= '*WARN* ' + x + elsif v.is_a?(String) + v='*WARN* ' + v + x=nil + else + v,x='*WARN*',nil + end + STDERR.puts set(v,x) end def error(v=nil,x=nil) - STDERR.puts set(v,'*ERROR* ' + x) + if (v.is_a?(Symbol) \ + and x.is_a?(String)) + x= '*ERROR* ' + x + elsif v.is_a?(String) + v='*ERROR* ' + v + x=nil + else + v,x='*ERROR*',nil + end + STDERR.puts set(v,x) end end class Path |