aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v5/dp.rb18
-rw-r--r--lib/sisu/v5/hub.rb1
-rw-r--r--lib/sisu/v5/hub_actions.rb19
-rw-r--r--lib/sisu/v5/hub_options.rb4
-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/texpdf.rb5
-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/dp.rb18
-rw-r--r--lib/sisu/v6/hub.rb1
-rw-r--r--lib/sisu/v6/hub_actions.rb19
-rw-r--r--lib/sisu/v6/hub_options.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/texpdf.rb5
-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
22 files changed, 102 insertions, 48 deletions
diff --git a/lib/sisu/v5/dp.rb b/lib/sisu/v5/dp.rb
index 33c6c565..00cf8525 100644
--- a/lib/sisu/v5/dp.rb
+++ b/lib/sisu/v5/dp.rb
@@ -158,9 +158,25 @@ module SiSU_Param
class MdDefault
def rights(author,date)
@author,@date=author,date
+ def assignment(author)
+ 'copyright not explicitly stated, ' \
+ + 'program "assigning" copyright to author: ' \
+ + author
+ end
def all
s=nil
if @author
+ #puts assignment(@author)
+ s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
+ ? ("Copyright (C) #{$1} #{@author}")
+ : ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
+ end
+ s
+ end
+ def copyright_and_license
+ s=nil
+ if @author
+ #puts assignment(@author)
s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
? ("Copyright (C) #{$1} #{@author}")
: ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
@@ -584,7 +600,7 @@ module SiSU_Param
' \\\\ '
end
def copyright_and_license
- s=if @h['all'] then @h['all']
+ s=if @h['copyright_and_license'] then @h['copyright_and_license']
else
s=''
if defined? copyright.text \
diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb
index 68db1f13..eda98084 100644
--- a/lib/sisu/v5/hub.rb
+++ b/lib/sisu/v5/hub.rb
@@ -207,6 +207,7 @@ module SiSU
def actions_without_files
actions=SiSU_Hub_Actions::HubActions.new(@opt)
actions.report.version_info?
+ actions.report.version_dir?
actions.prepare.site?
actions.prepare.sql?
end
diff --git a/lib/sisu/v5/hub_actions.rb b/lib/sisu/v5/hub_actions.rb
index 785f507e..5f99f444 100644
--- a/lib/sisu/v5/hub_actions.rb
+++ b/lib/sisu/v5/hub_actions.rb
@@ -72,6 +72,17 @@ module SiSU_Hub_Actions
SiSU_Env::InfoAbout.new(@opt).sisu_version
end
end
+ def version_dir?
+ if @opt.act[:version_info][:set]==:on \
+ || @opt.act[:verbose][:set]==:on \
+ || @opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on
+ SiSU_Screen::Ansi.new(
+ @opt.act[:color_state][:set],
+ ' ' + File.dirname(__FILE__)
+ ).grey
+ end
+ end
self
end
def prepare
@@ -853,14 +864,6 @@ module SiSU_Hub_Actions
end
def init?
SiSU_Env::InfoProcessingFlag.new
- if (@opt.act[:verbose][:set]==:on \
- || @opt.act[:verbose_plus][:set]==:on \
- || @opt.act[:maintenance][:set]==:on)
- SiSU_Screen::Ansi.new(
- @opt.act[:color_state][:set],
- ' ' + File.dirname(__FILE__)
- ).grey
- end
if @opt.act[:ao][:set]==:on \
or @opt.act[:maintenance][:set]==:on #% --maintenance, -M
env=SiSU_Env::InfoEnv.new(@opt.fns)
diff --git a/lib/sisu/v5/hub_options.rb b/lib/sisu/v5/hub_options.rb
index bc96b878..d871c9c3 100644
--- a/lib/sisu/v5/hub_options.rb
+++ b/lib/sisu/v5/hub_options.rb
@@ -316,7 +316,9 @@ module SiSU_Commandline
c,w='',''
m,f,pth,lng,lngs=[],[],[],[],[]
lng_is=''
- a=s.split(/\s+/)
+ a=(s.nil?) \
+ ? ['-v']
+ : s.split(/\s+/)
r_l=Px[:lng_lst].join('|')
a.uniq.each do |x|
if x =~/^-[a-z0-5]+/i \
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 << <<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 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; '<?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/texpdf.rb b/lib/sisu/v5/texpdf.rb
index c2c9dc70..e35c7ccf 100644
--- a/lib/sisu/v5/texpdf.rb
+++ b/lib/sisu/v5/texpdf.rb
@@ -448,10 +448,9 @@ module SiSU_TeX
end
if defined? @md.rights.all \
and not @md.rights.all.empty?
- rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
- sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.copyright_and_license)
+ sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.rights.copyright.copyright_and_license.dup)
copymark='Copyright {\begin{small}{\copyright\end{small}} '
- #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
+ #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
copyright=sp_char.special_characters_safe.gsub(/\s*Copyright \(C\)/, copymark)
@@rights||="\n #{Tex[:backslash]*2}[3]\\ \\linebreak #{copyright}"
end
diff --git a/lib/sisu/v5/xhtml.rb b/lib/sisu/v5/xhtml.rb
index 14c6bfe9..138ccf6d 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 fb7d3cb9..b78fb67a 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 69dc39a3..ea3f7175 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/dp.rb b/lib/sisu/v6/dp.rb
index 111896d7..595cee3e 100644
--- a/lib/sisu/v6/dp.rb
+++ b/lib/sisu/v6/dp.rb
@@ -158,9 +158,25 @@ module SiSU_Param
class MdDefault
def rights(author,date)
@author,@date=author,date
+ def assignment(author)
+ 'copyright not explicitly stated, ' \
+ + 'program "assigning" copyright to author: ' \
+ + author
+ end
def all
s=nil
if @author
+ #puts assignment(@author)
+ s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
+ ? ("Copyright (C) #{$1} #{@author}")
+ : ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
+ end
+ s
+ end
+ def copyright_and_license
+ s=nil
+ if @author
+ #puts assignment(@author)
s ||=((@date =~/((?:1[4-9]|2[01])\d{2})/ ) \
? ("Copyright (C) #{$1} #{@author}")
: ('Copyright (C)' + @author)) #matches years 1400 through 21\d\d
@@ -584,7 +600,7 @@ module SiSU_Param
' \\\\ '
end
def copyright_and_license
- s=if @h['all'] then @h['all']
+ s=if @h['copyright_and_license'] then @h['copyright_and_license']
else
s=''
if defined? copyright.text \
diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb
index cd66bc17..2558a9db 100644
--- a/lib/sisu/v6/hub.rb
+++ b/lib/sisu/v6/hub.rb
@@ -207,6 +207,7 @@ module SiSU
def actions_without_files
actions=SiSU_Hub_Actions::HubActions.new(@opt)
actions.report.version_info?
+ actions.report.version_dir?
actions.prepare.site?
actions.prepare.sql?
end
diff --git a/lib/sisu/v6/hub_actions.rb b/lib/sisu/v6/hub_actions.rb
index 2be0304b..54d0ccd2 100644
--- a/lib/sisu/v6/hub_actions.rb
+++ b/lib/sisu/v6/hub_actions.rb
@@ -72,6 +72,17 @@ module SiSU_Hub_Actions
SiSU_Env::InfoAbout.new(@opt).sisu_version
end
end
+ def version_dir?
+ if @opt.act[:version_info][:set]==:on \
+ || @opt.act[:verbose][:set]==:on \
+ || @opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on
+ SiSU_Screen::Ansi.new(
+ @opt.act[:color_state][:set],
+ ' ' + File.dirname(__FILE__)
+ ).grey
+ end
+ end
self
end
def prepare
@@ -853,14 +864,6 @@ module SiSU_Hub_Actions
end
def init?
SiSU_Env::InfoProcessingFlag.new
- if (@opt.act[:verbose][:set]==:on \
- || @opt.act[:verbose_plus][:set]==:on \
- || @opt.act[:maintenance][:set]==:on)
- SiSU_Screen::Ansi.new(
- @opt.act[:color_state][:set],
- ' ' + File.dirname(__FILE__)
- ).grey
- end
if @opt.act[:ao][:set]==:on \
or @opt.act[:maintenance][:set]==:on #% --maintenance, -M
env=SiSU_Env::InfoEnv.new(@opt.fns)
diff --git a/lib/sisu/v6/hub_options.rb b/lib/sisu/v6/hub_options.rb
index 5625963b..336f0d93 100644
--- a/lib/sisu/v6/hub_options.rb
+++ b/lib/sisu/v6/hub_options.rb
@@ -316,7 +316,9 @@ module SiSU_Commandline
c,w='',''
m,f,pth,lng,lngs=[],[],[],[],[]
lng_is=''
- a=s.split(/\s+/)
+ a=(s.nil?) \
+ ? ['-v']
+ : s.split(/\s+/)
r_l=Px[:lng_lst].join('|')
a.uniq.each do |x|
if x =~/^-[a-z0-5]+/i \
diff --git a/lib/sisu/v6/se_programs.rb b/lib/sisu/v6/se_programs.rb
index 448ac98e..646878d4 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 1b2cabef..ad9e5951 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 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; '<?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/texpdf.rb b/lib/sisu/v6/texpdf.rb
index 10bfa961..57eab29d 100644
--- a/lib/sisu/v6/texpdf.rb
+++ b/lib/sisu/v6/texpdf.rb
@@ -448,10 +448,9 @@ module SiSU_TeX
end
if defined? @md.rights.all \
and not @md.rights.all.empty?
- rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
- sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.copyright_and_license)
+ sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.rights.copyright.copyright_and_license.dup)
copymark='Copyright {\begin{small}{\copyright\end{small}} '
- #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
+ #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
copyright=sp_char.special_characters_safe.gsub(/\s*Copyright \(C\)/, copymark)
@@rights||="\n #{Tex[:backslash]*2}[3]\\ \\linebreak #{copyright}"
end
diff --git a/lib/sisu/v6/xhtml.rb b/lib/sisu/v6/xhtml.rb
index 409a2b6c..17f3a335 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 1285a1cc..60141195 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 d595e4a4..9555d2de 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}