From d2fa6daa3f2ecbafd2dda8d6da895ef69575e3b3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 14 Feb 2013 18:39:16 -0500 Subject: v4 (v3): cosmetic, minor code shuffle, & remove trailing white-spaces --- lib/sisu/v3/epub_format.rb | 6 +++--- lib/sisu/v4/constants.rb | 1 + lib/sisu/v4/epub_format.rb | 3 +-- lib/sisu/v4/html.rb | 12 ++++++------ lib/sisu/v4/html_format.rb | 8 +++----- lib/sisu/v4/hub.rb | 2 +- lib/sisu/v4/manifest.rb | 14 +++++++------- lib/sisu/v4/urls.rb | 4 ++-- 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 61accf22..228c2df4 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1402,7 +1402,7 @@ output_epub_cont_seg.close end def navpoint(dob,no,name=nil) name=name ? name : dob.name - cont_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) + cont_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' : "-#{no}" @@ -1597,7 +1597,7 @@ output_epub_cont_seg.close end def manifest_content(dob,name=nil) name=name ? name : dob.name - href_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) + href_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK WOK @@ -1654,7 +1654,7 @@ output_epub_cont_seg.close end def guide(dob,name=nil) name=name ? name : dob.name - guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) + guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK WOK diff --git a/lib/sisu/v4/constants.rb b/lib/sisu/v4/constants.rb index 7ad3516b..505fdc02 100644 --- a/lib/sisu/v4/constants.rb +++ b/lib/sisu/v4/constants.rb @@ -295,6 +295,7 @@ DEVELOPER={ __END__ puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:red).set puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:green) +puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__ puts "#{ANSI_C[:red]} #{__LINE__.to_s} #{ANSI_C[:off]} #{__FILE__}" puts ANSI_C[:fuchsia] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:fuchsia]}\\1#{ANSI_C[:off]}") diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb index 48408162..a56ea394 100644 --- a/lib/sisu/v4/epub_format.rb +++ b/lib/sisu/v4/epub_format.rb @@ -65,7 +65,6 @@ module SiSU_EPUB_Format def initialize(md,ocn) @md,@ocn=md,ocn.to_s @ocn ||='' - vz=SiSU_Viz::Defaults.new end def ocn_display make=SiSU_Env::ProcessingSettings.new(@md) @@ -1687,7 +1686,7 @@ output_epub_cont_seg.close fn=fn_base + Sfx[:epub_xhtml] name=hashtag ? fn + hashtag : fn name=name ? name : dob.name - guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) + guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK WOK diff --git a/lib/sisu/v4/html.rb b/lib/sisu/v4/html.rb index 94b20afe..9b73823b 100644 --- a/lib/sisu/v4/html.rb +++ b/lib/sisu/v4/html.rb @@ -108,18 +108,18 @@ module SiSU_HTML data=nil tuned_file_array=SiSU_HTML::Source::HTML_Environment.new(@particulars).tuned_file_instructions data=tuned_file_array - if @opt.act[:html_scroll][:set]==:on + if @opt.act[:html_scroll][:set]==:on scr_endnotes=SiSU_HTML::Source::Endnotes.new(data,@md).scroll end toc=SiSU_HTML::Source::Toc.new(@md,data).songsheet links_guide=SiSU_HTML::Source::LinksGuide.new(data,@md).toc data=tuned_file_array scr_toc=SiSU_HTML::Source::ScrollHeadAndSegToc.new(@md,toc,links_guide).in_common #watch - if @opt.act[:html_seg][:set]==:on + if @opt.act[:html_seg][:set]==:on SiSU_HTML::Source::Seg.new(@md,data).songsheet end data=tuned_file_array - if @opt.act[:html_scroll][:set]==:on + if @opt.act[:html_scroll][:set]==:on scr=SiSU_HTML::Source::Scroll.new(@md,data,scr_endnotes).songsheet scroll=SiSU_HTML::Source::ScrollOutput.new(scr_toc,scr[:body],scr[:metadata],scr[:owner_details],scr[:tails],@md).publish SiSU_HTML::Source::Output.new(scroll,@md).scroll @@ -602,7 +602,7 @@ WOK ads=SiSU_HTML_Promo::Ad.new(@md) @segtoc << format_head_toc.seg_navigation_tail << ads.div.close << ads.display << format_head_toc.html_close @segtoc=@segtoc.flatten.compact #watch - if @md.opt.act[:html_seg][:set]==:on + if @md.opt.act[:html_seg][:set]==:on SiSU_HTML::Source::Output.new(@segtoc,@md).segtoc end @segtoc=[] @@ -633,7 +633,7 @@ WOK @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure end def scroll - if @md.opt.act[:html_scroll][:set]==:on + if @md.opt.act[:html_scroll][:set]==:on begin @filename_html_scroll=@file.write_file.html_scroll @data.each do |para| @@ -657,7 +657,7 @@ WOK end end def segtoc - if @md.opt.act[:html_seg][:set]==:on + if @md.opt.act[:html_seg][:set]==:on begin @filename_html_segtoc=@file.write_file.html_segtoc @data.each do |para| diff --git a/lib/sisu/v4/html_format.rb b/lib/sisu/v4/html_format.rb index 7fcf89a0..25a8dbee 100644 --- a/lib/sisu/v4/html_format.rb +++ b/lib/sisu/v4/html_format.rb @@ -67,8 +67,8 @@ module SiSU_HTML_Format @ocn ||='' end def ocn_display - @make=SiSU_Env::ProcessingSettings.new(@md) - if @make.build.ocn? + make=SiSU_Env::ProcessingSettings.new(@md) + if make.build.ocn? ocn_class='ocn' if @ocn.to_i==0 @ocn.gsub(/^(\d+|)$/, @@ -104,11 +104,10 @@ module SiSU_HTML_Format @vz=SiSU_Viz::Defaults.new @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || []) @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) - @metalink='#metadata' @tocband_scroll,@tocband_segtoc=nil,nil @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure - @index='index' + @index,@metalink='index','#metadata' @toc="#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}" end def url_path_image_sys @@ -1235,7 +1234,6 @@ WOK def clean(txt) txt=txt.gsub(/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}/,''). gsub(/#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/,'') - txt end def subtoc_lev(tag,attrib) @txt=clean(@txt) diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb index d55a5f17..e02fa940 100644 --- a/lib/sisu/v4/hub.rb +++ b/lib/sisu/v4/hub.rb @@ -673,7 +673,7 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on or @opt.act[:scp][:set]==:on \ or @opt.act[:webrick][:set]==:on \ or @opt.act[:zap][:set]==:on \ - or ( + or ( @opt.cmd =~/^-/ \ and @opt.cmd =~/([abCcDdeFGgHhIjikLMmNnoPpQqRrSsTtUuVvWwXxYyZ_0-9])/ \ and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb index c5a841a1..d7c4d33a 100644 --- a/lib/sisu/v4/manifest.rb +++ b/lib/sisu/v4/manifest.rb @@ -511,14 +511,14 @@ WOK end end def metadata_tests - if defined? @md.title #% + if defined? @md.title #% if defined? @md.title.full \ and @md.title.full=~/\S+/ id,info=@translate.full_title,@md.title.full metadata(id,info) end end - if defined? @md.creator #% + if defined? @md.creator #% if defined? @md.creator.author \ and @md.creator.author=~/\S+/ id,info=@translate.author,@md.creator.author @@ -562,7 +562,7 @@ WOK metadata(id,info) end end - if defined? @md.date #% + if defined? @md.date #% if defined? @md.date.published \ and @md.date.published=~/\S+/ #dc id,info=@translate.date,@md.date.published @@ -599,7 +599,7 @@ WOK id,info=@translate.publisher,@md.publisher metadata(id,info) end - if defined? @md.notes #% + if defined? @md.notes #% if defined? @md.notes.description \ and @md.notes.description=~/\S+/ id,info=@translate.description,@md.notes.description @@ -626,7 +626,7 @@ WOK metadata(id,info) end end - if defined? @md.title #% + if defined? @md.title #% if defined? @md.title.language \ and @md.title.language=~/\S+/ id,info=@translate.language,@md.title.language @@ -638,7 +638,7 @@ WOK metadata(id,info) end end - if defined? @md.classify #% + if defined? @md.classify #% if defined? @md.topic_register_array \ and @md.topic_register_array.length > 0 @manifest[:html] << %{

#{@translate.topic_register}:

\n} @@ -701,7 +701,7 @@ WOK metadata(id,info) end end - if defined? @md.identifier #% + if defined? @md.identifier #% if defined? @md.identifier.oclc \ and @md.identifier.oclc=~/\S+/ id,info=@translate.cls_oclc,@md.identifier.oclc diff --git a/lib/sisu/v4/urls.rb b/lib/sisu/v4/urls.rb index ad7ab480..e5341581 100644 --- a/lib/sisu/v4/urls.rb +++ b/lib/sisu/v4/urls.rb @@ -324,11 +324,11 @@ module SiSU_Urls or @opt.act[:html_scroll][:set]==:on \ or @opt.act[:html_seg][:set]==:on) if x =~/scroll/ - if @opt.act[:html_scroll][:set]==:on + if @opt.act[:html_scroll][:set]==:on show.html.scroll(x) end else - if @opt.act[:html_seg][:set]==:on + if @opt.act[:html_seg][:set]==:on show.html.toc(x) end end -- cgit v1.2.3