From 1b77c140270a910710a2d918f74cc71eeb611fd4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 6 Dec 2014 01:09:10 -0500 Subject: d: track changes to sisu_version info --- lib/sisu/develop/cgi_sql_common.rb | 10 +++---- lib/sisu/develop/dp.rb | 1 + lib/sisu/develop/html_harvest_authors.rb | 2 +- lib/sisu/develop/html_harvest_topics.rb | 2 +- lib/sisu/develop/html_manifest.rb | 2 +- lib/sisu/develop/html_parts.rb | 10 +++---- lib/sisu/develop/manpage.rb | 2 +- lib/sisu/develop/se_get_init.rb | 16 +++++------ lib/sisu/develop/se_version.rb | 48 +++++++++++++++++++++++++------- lib/sisu/develop/shared_metadata.rb | 20 ++++++------- lib/sisu/develop/src_shared.rb | 2 +- lib/sisu/develop/sst_from_xml.rb | 2 +- lib/sisu/develop/texinfo_format.rb | 2 +- lib/sisu/develop/texpdf_format.rb | 8 +++--- lib/sisu/develop/txt_asciidoc.rb | 2 +- lib/sisu/develop/txt_markdown.rb | 2 +- lib/sisu/develop/txt_plain.rb | 2 +- lib/sisu/develop/txt_rst.rb | 2 +- lib/sisu/develop/txt_textile.rb | 2 +- lib/sisu/develop/wikispeak.rb | 2 +- lib/sisu/develop/xhtml_parts.rb | 2 +- lib/sisu/develop/xml_fictionbook2.rb | 4 +-- lib/sisu/develop/xml_odf_odt_format.rb | 2 +- lib/sisu/develop/xml_shared.rb | 2 +- 24 files changed, 89 insertions(+), 60 deletions(-) (limited to 'lib') diff --git a/lib/sisu/develop/cgi_sql_common.rb b/lib/sisu/develop/cgi_sql_common.rb index 0b29640d..5a4619c1 100644 --- a/lib/sisu/develop/cgi_sql_common.rb +++ b/lib/sisu/develop/cgi_sql_common.rb @@ -537,14 +537,14 @@ module SiSU_CGI_SQL

Generated by - #{v[:project]} #{v[:version]} #{v[:date]} (#{v[:date_stamp]}) + #{v.project} #{v.version} #{v.date} (#{v.date_stamp})
- #{v[:project]} © Ralph Amissah + #{v.project} © Ralph Amissah 1993, current 2014. All Rights Reserved.
- #{v[:project]} is software for document structuring, publishing and search, + #{v.project} is software for document structuring, publishing and search,
www.jus.uio.no/sisu @@ -574,7 +574,7 @@ module SiSU_CGI_SQL

- #{v[:project]} using: + #{v.project} using:
Standard SiSU markup syntax,
Standard SiSU meta-markup syntax, and the
Standard SiSU object citation numbering and system, (object/text identifying/locating system) @@ -601,7 +601,7 @@ module SiSU_CGI_SQL

- #{v[:project]}, developed using + #{v.project}, developed using Ruby diff --git a/lib/sisu/develop/dp.rb b/lib/sisu/develop/dp.rb index 3736630b..10a805e7 100644 --- a/lib/sisu/develop/dp.rb +++ b/lib/sisu/develop/dp.rb @@ -1017,6 +1017,7 @@ module SiSU_Param @flag_endnotes,@flag_auto_endnotes,@flag_separate_endnotes=false,false,false @flag_separate_endnotes_make=true ver=SiSU_Env::InfoVersion.instance +p ver.get_version.version @sisu_version=ver.get_version @ruby_version=ver.rbversion @generated=Time.now diff --git a/lib/sisu/develop/html_harvest_authors.rb b/lib/sisu/develop/html_harvest_authors.rb index 5fd6bc72..8298b1af 100644 --- a/lib/sisu/develop/html_harvest_authors.rb +++ b/lib/sisu/develop/html_harvest_authors.rb @@ -322,7 +322,7 @@ module SiSU_HarvestAuthors - + diff --git a/lib/sisu/develop/html_harvest_topics.rb b/lib/sisu/develop/html_harvest_topics.rb index b86f4914..bd461377 100644 --- a/lib/sisu/develop/html_harvest_topics.rb +++ b/lib/sisu/develop/html_harvest_topics.rb @@ -691,7 +691,7 @@ module SiSU_HarvestTopics - + diff --git a/lib/sisu/develop/html_manifest.rb b/lib/sisu/develop/html_manifest.rb index 397f040d..e49f0975 100644 --- a/lib/sisu/develop/html_manifest.rb +++ b/lib/sisu/develop/html_manifest.rb @@ -853,7 +853,7 @@ WOK metadata(id,info) end if @md.sisu_version - id,info=@translate.sisu_version,"#{@md.sisu_version[:project]} #{@md.sisu_version[:version]} #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})#{@md.sisu_version[:install_method]}" + id,info=@translate.sisu_version,"#{@md.sisu_version.project} #{@md.sisu_version.version} #{@md.sisu_version.date_stamp} (#{@md.sisu_version.date})#{@md.sisu_version.install_method}" metadata(id,info) end if @md.ruby_version diff --git a/lib/sisu/develop/html_parts.rb b/lib/sisu/develop/html_parts.rb index e29b450f..4133203c 100644 --- a/lib/sisu/develop/html_parts.rb +++ b/lib/sisu/develop/html_parts.rb @@ -293,7 +293,7 @@ module SiSU_Proj_HTML #@date=SiSU_Env::InfoDate.new #{@date.year} end def txt_generator - %{ + %{ } end def widget_sisu_text @@ -301,9 +301,9 @@ module SiSU_Proj_HTML

Output generated by - #{@v[:project]} + #{@v.project} - #{@v[:version]} #{@v[:date]} (#{@v[:date_stamp]}) + #{@v.version} #{@v.date} (#{@v.date_stamp})

WOK end @@ -362,7 +362,7 @@ WOK - + @@ -420,7 +420,7 @@ Outputs include: plaintext, HTML, EPUB, ODT (OpenDocumentText), (XHTML, XML,) La

-#{@v[:project]} #{@v[:version]} of #{@v[:date_stamp]} (#{@v[:date]}) (n*x and Ruby!), #{@date.year_static}. +#{@v.project} #{@v.version} of #{@v.date_stamp} (#{@v.date}) (n*x and Ruby!), #{@date.year_static}.

w3 since October 3 1993. diff --git a/lib/sisu/develop/manpage.rb b/lib/sisu/develop/manpage.rb index e0dbad21..2d46a229 100644 --- a/lib/sisu/develop/manpage.rb +++ b/lib/sisu/develop/manpage.rb @@ -380,7 +380,7 @@ WOK else SiSU_Env::InfoDate.new.year #date missing decide on action end proj=SiSU_Env::InfoVersion.instance.get_version - manpage[:open] = %{.TH "#{@md.fnb}" "#{@md.make.manpage['section']}" "#{date}" "#{proj[:version]}" "#{@md.title.main}"#{@md.make.manpage['name']}#{@md.make.manpage['synopsis']}} + manpage[:open] = %{.TH "#{@md.fnb}" "#{@md.make.manpage['section']}" "#{date}" "#{proj.version}" "#{@md.title.main}"#{@md.make.manpage['name']}#{@md.make.manpage['synopsis']}} content << manpage[:open] content << manpage[:head] content << manpage[:body] diff --git a/lib/sisu/develop/se_get_init.rb b/lib/sisu/develop/se_get_init.rb index 569ea95e..0434aea5 100644 --- a/lib/sisu/develop/se_get_init.rb +++ b/lib/sisu/develop/se_get_init.rb @@ -83,34 +83,34 @@ module SiSU_Get_Init [ $sisu_document_markup_directory_base_fixed_path \ + '/.sisu/' \ - + v[:branch_name], + + v.branch_name, $sisu_document_markup_directory_base_fixed_path \ + '/.sisu/' \ - + v[:branch_version], + + v.branch_version, $sisu_document_markup_directory_base_fixed_path \ + '/.sisu', $sisu_document_markup_directory_base_fixed_path \ + '/_sisu/' \ - + v[:branch_name], + + v.branch_name, $sisu_document_markup_directory_base_fixed_path \ + '/_sisu/' \ - + v[:branch_version], + + v.branch_version, $sisu_document_markup_directory_base_fixed_path \ + '/_sisu', @@home \ + '/.sisu/' \ - + v[:branch_name], + + v.branch_name, @@home \ + '/.sisu/' \ - + v[:branch_version], + + v.branch_version, @@home \ + '/.sisu', \ @@sisu_etc \ + '/' \ - + v[:branch_name], + + v.branch_name, @@sisu_etc \ + '/' \ - + v[:branch_version], + + v.branch_version, @@sisu_etc, ] end diff --git a/lib/sisu/develop/se_version.rb b/lib/sisu/develop/se_version.rb index 04c61c32..2ace68ce 100644 --- a/lib/sisu/develop/se_version.rb +++ b/lib/sisu/develop/se_version.rb @@ -85,6 +85,9 @@ module SiSU_Info_Version if File.exist?(SiSU_is[:version_info_path]) version=YAML::load(File::open(SiSU_is[:version_info_path])) end + version[:branch_version]=SiSU_is[:branch_version] + version[:branch_number]=/^v([0-9]+)/.match(version[:branch_version])[1] + version[:branch_name]=SiSU_is[:branch_name] version[:install_method]=if SiSU_is[:run_from]==:gem_install spec = Gem::Specification.find_by_name("sisu") gem_root = spec.gem_dir @@ -92,10 +95,35 @@ module SiSU_Info_Version ? ' (ruby gem install)' : '' else '' end - version[:branch_name]=SiSU_is[:branch_name] - version[:branch_version]=SiSU_is[:branch_version] - version[:branch_number]=/^v([0-9]+)$/.match(version[:branch_version])[1] - version + @version=version + def version_details_hash + @version + end + def project + version_details_hash[:project] + end + def date + version_details_hash[:date] + end + def date_stamp + version_details_hash[:date_stamp] + end + def version + version_details_hash[:version] + end + def branch_version + version_details_hash[:branch_version] + end + def branch_number + version_details_hash[:branch_number] + end + def branch_name + version_details_hash[:branch_name] + end + def install_method + version_details_hash[:install_method] + end + self end def rbversion %x{ruby -v}.strip @@ -118,7 +146,7 @@ module SiSU_Info_About def sisu_version version=SiSU_Env::InfoVersion.instance.get_version rb_ver=SiSU_Env::InfoVersion.instance.rbversion - if version[:version] + if version.version opt_cmd=if defined? @color.cmd \ and @color.cmd =~/[ck]/ @color.cmd @@ -126,11 +154,11 @@ module SiSU_Info_About end SiSU_Screen::Ansi.new( opt_cmd, - version[:project], - version[:version], - version[:date_stamp], - version[:date], - version[:install_method], + version.project, + version.version, + version.date_stamp, + version.date, + version.install_method, rb_ver ).version else puts 'SiSU (version information not available)' diff --git a/lib/sisu/develop/shared_metadata.rb b/lib/sisu/develop/shared_metadata.rb index 1859b510..2f3300f6 100644 --- a/lib/sisu/develop/shared_metadata.rb +++ b/lib/sisu/develop/shared_metadata.rb @@ -281,12 +281,12 @@ module SiSU_Metadata meta << self.meta_para end if defined? @md.sisu_version \ - and @md.sisu_version[:version]=~/\S+/ + and @md.sisu_version.version=~/\S+/ v="#{tr.sisu_version}: " + - "#{@md.sisu_version[:project]} " + - "#{@md.sisu_version[:version]} " + - "of #{@md.sisu_version[:date_stamp]} " + - "(#{@md.sisu_version[:date]})" + "#{@md.sisu_version.project} " + + "#{@md.sisu_version.version} " + + "of #{@md.sisu_version.date_stamp} " + + "(#{@md.sisu_version.date})" @tag,@inf,@class='Generated by',v,'ver' meta << self.meta_para end @@ -1217,12 +1217,12 @@ WOK meta << meta_para(tag,inf) end if defined? @md.sisu_version \ - and @md.sisu_version[:version]=~/\S+/ + and @md.sisu_version.version=~/\S+/ tag=tr.sisu_version - inf="#{@md.sisu_version[:project]} " + - "#{@md.sisu_version[:version]} " + - "of #{@md.sisu_version[:date_stamp]} " + - "(#{@md.sisu_version[:date]})" + inf="#{@md.sisu_version.project} " + + "#{@md.sisu_version.version} " + + "of #{@md.sisu_version.date_stamp} " + + "(#{@md.sisu_version.date})" meta << meta_para(tag,inf) end if defined? @md.ruby_version \ diff --git a/lib/sisu/develop/src_shared.rb b/lib/sisu/develop/src_shared.rb index 8b85825a..ebd4f9d9 100644 --- a/lib/sisu/develop/src_shared.rb +++ b/lib/sisu/develop/src_shared.rb @@ -63,7 +63,7 @@ module SiSU_Source @opt=opt @date=SiSU_Env::InfoDate.new.dt @env=SiSU_Env::InfoEnv.new(opt.fns) - @ver=SiSU_Env::InfoVersion.instance.get_version + #@ver=SiSU_Env::InfoVersion.instance.get_version @v=(@opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ ? 'v' : '' diff --git a/lib/sisu/develop/sst_from_xml.rb b/lib/sisu/develop/sst_from_xml.rb index 40174892..6e3f5f47 100644 --- a/lib/sisu/develop/sst_from_xml.rb +++ b/lib/sisu/develop/sst_from_xml.rb @@ -116,7 +116,7 @@ module SiSU_sstFromXML out_file=File.new(@output_file_name,'w') head=@doc.root.get_elements('//head/header') body=@doc.root.get_elements('//object/text') - out_file.puts "% SiSU text #{@ver[:version]} (generated from a SiSU XML markup representation)\n\n" + out_file.puts "% SiSU text #{@ver.version} (generated from a SiSU XML markup representation)\n\n" head.each do |x| if x.name=='header' head=markup_head(x.to_s) diff --git a/lib/sisu/develop/texinfo_format.rb b/lib/sisu/develop/texinfo_format.rb index 096e1c5c..18276d7a 100644 --- a/lib/sisu/develop/texinfo_format.rb +++ b/lib/sisu/develop/texinfo_format.rb @@ -90,7 +90,7 @@ module SiSU_TexInfoFormat author=@md.author if @md.author author ||='' author=author.gsub(/[\*]/,'') #if author - SiSU_Env::InfoVersion.instance.get_version + #SiSU_Env::InfoVersion.instance.get_version head =< -

EPUB generated by #{@v[:project]} v#{@v[:version]}, GPL3

+

EPUB generated by #{@v.project} v#{@v.version}, GPL3

} '' end diff --git a/lib/sisu/develop/xml_fictionbook2.rb b/lib/sisu/develop/xml_fictionbook2.rb index 45f5b74a..f3c1a0eb 100644 --- a/lib/sisu/develop/xml_fictionbook2.rb +++ b/lib/sisu/develop/xml_fictionbook2.rb @@ -204,8 +204,8 @@ module SiSU_XML_Fictionbook - #{version[:project]} #{version[:version]} and #{rb_ver} - #{version[:date]} + #{version.project} #{version.version} and #{rb_ver} + #{version.date} #{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest} 1.0 diff --git a/lib/sisu/develop/xml_odf_odt_format.rb b/lib/sisu/develop/xml_odf_odt_format.rb index 4de504a0..6f7b6197 100644 --- a/lib/sisu/develop/xml_odf_odt_format.rb +++ b/lib/sisu/develop/xml_odf_odt_format.rb @@ -265,7 +265,7 @@ module SiSU_XML_ODF_ODT_Format class ODT_Head_1_2 def initialize(md) @md=md - @generator="#{@md.sisu_version[:project]} #{@md.sisu_version[:version]} #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" + @generator="#{@md.sisu_version.project} #{@md.sisu_version.version} #{@md.sisu_version.date_stamp} (#{@md.sisu_version.date})" end def manifest_rdf x=<