From 53a4ec45a504cc19536530e37da4f79bfbd895fd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 4 Jul 2009 08:40:03 -0400 Subject: make sisu and ruby version info ruby instance methods --- lib/sisu/v0/cgi_sql_common.rb | 2 +- lib/sisu/v0/defaults.rb | 4 ++-- lib/sisu/v0/harvest_authors.rb | 4 ++-- lib/sisu/v0/harvest_topics.rb | 4 ++-- lib/sisu/v0/help.rb | 4 ++-- lib/sisu/v0/manpage.rb | 2 +- lib/sisu/v0/param.rb | 2 +- lib/sisu/v0/sisupod_make.rb | 2 +- lib/sisu/v0/sst_from_kdissert.rb | 2 +- lib/sisu/v0/sst_from_xml.rb | 2 +- lib/sisu/v0/sysenv.rb | 11 +++++++---- lib/sisu/v0/texinfo_format.rb | 2 +- lib/sisu/v0/texpdf_format.rb | 8 ++++---- lib/sisu/v0/xml_fictionbook.rb | 4 ++-- 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 # • @@ -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 < @@ -216,7 +216,7 @@ module HARVEST_authors SiSU Metadata Harvest - Authors - + 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 < @@ -293,7 +293,7 @@ module HARVEST_topics SiSU Metadata Harvest - Topics - + 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 #{@md.date_available} Initial version

" else '' end -- cgit v1.2.3