summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-08-29 23:31:58 +0000
committerRalph Amissah <ralph@amissah.com>2014-08-29 23:44:07 +0000
commit967a86f0fa0c96f5816dc14e3f5208b9fb21944a (patch)
tree547d8689642491c88eac097962b775074f8bdbe7
parentsisurc, minor (diff)
downloadsisu-967a86f0fa0c96f5816dc14e3f5208b9fb21944a.zip
sisu-967a86f0fa0c96f5816dc14e3f5208b9fb21944a.tar.xz
v5 v6: cosmetic code
-rw-r--r--lib/sisu/v5/se_programs.rb6
-rw-r--r--lib/sisu/v5/sitemaps.rb6
-rw-r--r--lib/sisu/v5/sst_to_s_xml_sax.rb4
-rw-r--r--lib/sisu/v5/xhtml.rb4
-rw-r--r--lib/sisu/v5/xml_dom.rb4
-rw-r--r--lib/sisu/v5/xml_sax.rb4
-rw-r--r--lib/sisu/v6/se_programs.rb6
-rw-r--r--lib/sisu/v6/sitemaps.rb6
-rw-r--r--lib/sisu/v6/sst_to_s_xml_sax.rb4
-rw-r--r--lib/sisu/v6/xhtml.rb4
-rw-r--r--lib/sisu/v6/xml_dom.rb4
-rw-r--r--lib/sisu/v6/xml_sax.rb4
12 files changed, 34 insertions, 22 deletions
diff --git a/lib/sisu/v5/se_programs.rb b/lib/sisu/v5/se_programs.rb
index 4eef1ce..66d6103 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 fd2d58c..d04dd38 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 << <<WOK
<sitemap>
<loc>#{@env.path.url.remote}/#{f}/sitemap.xml</loc>
diff --git a/lib/sisu/v5/sst_to_s_xml_sax.rb b/lib/sisu/v5/sst_to_s_xml_sax.rb
index fe68598..b72868a 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; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v5/xhtml.rb b/lib/sisu/v5/xhtml.rb
index 14c6bfe..138ccf6 100644
--- a/lib/sisu/v5/xhtml.rb
+++ b/lib/sisu/v5/xhtml.rb
@@ -392,7 +392,9 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xhtml').stylesheet
- encoding=(@sys.locale =~/utf-?8/i) ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=(@sys.locale =~/utf-?8/i) \
+ ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
@@xml[:open] =<<WOK
#{encoding}
#{stylesheet.css_head_xml}
diff --git a/lib/sisu/v5/xml_dom.rb b/lib/sisu/v5/xml_dom.rb
index fb7d3cb..b78fb67 100644
--- a/lib/sisu/v5/xml_dom.rb
+++ b/lib/sisu/v5/xml_dom.rb
@@ -534,8 +534,8 @@ WOK
def pre
rdf=SiSU_XML_Tags::RDF.new(@md)
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_dom').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v5/xml_sax.rb b/lib/sisu/v5/xml_sax.rb
index 69dc39a..ea3f717 100644
--- a/lib/sisu/v5/xml_sax.rb
+++ b/lib/sisu/v5/xml_sax.rb
@@ -430,8 +430,8 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_sax').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v6/se_programs.rb b/lib/sisu/v6/se_programs.rb
index 448ac98..646878d 100644
--- a/lib/sisu/v6/se_programs.rb
+++ b/lib/sisu/v6/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/v6/sitemaps.rb b/lib/sisu/v6/sitemaps.rb
index 1b2cabe..ad9e595 100644
--- a/lib/sisu/v6/sitemaps.rb
+++ b/lib/sisu/v6/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 << <<WOK
<sitemap>
<loc>#{@env.path.url.remote}/#{f}/sitemap.xml</loc>
diff --git a/lib/sisu/v6/sst_to_s_xml_sax.rb b/lib/sisu/v6/sst_to_s_xml_sax.rb
index 0be6ffa..a780e81 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; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v6/xhtml.rb b/lib/sisu/v6/xhtml.rb
index 409a2b6..17f3a33 100644
--- a/lib/sisu/v6/xhtml.rb
+++ b/lib/sisu/v6/xhtml.rb
@@ -392,7 +392,9 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xhtml').stylesheet
- encoding=(@sys.locale =~/utf-?8/i) ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=(@sys.locale =~/utf-?8/i) \
+ ? '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ : '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
@@xml[:open] =<<WOK
#{encoding}
#{stylesheet.css_head_xml}
diff --git a/lib/sisu/v6/xml_dom.rb b/lib/sisu/v6/xml_dom.rb
index 1285a1c..6014119 100644
--- a/lib/sisu/v6/xml_dom.rb
+++ b/lib/sisu/v6/xml_dom.rb
@@ -534,8 +534,8 @@ WOK
def pre
rdf=SiSU_XML_Tags::RDF.new(@md)
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_dom').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}
diff --git a/lib/sisu/v6/xml_sax.rb b/lib/sisu/v6/xml_sax.rb
index d595e4a..9555d2d 100644
--- a/lib/sisu/v6/xml_sax.rb
+++ b/lib/sisu/v6/xml_sax.rb
@@ -430,8 +430,8 @@ WOK
rdf=SiSU_XML_Tags::RDF.new(@md)
@@xml[:head],@@xml[:body]=[],[]
stylesheet=SiSU_Style::CSS_HeadInfo.new(@md,'xml_sax').stylesheet
- encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
- else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ encoding=if @sys.locale =~/utf-?8/i then '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
end
@@xml[:open] =<<WOK
#{encoding}