aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2009-07-04 08:40:03 -0400
committerRalph Amissah <ralph@amissah.com>2009-07-04 08:40:03 -0400
commit53a4ec45a504cc19536530e37da4f79bfbd895fd (patch)
tree5f02128660d11de73de2f3284ef50d513436471a /lib
parentversion number + (diff)
make sisu and ruby version info ruby instance methods
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v0/cgi_sql_common.rb2
-rw-r--r--lib/sisu/v0/defaults.rb4
-rw-r--r--lib/sisu/v0/harvest_authors.rb4
-rw-r--r--lib/sisu/v0/harvest_topics.rb4
-rw-r--r--lib/sisu/v0/help.rb4
-rw-r--r--lib/sisu/v0/manpage.rb2
-rw-r--r--lib/sisu/v0/param.rb2
-rw-r--r--lib/sisu/v0/sisupod_make.rb2
-rw-r--r--lib/sisu/v0/sst_from_kdissert.rb2
-rw-r--r--lib/sisu/v0/sst_from_xml.rb2
-rw-r--r--lib/sisu/v0/sysenv.rb11
-rw-r--r--lib/sisu/v0/texinfo_format.rb2
-rw-r--r--lib/sisu/v0/texpdf_format.rb8
-rw-r--r--lib/sisu/v0/xml_fictionbook.rb4
14 files changed, 28 insertions, 25 deletions
diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb
index 2bfde9eb..fea17a7a 100644
--- a/lib/sisu/v0/cgi_sql_common.rb
+++ b/lib/sisu/v0/cgi_sql_common.rb
@@ -516,7 +516,7 @@ module SiSU_CGI_sql
WOK_SQL
end
def tail
- v=SiSU_Env::Info_version.new.get_version
+ v=SiSU_Env::Info_version.instance.get_version
<<-WOK_SQL
def tail
<<-'WOK'
diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb
index 2f82c31e..fe2a61e8 100644
--- a/lib/sisu/v0/defaults.rb
+++ b/lib/sisu/v0/defaults.rb
@@ -70,7 +70,7 @@ module SiSU_Viz
@fonts='verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman' # 'verdana, arial, georgia, tahoma, sans-serif, helvetica, "times new roman", times, roman'
@dir=SiSU_Env::Info_env.new
@date=SiSU_Env::Info_date.new #{@date.year}
- @v=SiSU_Env::Info_version.new.get_version
+ @v=SiSU_Env::Info_version.instance.get_version
end
#% glyph
def glyph_bullet # &bullet;
@@ -1657,7 +1657,7 @@ WOK
end
class Home < Skin
def initialize
- @v=SiSU_Env::Info_version.new.get_version
+ @v=SiSU_Env::Info_version.instance.get_version
@dir=SiSU_Env::Info_env.new
@date=SiSU_Env::Info_date.new #{@date.year}
end
diff --git a/lib/sisu/v0/harvest_authors.rb b/lib/sisu/v0/harvest_authors.rb
index c3369210..c7ca80fb 100644
--- a/lib/sisu/v0/harvest_authors.rb
+++ b/lib/sisu/v0/harvest_authors.rb
@@ -208,7 +208,7 @@ module HARVEST_authors
'../_sisu/css/harvest.css'
else 'harvest.css'
end
- sv=SiSU_Env::Info_version.new.get_version
+ sv=SiSU_Env::Info_version.instance.get_version
<<WOK
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -216,7 +216,7 @@ module HARVEST_authors
<head>
<title>SiSU Metadata Harvest - Authors</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<meta name="dc.title" content= "SiSU metadata harvest, Authors - SiSU information Structuring Universe, Structured information Serialised Units, 2009" />
+<meta name="dc.title" content= "SiSU metadata harvest, Authors - SiSU information Structuring Universe, Structured information Serialised Units" />
<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" />
<meta name="generator" content="#{sv[:project]} #{sv[:version]} of #{sv[:date_stamp]} (n*x and Ruby!)" />
<link rel="generator" href="http://www.jus.uio.no/sisu/SiSU" />
diff --git a/lib/sisu/v0/harvest_topics.rb b/lib/sisu/v0/harvest_topics.rb
index 06246fe6..1ab62a95 100644
--- a/lib/sisu/v0/harvest_topics.rb
+++ b/lib/sisu/v0/harvest_topics.rb
@@ -285,7 +285,7 @@ module HARVEST_topics
'../_sisu/css/harvest.css'
else 'harvest.css'
end
- sv=SiSU_Env::Info_version.new.get_version
+ sv=SiSU_Env::Info_version.instance.get_version
<<WOK
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -293,7 +293,7 @@ module HARVEST_topics
<head>
<title>SiSU Metadata Harvest - Topics</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<meta name="dc.title" content= "SiSU metadata harvest, Topics - SiSU information Structuring Universe, Structured information Serialised Units, 2009" />
+<meta name="dc.title" content= "SiSU metadata harvest, Topics - SiSU information Structuring Universe, Structured information Serialised Units" />
<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" />
<meta name="generator" content="#{sv[:project]} #{sv[:version]} of #{sv[:date_stamp]} (n*x and Ruby!)" />
<link rel="generator" href="http://www.jus.uio.no/sisu/SiSU" />
diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb
index 18726ce4..cd5eaf25 100644
--- a/lib/sisu/v0/help.rb
+++ b/lib/sisu/v0/help.rb
@@ -1014,8 +1014,8 @@ WOK
end
end
def sisu_version
- version=SiSU_Env::Info_version.new.get_version
- rb_ver=SiSU_Env::Info_version.new.rbversion
+ version=SiSU_Env::Info_version.instance.get_version
+ rb_ver=SiSU_Env::Info_version.instance.rbversion
if version[:version]
tell=SiSU_Screen::Ansi.new('-v',version[:project],version[:version],version[:date_stamp],version[:date],rb_ver)
tell.version
diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb
index 81684fb6..7129e45a 100644
--- a/lib/sisu/v0/manpage.rb
+++ b/lib/sisu/v0/manpage.rb
@@ -420,7 +420,7 @@ WOK
date=if @md.date; @md.date
else '2007' #date missing decide on action
end
- proj=SiSU_Env::Info_version.new.get_version
+ proj=SiSU_Env::Info_version.instance.get_version
manpage[:open] = %{.TH "#{@md.fnb}" "1" "#{date}" "#{proj[:version]}" "#{@md.title}"#{@md.man_name}#{@md.man_synopsis}}
content << manpage[:open]
content << manpage[:head]
diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb
index 7153c40d..4efdebb5 100644
--- a/lib/sisu/v0/param.rb
+++ b/lib/sisu/v0/param.rb
@@ -244,7 +244,7 @@ module SiSU_Param
@flag_separate_endnotes=false
@flag_separate_endnotes_make=true
regx_date=/^\d{4}(?:-(?:[0][0-9]|1[0-2])(-(?:[0-2][0-9]|3[01]))?)?$/
- ver=SiSU_Env::Info_version.new
+ ver=SiSU_Env::Info_version.instance
@sisu_version=ver.get_version
@ruby_version=ver.rbversion
@generated=Time.now
diff --git a/lib/sisu/v0/sisupod_make.rb b/lib/sisu/v0/sisupod_make.rb
index f9d5d1c9..470cbb01 100644
--- a/lib/sisu/v0/sisupod_make.rb
+++ b/lib/sisu/v0/sisupod_make.rb
@@ -68,7 +68,7 @@ module SiSU_Doc
m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
@date=SiSU_Env::Info_date.new.dt
@env=SiSU_Env::Info_env.new(@opt.fns)
- @ver=SiSU_Env::Info_version.new.get_version
+ @ver=SiSU_Env::Info_version.instance.get_version
@ans=SiSU_Response::Response.new
pod_path="#{@env.path.processing}/sisupod"
@v=if @opt.cmd =~/[VM]/; 'v'
diff --git a/lib/sisu/v0/sst_from_kdissert.rb b/lib/sisu/v0/sst_from_kdissert.rb
index 171c599f..53840fcd 100644
--- a/lib/sisu/v0/sst_from_kdissert.rb
+++ b/lib/sisu/v0/sst_from_kdissert.rb
@@ -65,7 +65,7 @@ module SiSU_Kdissert
def initialize(opt)
@opt=opt
@sisu,@sisu_base=[],[]
- @ver=SiSU_Env::Info_version.new.get_version
+ @ver=SiSU_Env::Info_version.instance.get_version
end
def read
kdissert_to_sisu
diff --git a/lib/sisu/v0/sst_from_xml.rb b/lib/sisu/v0/sst_from_xml.rb
index 87b6c0b1..cab88cbb 100644
--- a/lib/sisu/v0/sst_from_xml.rb
+++ b/lib/sisu/v0/sst_from_xml.rb
@@ -65,7 +65,7 @@ module SiSU_sst_from_xml
def initialize(opt)
@opt=opt
@sisu,@sisu_base=[],[]
- @ver=SiSU_Env::Info_version.new.get_version
+ @ver=SiSU_Env::Info_version.instance.get_version
end
def tell(filename,type)
SiSU_Screen::Ansi.new(@opt.cmd,"XML #{type} to SiSU sst","#{filename} --> #{filename}.sst").green_hi_blue
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index fe1d1b62..a37905bd 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -517,7 +517,7 @@ module SiSU_Env
:sxd => filename(code,@fnb,'.sxd.xml'),
:sxn => filename(code,@fnb,'.sxn.xml'),
:sisupod => filename(nil,@fnz,''),
- :book_idx => filename(code,'book_index','.html'),
+ :book_idx_html => filename(code,'book_index','.html'),
}
@fn
end
@@ -546,7 +546,7 @@ module SiSU_Env
program='file'
fnsp=Info_env.new(filename).source_file_with_path
if program_found?(program)
- encoding=%x{file #{fnsp}}.strip
+ encoding=%x{file -L #{fnsp}}.strip
encoding.gsub!(/#{fnsp}:(\s+|$)/,'')
encoding=if encoding \
and not encoding.empty?
@@ -1481,7 +1481,9 @@ WOK
pth
end
def odf
- "#{processing}/odf"
+ pth="#{processing}/odf"
+ mkdir_p(pth) unless FileTest.directory?(pth)
+ pth
end
def tex
pth=if defined? @rc['processing']['latex'] \
@@ -2635,6 +2637,7 @@ WOK
end
end
class Info_version <Info_env
+ include Singleton
require 'rbconfig'
def get_version
@version={}
@@ -3035,7 +3038,7 @@ WOK
begin
super(fns)
@env=SiSU_Env::Info_env.new(fns)
- ver=Info_version.new
+ ver=Info_version.instance
case operation #watch
when /pdf/; @env_out=''
when /sql/
diff --git a/lib/sisu/v0/texinfo_format.rb b/lib/sisu/v0/texinfo_format.rb
index c89cd4c3..eede7b71 100644
--- a/lib/sisu/v0/texinfo_format.rb
+++ b/lib/sisu/v0/texinfo_format.rb
@@ -102,7 +102,7 @@ module SiSU_Texinfo_format
author=@md.author if @md.author
author ||=''
author.gsub!(/[\*]/,'') #if author
- v=SiSU_Env::Info_version.new.get_version
+ v=SiSU_Env::Info_version.instance.get_version
#(version @value{VERSION} #{v[:version]}, @value{UPDATED} #{v[:date]})
head =<<WOK
\\input texinfo @c -*-texinfo-*-
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index 3bc972ad..b13220e4 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -1427,7 +1427,7 @@ WOK
end
end
def sisu_rights
- v=SiSU_Env::Info_version.new.get_version
+ v=SiSU_Env::Info_version.instance.get_version
base_prog_txt=if @md.base_program
case @md.base_program
when /kdissert/i; "\n\\\\ This document prepared using \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert \\ http://freehackers.org/~tnagy/kdissert/ } \\\\ Kdissert is Document Mapping software by Thomas Nagy"
@@ -1455,7 +1455,7 @@ WOK
" \\footnote{%\nGenerated by \\href{http://www.jus.uio.no/sisu}{SiSU} \\ \\href{http://www.jus.uio.no/sisu}{www.jus.uio.no/sisu} \\newline \\href{http://www.sisudoc.org}{www.sisudoc.org} \\\n}"
end
def doc_sc_info
- v=SiSU_Env::Info_version.new.get_version
+ v=SiSU_Env::Info_version.instance.get_version
<<WOK
\\\\
{\\begin{footnotesize}
@@ -1467,7 +1467,7 @@ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- ve
WOK
end
def doc_no_sc_info
- v=SiSU_Env::Info_version.new.get_version
+ v=SiSU_Env::Info_version.instance.get_version
<<WOK
\\\\
{\\begin{small}
@@ -1500,7 +1500,7 @@ WOK
def doc_tail
dir=SiSU_Env::Info_env.new(@md.fns)
base_html="#{dir.url.root}/#{@md.fnb}"
- v=SiSU_Env::Info_version.new.get_version
+ v=SiSU_Env::Info_version.instance.get_version
sisu_ico=if FileTest.file?("#{dir.path.image_source_tex}/sisu.png")
"\\includegraphics*[width=60pt]{#{dir.path.image_source_tex}/sisu.png}"
else
diff --git a/lib/sisu/v0/xml_fictionbook.rb b/lib/sisu/v0/xml_fictionbook.rb
index 208c3d55..a0a82cba 100644
--- a/lib/sisu/v0/xml_fictionbook.rb
+++ b/lib/sisu/v0/xml_fictionbook.rb
@@ -106,8 +106,8 @@ module SiSU_XML_Fictionbook
tail
end
def head
- version=SiSU_Env::Info_version.new.get_version
- rb_ver=SiSU_Env::Info_version.new.rbversion
+ version=SiSU_Env::Info_version.instance.get_version
+ rb_ver=SiSU_Env::Info_version.instance.rbversion
date_available=if defined? @md.date_available; "\n <p>#{@md.date_available} Initial version</p>"
else ''
end