From 967a86f0fa0c96f5816dc14e3f5208b9fb21944a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 29 Aug 2014 19:31:58 -0400 Subject: v5 v6: cosmetic code --- lib/sisu/v5/se_programs.rb | 6 ++++-- lib/sisu/v5/sitemaps.rb | 6 ++++-- lib/sisu/v5/sst_to_s_xml_sax.rb | 4 ++-- lib/sisu/v5/xhtml.rb | 4 +++- lib/sisu/v5/xml_dom.rb | 4 ++-- lib/sisu/v5/xml_sax.rb | 4 ++-- lib/sisu/v6/se_programs.rb | 6 ++++-- lib/sisu/v6/sitemaps.rb | 6 ++++-- lib/sisu/v6/sst_to_s_xml_sax.rb | 4 ++-- lib/sisu/v6/xhtml.rb | 4 +++- lib/sisu/v6/xml_dom.rb | 4 ++-- lib/sisu/v6/xml_sax.rb | 4 ++-- 12 files changed, 34 insertions(+), 22 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v5/se_programs.rb b/lib/sisu/v5/se_programs.rb index 4eef1ce9..66d61036 100644 --- a/lib/sisu/v5/se_programs.rb +++ b/lib/sisu/v5/se_programs.rb @@ -113,8 +113,10 @@ module SiSU_Sys_Call and locale !~/utf-?8/i true else - program_ref="(not available)" unless program_found?(program) - program_ref="(UTF-8)" if locale =~/utf-?8/i + program_ref="(not available)" \ + unless program_found?(program) + program_ref="(UTF-8)" \ + if locale =~/utf-?8/i false end end diff --git a/lib/sisu/v5/sitemaps.rb b/lib/sisu/v5/sitemaps.rb index fd2d58c6..d04dd382 100644 --- a/lib/sisu/v5/sitemaps.rb +++ b/lib/sisu/v5/sitemaps.rb @@ -86,7 +86,8 @@ module SiSU_Sitemaps # @file=SiSU_Env::FileOp.new(@md) @rdf=SiSU_XML_Tags::RDF.new(@md) @fnb_utf8_xml=@md.fnb.dup - @trans.char_enc.utf8(@fnb_utf8_xml) if @sys.locale =~/utf-?8/i #% utf8 + @trans.char_enc.utf8(@fnb_utf8_xml) \ + if @sys.locale =~/utf-?8/i output_map(sitemap) elsif @opt.selections.str =~/--sitemaps/ @sitemap_idx_fn='sitemapindex.xml' @@ -144,7 +145,8 @@ module SiSU_Sitemaps WOK sitemap_files.each do |s| f=s.gsub(/.+?\/sitemap_([^\/]+?)\.xml$/,'\1') - @trans.char_enc.utf8(f) if @sys.locale =~/utf-?8/i #% utf8 + @trans.char_enc.utf8(f) \ + if @sys.locale =~/utf-?8/i sitemap_idx << < #{@env.path.url.remote}/#{f}/sitemap.xml diff --git a/lib/sisu/v5/sst_to_s_xml_sax.rb b/lib/sisu/v5/sst_to_s_xml_sax.rb index fe685983..b72868a1 100644 --- a/lib/sisu/v5/sst_to_s_xml_sax.rb +++ b/lib/sisu/v5/sst_to_s_xml_sax.rb @@ -395,8 +395,8 @@ WOK dir=SiSU_Env::InfoEnv.new @@xml[:head],@@xml[:body]=[],[] css=SiSU_Env::CSS_Select.new(@md).xml_sax - encoding=if @sys.locale =~/utf-?8/i; '' - else '' + encoding=if @sys.locale =~/utf-?8/i then '' + else '' end @@xml[:open] =<' : '' + encoding=(@sys.locale =~/utf-?8/i) \ + ? '' + : '' @@xml[:open] =<' - else '' + encoding=if @sys.locale =~/utf-?8/i then '' + else '' end @@xml[:open] =<' - else '' + encoding=if @sys.locale =~/utf-?8/i then '' + else '' end @@xml[:open] =< #{@env.path.url.remote}/#{f}/sitemap.xml diff --git a/lib/sisu/v6/sst_to_s_xml_sax.rb b/lib/sisu/v6/sst_to_s_xml_sax.rb index 0be6ffa0..a780e810 100644 --- a/lib/sisu/v6/sst_to_s_xml_sax.rb +++ b/lib/sisu/v6/sst_to_s_xml_sax.rb @@ -395,8 +395,8 @@ WOK dir=SiSU_Env::InfoEnv.new @@xml[:head],@@xml[:body]=[],[] css=SiSU_Env::CSS_Select.new(@md).xml_sax - encoding=if @sys.locale =~/utf-?8/i; '' - else '' + encoding=if @sys.locale =~/utf-?8/i then '' + else '' end @@xml[:open] =<' : '' + encoding=(@sys.locale =~/utf-?8/i) \ + ? '' + : '' @@xml[:open] =<' - else '' + encoding=if @sys.locale =~/utf-?8/i then '' + else '' end @@xml[:open] =<' - else '' + encoding=if @sys.locale =~/utf-?8/i then '' + else '' end @@xml[:open] =<