From 34cee0148a445bcee5e97997575b7323df0a02b9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 10 May 2008 12:07:29 -0400 Subject: introduced particulars (rename later) for commonly used document and environment details, and cleaned up some requires --- lib/sisu/v0/concordance.rb | 33 ++++------- lib/sisu/v0/digests.rb | 23 +++----- lib/sisu/v0/html.rb | 32 +++++------ lib/sisu/v0/html_format.rb | 3 - lib/sisu/v0/html_format_css.rb | 2 - lib/sisu/v0/html_tune.rb | 2 - lib/sisu/v0/hub.rb | 7 ++- lib/sisu/v0/odf.rb | 42 ++++++-------- lib/sisu/v0/odf_format.rb | 2 +- lib/sisu/v0/particulars.rb | 121 +++++++++++++++++++++++++++++++++++++++ lib/sisu/v0/sst_to_s_xml_dom.rb | 29 +++++----- lib/sisu/v0/sst_to_s_xml_node.rb | 28 ++++----- lib/sisu/v0/sst_to_s_xml_sax.rb | 28 ++++----- lib/sisu/v0/texpdf.rb | 37 ++++++------ lib/sisu/v0/texpdf_format.rb | 2 - lib/sisu/v0/urls.rb | 12 ++-- lib/sisu/v0/xhtml.rb | 27 ++++----- lib/sisu/v0/xml.rb | 24 ++++---- lib/sisu/v0/xml_dom.rb | 24 ++++---- lib/sisu/v0/xml_scaffold.rb | 7 ++- 20 files changed, 283 insertions(+), 202 deletions(-) create mode 100644 lib/sisu/v0/particulars.rb diff --git a/lib/sisu/v0/concordance.rb b/lib/sisu/v0/concordance.rb index 1b5bbe78..1b777bb5 100644 --- a/lib/sisu/v0/concordance.rb +++ b/lib/sisu/v0/concordance.rb @@ -60,23 +60,22 @@ =end module SiSU_Concordance - require "#{SiSU_lib}/param" + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/sysenv" - require "#{SiSU_lib}/defaults" - require "#{SiSU_lib}/dal" - include SiSU_Param include SiSU_Env + require "#{SiSU_lib}/defaults" include SiSU_Viz require "#{SiSU_lib}/html_format_css" include SiSU_HTML_Format class Source def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get - @env=SiSU_Env::Info_env.new(@md.fns) + @env,@md=@particulars.env,@particulars.md loc=@env.url.output_tell tool=if @md.cmd =~/[MVv]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:concordance]}" else '' @@ -86,7 +85,7 @@ module SiSU_Concordance wordmax=@env.concord_max unless @md.wc_words.nil? if @md.wc_words < wordmax - SiSU_Concordance::Source::Words.new(@md).songsheet + SiSU_Concordance::Source::Words.new(@particulars).songsheet else tell=SiSU_Screen::Ansi.new(@md.cmd,"concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})") tell.warn unless @md.cmd =~/q/ @@ -94,7 +93,7 @@ module SiSU_Concordance else tell=SiSU_Screen::Ansi.new(@md.cmd,"wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words") tell.warn unless @md.cmd =~/q/ - SiSU_Concordance::Source::Words.new(@md).songsheet + SiSU_Concordance::Source::Words.new(@particulars).songsheet end rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error ensure @@ -102,22 +101,18 @@ module SiSU_Concordance end private class Doc_title - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz #revisit, both requires (html & shared_xml) needed for stand alone operation (sisu -w [filename]) require "#{SiSU_lib}/shared_xml" require "#{SiSU_lib}/html" - def initialize(lnk,md) - @md=md + def initialize(lnk,env,md) + @env,@md=env,md @vz=SiSU_Env::Get_init.instance.skin - @env=SiSU_Env::Info_env.new(@md.fns) file_array=@env.read_source_file(@md.fns) txt_path=%{#{@md.dir_out}} SiSU_Env::Info_skin.new(@md).select @md_title=@md.title @fnb=@md.fnb - @env=SiSU_Env::Info_env.new @lex_button=%{SiSU home -->} @lnk=lnk @doc_details =<<#@dp:#@dp>$") @@ -292,7 +283,7 @@ WOK end scr='Full Text scroll: doc#  ' seg='' - @file_index_all << SiSU_Concordance::Source::Doc_title.new('toc',@md).create + @file_index_all << SiSU_Concordance::Source::Doc_title.new('toc',@env,@md).create for word in @freq.keys.sort! {|a,b| a.downcase<=>b.downcase} keyword=SiSU_Concordance::Source::Word.new(word,@freq[word]).html if keyword !~ @rxp_excluded0 diff --git a/lib/sisu/v0/digests.rb b/lib/sisu/v0/digests.rb index 0d2707ff..0c859010 100644 --- a/lib/sisu/v0/digests.rb +++ b/lib/sisu/v0/digests.rb @@ -59,12 +59,8 @@ =end module SiSU_Digest_view - require "#{SiSU_lib}/dal" - require "#{SiSU_lib}/sysenv" + require "#{SiSU_lib}/particulars" require "#{SiSU_lib}/i18n" - include SiSU_Env - include SiSU_Param - include SiSU_Viz pwd=Dir.pwd class Source @@dg=nil @@ -74,11 +70,11 @@ module SiSU_Digest_view @@endnotes_para=[] @@dg=nil @dg=@@dg ||=SiSU_Env::Info_env.new.digest.type - @env=SiSU_Env::Info_env.new(@opt.fns) + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get + @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array tool=if @opt.cmd =~/[MVv]/; "#{@env.program.text_editor} #{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:digest]}" else '' end @@ -87,8 +83,7 @@ module SiSU_Digest_view tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:digest]}") tell.flow if @opt.cmd =~/[MV]/ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns) - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_Digest_view::Source::Scroll.new(@dal_array,@md).songsheet + SiSU_Digest_view::Source::Scroll.new(@particulars).songsheet SiSU_Env::Info_skin.new(@md).select rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure @@ -99,13 +94,13 @@ module SiSU_Digest_view @@dl=nil @@ds={} @@description,@@ds[:digests],@@ds[:tree],@@ds[:summary],@@sc_info=[],[],[],[],[] - def initialize(data='',md='') - @data,@md=data,md + def initialize(particulars) #data='',md='') + @particulars=particulars + @data,@env,@md=@particulars.dal_array,@particulars.env,@particulars.md SiSU_Env::SiSU_file.new(@md).mkdir - @@dg ||=SiSU_Env::Info_env.new.digest.type - @@dl ||=SiSU_Env::Info_env.new.digest.length + @@dg ||=@env.digest.type + @@dl ||=@env.digest.length @dg,@dl=@@dg,@@dl - @env=SiSU_Env::Info_env.new(@md.fns) l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns) @language=l[:l] @tr=SiSU_Translate::Source.new(@md,@language) diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb index b425356a..208b7409 100644 --- a/lib/sisu/v0/html.rb +++ b/lib/sisu/v0/html.rb @@ -60,34 +60,34 @@ =end module SiSU_HTML require 'pstore' + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/defaults" + include SiSU_Viz require "#{SiSU_lib}/html_table" require "#{SiSU_lib}/html_format_css" + include SiSU_HTML_Format_type require "#{SiSU_lib}/html_segments" require "#{SiSU_lib}/html_scroll" - require "#{SiSU_lib}/html_promo" include SiSU_HTML_seg - include SiSU_HTML_Format_type + require "#{SiSU_lib}/html_promo" include SiSU_HTML_promo - require "#{SiSU_lib}/param" - include SiSU_Param - include SiSU_Viz require "#{SiSU_lib}/html_tune" include SiSU_Tune - require "#{SiSU_lib}/dal" require "#{SiSU_lib}/shared_xml" class Source def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) end def read songsheet end def songsheet begin - @md=SiSU_Param::Parameters.new(@opt).get + @md=@particulars.md @fnb=@md.fnb - @env=SiSU_Env::Info_env.new(@opt.fns) + @env=@particulars.env loc=@env.url.output_tell tool=if @opt.cmd =~/z/; "#{@env.program.web_browser} #{loc}/#@fnb/#{@md.fn[:index]}" elsif @opt.cmd =~/[MVv]/; "#{@env.program.web_browser} #{loc}/#@fnb/#{@md.fn[:index]}" @@ -99,7 +99,7 @@ module SiSU_HTML data=nil my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns,@md) #Beware #FIX opt and md, both not necessary SiSU_Env::SiSU_file.new(@md).mkdir - @tuned_file_array=SiSU_HTML::Source::Html_environment.new(@md).tuned_file_instructions + @tuned_file_array=SiSU_HTML::Source::Html_environment.new(@particulars).tuned_file_instructions data=@tuned_file_array scr_endnotes=SiSU_HTML::Source::Endnotes.new(data,@md).scroll toc=SiSU_HTML::Source::Toc.new(data,@md).songsheet @@ -131,10 +131,11 @@ module SiSU_HTML end private class Html_environment - def initialize(md) - @md=md + def initialize(particulars) + @particulars=particulars + @md,@env=particulars.md,particulars.env @vz=SiSU_Env::Get_init.instance.skin - @env,@css,@symlnk=SiSU_Env::Info_env.new(@md.fns),SiSU_Style::CSS.new,SiSU_Env::Create_system_link.new #home + @env,@css,@symlnk=particulars.env,SiSU_Style::CSS.new,SiSU_Env::Create_system_link.new #home end def suffix_linkname #not used at present sfx=if @md.cmd =~/h/; '.html' @@ -151,7 +152,6 @@ module SiSU_HTML SiSU_Env::SiSU_file.new(@md).mkdir end def tuned_file_instructions - @env=SiSU_Env::Info_env.new(@md.fns) @tell=SiSU_Screen::Ansi.new(@md.cmd) if @md @md.sfx='' @@ -175,9 +175,8 @@ module SiSU_HTML my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns) @fnm=my_make_source_file.marshal_meta @tune_verse_marshal=my_make_source_file.marshal_tune - dal_array=SiSU_DAL::Source.new(@md).get # dal file drawn here + dal_array=@particulars.dal_array # dal file drawn here @tuned_file_array=SiSU_Tune::Tune.new(dal_array,@md).songsheet - require "#{SiSU_lib}/param" @tuned_file_array end end @@ -257,7 +256,6 @@ module SiSU_HTML end end class Endnotes - include SiSU_Param include SiSU_HTML_Format_type def initialize(data,md) @data,@md=data,md @@ -583,7 +581,6 @@ WOK class Scroll_head_and_segtoc < Toc def initialize(data,md='',toc='',links_guide_toc='') @data,@md,@toc,@links_guide_toc=data,md,toc,links_guide_toc - @env=SiSU_Env::Info_env.new(@md.fns) @vz=SiSU_Env::Get_init.instance.skin end def in_common @@ -681,7 +678,6 @@ WOK class Seg < SiSU_HTML_seg::Seg end class Output - include SiSU_Param @@dp=nil def initialize(data='',md='') @data,@md=data,md diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index fd3089ca..525ef50d 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -59,8 +59,6 @@ =end module SiSU_HTML_Format - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz class Paragraph_number def initialize(md,paranum) @@ -147,7 +145,6 @@ module SiSU_HTML_Format class Head_information include SiSU_Viz include SiSU_HTML_Format - include SiSU_Env attr_reader :md,:sfx,:pdf,:rdf,:vz def initialize(md='') @md=md diff --git a/lib/sisu/v0/html_format_css.rb b/lib/sisu/v0/html_format_css.rb index 8ffb4e0d..db381e63 100644 --- a/lib/sisu/v0/html_format_css.rb +++ b/lib/sisu/v0/html_format_css.rb @@ -60,8 +60,6 @@ =end module SiSU_HTML_Format_type require "#{SiSU_lib}/html_format" - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz include SiSU_HTML_Format class Head_toc < SiSU_HTML_Format::Head_toc diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb index 2e2c5f3e..8cd8841e 100644 --- a/lib/sisu/v0/html_tune.rb +++ b/lib/sisu/v0/html_tune.rb @@ -60,9 +60,7 @@ =end require "#{SiSU_lib}/param" module SiSU_Tune - #require "#{SiSU_lib}/defaults" require "#{SiSU_lib}/sysenv" - require "#{SiSU_lib}/param" require "#{SiSU_lib}/html_format" #watch include SiSU_Env include SiSU_Screen diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb index 5a193b0a..a9b616c1 100644 --- a/lib/sisu/v0/hub.rb +++ b/lib/sisu/v0/hub.rb @@ -131,7 +131,8 @@ module SiSU when /^source_kdissert$/; SiSU_Kdi_source::Source.new(@opt).read ## -S when /^digests$/; SiSU_Digest_view::Source.new(@opt).read # -N when /^xml_scaffold$/; SiSU_XML_scaffold::Source.new(@opt).read # -T - when /^plaintext$/; SiSU_Plaintext::Source.new(@opt).read # -a -A -e -E -f + when /^air$/; SiSU_Air::Source.new(@opt).read # -A + when /^plaintext$/; SiSU_Plaintext::Source.new(@opt).read # -a when /^wikispeak$/; SiSU_Wikispeak::Source.new(@opt).read # -g when /^odf$/; SiSU_ODF::Source.new(@opt).read # -o when /^xml_md_oai_pmh_dc$/; SiSU_XML_metadata::OAI_PMH.new(@opt).read # -O @@ -277,7 +278,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.mod.inspect =~/--convert|--to|--from/ require "#{SiSU_lib}/sst_convert_markup" end - if @opt.cmd =~/([abCcDdFfgGHhIiJjLMmNnOopQqrRSsTtUuVvwWXxYyZ_0-9])/ \ + if @opt.cmd =~/([AabCcDdFfgGHhIiJjLMmNnOopQqrRSsTtUuVvwWXxYyZ_0-9])/ \ and @opt.cmd =~/^-/ \ and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ #and @@ -418,6 +419,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end if @opt.cmd =~/[hHz]/; op('html','html') #% -h -H -z html css end + if @opt.cmd =~/A/; op('air','air') #% #-A + end if @opt.cmd =~/a/; op('plaintext','plaintext') #% -a #-A -f -e -E plaintext -a creates ms-dos type; -A creates unix type, plaintext file end if @opt.cmd =~/g/; op('wikispeak','wikispeak') #% -g wiki diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index 12c84ac3..1883bdba 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -59,13 +59,14 @@ =end module SiSU_ODF + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/dal" require "#{SiSU_lib}/sysenv" include SiSU_Env - include SiSU_Param include SiSU_Viz require "#{SiSU_lib}/odf_format" - include OD_format + include SiSU_ODF_format require "#{SiSU_lib}/shared_txt" @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 class Source @@ -75,12 +76,12 @@ module SiSU_ODF include FileUtils def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) @@endnotes_para=[] end def read begin - @md=SiSU_Param::Parameters.new(@opt).get - @env=SiSU_Env::Info_env.new(@opt.fns) + @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array @env.odf_structure opendoc=@md.fn[:odf] path=@env.path.output_tell @@ -92,8 +93,7 @@ module SiSU_ODF tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{opendoc}") tell.flow if @opt.cmd =~/[MV]/ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns) - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_ODF::Source::Scroll.new(@dal_array,@md).songsheet + SiSU_ODF::Source::Scroll.new(@particulars).songsheet SiSU_Env::Info_skin.new(@md).select rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure @@ -103,7 +103,7 @@ module SiSU_ODF class Split_text_object <#@dp:#@dp>$/ - OD_format::Format_text_object.new(format,@text,@ocn) + SiSU_ODF_format::Format_text_object.new(format,@text,@ocn) else - OD_format::Format_text_object.new(format,@text,"<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>") + SiSU_ODF_format::Format_text_object.new(format,@text,"<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>") end self end @@ -156,9 +156,8 @@ module SiSU_ODF @@odf={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] } @@docstart=true @@fns,@@dp=nil,nil - def initialize(data='',md='') - @data,@md=data,md - @env=SiSU_Env::Info_env.new(@md.fns) + def initialize(particulars) + @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array @vz=SiSU_Env::Get_init.instance.skin @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ @@ -171,7 +170,7 @@ module SiSU_ODF end def songsheet pre - @data=markup(@data) + @data=markup(@dal_array) post publish end @@ -406,7 +405,7 @@ module SiSU_ODF end def table(para) # if para =~/|)/ if para =~@regx #/.+?<~\d+;\w\d+;\w\d+>.*/ #watch change paranum=para[@regx,3] - @p_num=OD_format::Paragraph_number.new(paranum) + @p_num=SiSU_ODF_format::Paragraph_number.new(paranum) end @sto=Split_text_object.new(para).lev_segname_para_ocn #yyyy-mm-ddT00:00:00#{ocn} #followed immediately by paragraph closure @@ -592,7 +591,7 @@ module SiSU_ODF end elsif para =~/(.*)(.*)/ one,two=$1,$2 - format_text=OD_format::Format_text_object.new(one,two) + format_text=SiSU_ODF_format::Format_text_object.new(one,two) para=format_text.seg_no_paranum end if para =~// \ @@ -604,7 +603,7 @@ module SiSU_ODF end if para =~/<:center>/ one,two=/(.*)<:center>(.*)/.match(para)[1,2] - format_text=OD_format::Format_text_object.new(one,two) + format_text=SiSU_ODF_format::Format_text_object.new(one,two) para=format_text.center end else @@ -706,16 +705,13 @@ module SiSU_ODF content << @@odf[:metadata] #content << @@odf[:owner_details] if @md.stmp =~/\w+/ #not used? content << @@odf[:tail] - Output.new(content,@md).odf + Output.new(content,@md,@env).odf @@odf[:head],@@odf[:body],@@odf[:tail],@@odf[:metadata]=[],[],[],[] end end class Output . + + If you have Internet connection, the latest version of the GPL should be + available at these locations: + + + + + + + + * SiSU uses: + * Standard SiSU markup syntax, + * Standard SiSU meta-markup syntax, and the + * Standard SiSU object citation numbering and system + + * Hompages: + + + + * Download: + + + * Ralph Amissah + + + + ** Description: system environment, resource control and configuration details + +=end +module SiSU_Particulars + require 'singleton' + require "#{SiSU_lib}/sysenv" + require "#{SiSU_lib}/param" + require "#{SiSU_lib}/dal" + include SiSU_Env + include SiSU_Param + class Combined_singleton + include Singleton + def get_all(opt) + @opt=opt + set_env + set_md + set_dal #needs @md + end + def get_env(opt) + @opt=opt + set_env + end + def get_md(opt) + @opt=opt + set_md + end + def get_dal_array(opt) + @opt=opt + set_dal #needs @md + end + def get_env_md(opt) + @opt=opt + set_env + set_md + end + attr_accessor :opt,:md + def set_md + begin + @md=SiSU_Param::Parameters.new(@opt).get + self + rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + end + end + attr_accessor :opt,:env + def set_env + begin + @env=SiSU_Env::Info_env.new(@opt.fns) + self + rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + end + end + attr_accessor :opt,:dal_array + def set_dal + begin + @dal_array=@dal_array=SiSU_DAL::Source.new(@md).get + self + rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + end + end + end +end +__END__ +consider running as separate objects diff --git a/lib/sisu/v0/sst_to_s_xml_dom.rb b/lib/sisu/v0/sst_to_s_xml_dom.rb index f9c190bf..1bf9a561 100644 --- a/lib/sisu/v0/sst_to_s_xml_dom.rb +++ b/lib/sisu/v0/sst_to_s_xml_dom.rb @@ -59,9 +59,9 @@ =end module SiSU_simple_xml_model_dom + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/defaults" - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz require "#{SiSU_lib}/sysenv" include SiSU_Env @@ -79,11 +79,11 @@ module SiSU_simple_xml_model_dom @@fns=nil def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_env_md(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get #bug, relies on info persistence, assumes -m has previously been run - @env=SiSU_Env::Info_env.new(@opt.fns) + @env,@md=@particulars.env,@particulars.md #bug, md relies on info persistence, assumes -m has previously been run path=@env.path.output_tell loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{Dir.pwd}/#{@md.fn[:sxd]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sxd]}" @@ -95,12 +95,12 @@ module SiSU_simple_xml_model_dom tell.flow if @opt.cmd =~/[MV]/ unless @@fns==@opt.fns @@fns=@opt.fns - @@dal_array=[] + @@fns_array=[] end - @dal_array=if @@dal_array.empty?; read_fnm - else @@dal_array.dup # check + @fns_array=if @@fns_array.empty?; read_fnm + else @@fns_array.dup # check end - SiSU_simple_xml_model_dom::Convert::Songsheet.new(@dal_array,@md,@env).songsheet + SiSU_simple_xml_model_dom::Convert::Songsheet.new(@fns_array,@particulars).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure #file closed in songsheet end @@ -114,12 +114,12 @@ module SiSU_simple_xml_model_dom end private class Songsheet - def initialize(data,md,dir) - @data,@md,@env=data,md,dir + def initialize(data,particulars) + @data,@particulars,@env,@md=data,particulars,particulars.env,particulars.md end def songsheet begin - SiSU_simple_xml_model_dom::Convert::Scroll.new(@data,@md).songsheet + SiSU_simple_xml_model_dom::Convert::Scroll.new(@data,@particulars).songsheet SiSU_simple_xml_model_dom::Convert::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use SiSU_Rexml::Rexml.new(@md,@md.fn[:sxd]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error @@ -132,13 +132,12 @@ module SiSU_simple_xml_model_dom require "#{SiSU_lib}/css" include SiSU_text_utils @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] } - def initialize(data='',md=nil) - @data,@md=data,md + def initialize(data='',particulars='') + @data,@env,@md=data,particulars.env,particulars.md @vz=SiSU_Env::Get_init.instance.skin @regx=/^(?:(?:<:p[bn]>\s*)?(?::?[A-C]|\d~)(?:(\S+))?\s+)?(.+)/ @tab="\t" if @md - @env=SiSU_Env::Info_env.new(@md.fns) @trans=SiSU_XML_munge::Trans.new(@md) end @sys=SiSU_Env::System_call.new @@ -543,8 +542,6 @@ WOK end end class Output - include SiSU_Param - include SiSU_Env def initialize(data,md) @data,@md=data,md @trans=SiSU_XML_munge::Trans.new(@md) diff --git a/lib/sisu/v0/sst_to_s_xml_node.rb b/lib/sisu/v0/sst_to_s_xml_node.rb index a2656e3e..76e30b60 100644 --- a/lib/sisu/v0/sst_to_s_xml_node.rb +++ b/lib/sisu/v0/sst_to_s_xml_node.rb @@ -59,6 +59,8 @@ =end module SiSU_simple_xml_model_node + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/defaults" require "#{SiSU_lib}/param" include SiSU_Param @@ -80,11 +82,12 @@ module SiSU_simple_xml_model_node @@fns=nil def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_env_md(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get #bug, relies on info persistence, assumes -m has previously been run - @env=SiSU_Env::Info_env.new(@opt.fns) + @md=@particulars.md #bug, relies on info persistence, assumes -m has previously been run + @env=@particulars.env path=@env.path.output_tell loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{Dir.pwd}/#{@md.fn[:sxn]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sxn]}" @@ -96,12 +99,12 @@ module SiSU_simple_xml_model_node tell.flow if @opt.cmd =~/[MV]/ unless @@fns==@opt.fns @@fns=@opt.fns - @@dal_array=[] + @@fns_array=[] end - @dal_array=if @@dal_array.empty?; read_fnm - else @@dal_array.dup #.dup #jokes on you + @fns_array=if @@fns_array.empty?; read_fnm + else @@fns_array.dup #.dup #jokes on you end - SiSU_simple_xml_model_node::Convert::Songsheet.new(@dal_array,@md,@env).songsheet + SiSU_simple_xml_model_node::Convert::Songsheet.new(@fns_array,@particulars).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure #file closed in songsheet end @@ -115,12 +118,12 @@ module SiSU_simple_xml_model_node end private class Songsheet - def initialize(data,md,dir) - @data,@md,@env=data,md,dir + def initialize(data,particulars) + @data,@particulars,@env,@md=data,particulars,particulars.env,particulars.md end def songsheet begin - SiSU_simple_xml_model_node::Convert::Scroll.new(@data,@md).songsheet + SiSU_simple_xml_model_node::Convert::Scroll.new(@data,@particulars).songsheet SiSU_simple_xml_model_node::Convert::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use SiSU_Rexml::Rexml.new(@md,@md.fn[:sxn]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error @@ -136,13 +139,12 @@ module SiSU_simple_xml_model_node @@parent={ :ocn=>[],:node=>[] } @@offspring={ :ocn=>[],:node=>[] } @@current=nil - def initialize(data='',md=nil) - @data,@md=data,md + def initialize(data='',particulars='') + @data,@env,@md=data,particulars.env,particulars.md @vz=SiSU_Env::Get_init.instance.skin @regx=/^(?:(?:<:p[bn]>\s*)?(?::?[A-C]~|\d~)(?:(\S+))?\s+)?(.+)/ @tab="\t" if @md - @env=SiSU_Env::Info_env.new(@md.fns) @trans=SiSU_XML_munge::Trans.new(@md) end @sys=SiSU_Env::System_call.new @@ -595,8 +597,6 @@ WOK end end class Output - include SiSU_Param - include SiSU_Env def initialize(data,md) @data,@md=data,md end diff --git a/lib/sisu/v0/sst_to_s_xml_sax.rb b/lib/sisu/v0/sst_to_s_xml_sax.rb index 4625779d..e7765d33 100644 --- a/lib/sisu/v0/sst_to_s_xml_sax.rb +++ b/lib/sisu/v0/sst_to_s_xml_sax.rb @@ -59,6 +59,8 @@ =end module SiSU_simple_xml_model_sax + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/defaults" require "#{SiSU_lib}/param" include SiSU_Param @@ -79,11 +81,12 @@ module SiSU_simple_xml_model_sax @@fns=nil def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_env_md(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get #bug, relies on info persistence, assumes -m has previously been run - @env=SiSU_Env::Info_env.new(@opt.fns) + @md=@particulars.md #bug, relies on info persistence, assumes -m has previously been run + @env=@particulars.env path=@env.path.output_tell loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{Dir.pwd}/#{@md.fn[:sxs]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sxs]}" @@ -94,12 +97,12 @@ module SiSU_simple_xml_model_sax SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{Dir.pwd}/#{@md.fn[:sxs]}").flow if @opt.cmd =~/[MV]/ unless @@fns==@opt.fns @@fns=@opt.fns - @@dal_array=[] + @@fns_array=[] end - @dal_array=if @@dal_array.empty?; read_fnm - else @@dal_array.dup #check + @fns_array=if @@fns_array.empty?; read_fnm + else @@fns_array.dup #check end - SiSU_simple_xml_model_sax::Convert::Songsheet.new(@dal_array,@md,@env).songsheet + SiSU_simple_xml_model_sax::Convert::Songsheet.new(@fns_array,@particulars).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure #file closed in songsheet end @@ -113,12 +116,12 @@ module SiSU_simple_xml_model_sax end private class Songsheet - def initialize(data,md,dir) - @data,@md,@env=data,md,dir + def initialize(data,particulars) + @data,@particulars,@env,@md=data,particulars,particulars.env,particulars.md end def songsheet begin - SiSU_simple_xml_model_sax::Convert::Scroll.new(@data,@md).songsheet + SiSU_simple_xml_model_sax::Convert::Scroll.new(@data,@particulars).songsheet SiSU_simple_xml_model_sax::Convert::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use SiSU_Rexml::Rexml.new(@md,@md.fn[:sxs]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error @@ -131,13 +134,12 @@ module SiSU_simple_xml_model_sax require "#{SiSU_lib}/css" include SiSU_text_utils @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] } - def initialize(data='',md=nil) - @data,@md=data,md + def initialize(data='',particulars='') + @data,@env,@md=data,particulars.env,particulars.md @vz=SiSU_Env::Get_init.instance.skin @regx=/^(?:(?:<:p[bn]>\s*)?(?::?[A-C]~|\d~)(?:(\S+))?\s+)?(.+)/ @tab="\t" if @md - @env=SiSU_Env::Info_env.new(@md.fns) @trans=SiSU_XML_munge::Trans.new(@md) end @sys=SiSU_Env::System_call.new @@ -411,8 +413,6 @@ WOK end end class Output - include SiSU_Param - include SiSU_Env def initialize(data,md) @data,@md=data,md end diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb index 5b8e020f..a17033c8 100644 --- a/lib/sisu/v0/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -61,9 +61,9 @@ module SiSU_TeX require 'pstore' require "#{SiSU_lib}/defaults" - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/texpdf_format" include SiSU_TeX_Pdf @tex_file=@@tex_footnote_array=@@tex_col_w=[] @@ -79,17 +79,16 @@ module SiSU_TeX class Source #Songsheet # nil, :l => nil } @@flag_alt,@@flag_group,@@flag_code=false,false,false @@dp,@@prefix_b=nil,nil - def initialize(data,md) - @data,@md=data,md - @env=SiSU_Env::Info_env.new(@md.fns) + def initialize(particulars) + @particulars=particulars + @md=@particulars.md + @env=@particulars.env + @data=@particulars.dal_array # dal file drawn here @st={ :tex=>{} } @tex=SiSU_TeX_Pdf::Use_TeX.new(@md) @vz=SiSU_Env::Get_init.instance.skin diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb index 9e7fccde..75a3ff91 100644 --- a/lib/sisu/v0/texpdf_format.rb +++ b/lib/sisu/v0/texpdf_format.rb @@ -60,8 +60,6 @@ =end module SiSU_TeX_Pdf @@table_pg_break_counter=1 - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz class Use_TeX attr_accessor :url,:txt,:date diff --git a/lib/sisu/v0/urls.rb b/lib/sisu/v0/urls.rb index 1d401f12..794270f6 100644 --- a/lib/sisu/v0/urls.rb +++ b/lib/sisu/v0/urls.rb @@ -59,11 +59,11 @@ =end module SiSU_urls + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/sysenv" include SiSU_Env include SiSU_Screen - require "#{SiSU_lib}/param" - include SiSU_Param class Source attr_reader :opt def initialize(opt) @@ -78,15 +78,15 @@ module SiSU_urls end end class Output_urls - include SiSU_Param attr_reader :fns,:fnb,:cmd,:dir,:m_regular,:u def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_env_md(opt) fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@opt.fns) @cmd=@opt.cmd - env=SiSU_Env::Env_call.new(@opt.fns) - @fnb=env.fnb - @env=SiSU_Env::Info_env.new(@opt.fns) + @md=@particulars.md + @env=@particulars.env + @fnb=@env.fnb fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@opt.fns) @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) @fn=SiSU_Env::Env_call.new(@opt.fns).lang(fn_set_lang[:c]) diff --git a/lib/sisu/v0/xhtml.rb b/lib/sisu/v0/xhtml.rb index fa022db1..8503bddb 100644 --- a/lib/sisu/v0/xhtml.rb +++ b/lib/sisu/v0/xhtml.rb @@ -60,12 +60,11 @@ =end module SiSU_XHTML require "#{SiSU_lib}/defaults" - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/sysenv" include SiSU_Env - require "#{SiSU_lib}/dal" require "#{SiSU_lib}/shared_xml" require "#{SiSU_lib}/xml_format" include SiSU_XML_format @@ -77,11 +76,11 @@ module SiSU_XHTML class Source def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get - @env=SiSU_Env::Info_env.new(@opt.fns) + @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array path=@env.path.output_tell loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:xhtml]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:xhtml]}" @@ -90,8 +89,7 @@ module SiSU_XHTML end SiSU_Screen::Ansi.new(@opt.cmd,'invert','XHTML',tool).colorize unless @opt.cmd =~/q/ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:xhtml]}").flow if @opt.cmd =~/[MV]/ - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_XHTML::Source::Songsheet.new(@dal_array,@md,@env).songsheet + SiSU_XHTML::Source::Songsheet.new(@particulars).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure #file closed in songsheet @@ -99,12 +97,12 @@ module SiSU_XHTML end private class Songsheet - def initialize(data,md,dir) - @data,@md,@env=data,md,dir + def initialize(particulars) + @env,@md,@dal_array,@particulars=particulars.env,particulars.md,particulars.dal_array,particulars end def songsheet begin - SiSU_XHTML::Source::Scroll.new(@md,@data).songsheet + SiSU_XHTML::Source::Scroll.new(@particulars).songsheet SiSU_XHTML::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use SiSU_Rexml::Rexml.new(@md,@md.fn[:xhtml]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error @@ -118,19 +116,18 @@ module SiSU_XHTML require "#{SiSU_lib}/css" include SiSU_text_utils @@dp=nil - def initialize(md=nil,data='') - @md,@data=md,data + def initialize(particulars) + @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array @vz=SiSU_Env::Get_init.instance.skin @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern @regx=/^(?:(?:<:p[nb]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ @tab="\t" - @env=SiSU_Env::Info_env.new(@md.fns) @trans=SiSU_XML_munge::Trans.new(@md) @sys=SiSU_Env::System_call.new end def songsheet pre - @data=markup(@data) + @data=markup(@dal_array) post publish end @@ -424,8 +421,6 @@ WOK end end class Output - include SiSU_Param - include SiSU_Env def initialize(data,md) @data,@md=data,md end diff --git a/lib/sisu/v0/xml.rb b/lib/sisu/v0/xml.rb index 9a88c09c..23125e05 100644 --- a/lib/sisu/v0/xml.rb +++ b/lib/sisu/v0/xml.rb @@ -57,9 +57,9 @@ =end module SiSU_XML_SAX require "#{SiSU_lib}/defaults" - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/sysenv" include SiSU_Env require "#{SiSU_lib}/dal" @@ -74,11 +74,11 @@ module SiSU_XML_SAX class Source def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get - @env=SiSU_Env::Info_env.new(@opt.fns) + @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array path=@env.path.output_tell loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:sax]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sax]}" @@ -87,8 +87,7 @@ module SiSU_XML_SAX end SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML SAX',tool).colorize unless @opt.cmd =~/q/ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:sax]}").flow if @opt.cmd =~/[MV]/ - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_XML_SAX::Source::Songsheet.new(@dal_array,@md,@env).songsheet + SiSU_XML_SAX::Source::Songsheet.new(@particulars).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure #file closed in songsheet @@ -96,12 +95,12 @@ module SiSU_XML_SAX end private class Songsheet - def initialize(data,md,dir) - @data,@md,@env=data,md,dir + def initialize(particulars) + @env,@md,@dal_array,@particulars=particulars.env,particulars.md,particulars.dal_array,particulars end def songsheet begin - SiSU_XML_SAX::Source::Scroll.new(@data,@md).songsheet + SiSU_XML_SAX::Source::Scroll.new(@particulars).songsheet SiSU_XML_SAX::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use SiSU_Rexml::Rexml.new(@md,@md.fn[:sax]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error @@ -115,19 +114,18 @@ module SiSU_XML_SAX include SiSU_text_utils @@dp,@@env=nil,nil @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] } - def initialize(data='',md=nil) - @data,@md=data,md + def initialize(particulars) + @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array @vz=SiSU_Env::Get_init.instance.skin @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ @tab="\t" - @env=SiSU_Env::Info_env.new(@md.fns) if @md @trans=SiSU_XML_munge::Trans.new(@md) @sys=SiSU_Env::System_call.new end def songsheet pre - @data=markup(@data) + @data=markup(@dal_array) post publish end diff --git a/lib/sisu/v0/xml_dom.rb b/lib/sisu/v0/xml_dom.rb index a25afdc8..008a8ed2 100644 --- a/lib/sisu/v0/xml_dom.rb +++ b/lib/sisu/v0/xml_dom.rb @@ -60,9 +60,9 @@ =end module SiSU_XML_DOM require "#{SiSU_lib}/defaults" - require "#{SiSU_lib}/param" - include SiSU_Param include SiSU_Viz + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/sysenv" include SiSU_Env require "#{SiSU_lib}/dal" @@ -77,11 +77,11 @@ module SiSU_XML_DOM class Source def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) end def read begin - @md=SiSU_Param::Parameters.new(@opt).get - @env=SiSU_Env::Info_env.new(@opt.fns) + @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array path=@env.path.output_tell loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:dom]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:dom]}" @@ -90,8 +90,7 @@ module SiSU_XML_DOM end SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',tool).colorize unless @opt.cmd =~/q/ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:dom]}").flow if @opt.cmd =~/[MV]/ - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_XML_DOM::Source::Songsheet.new(@dal_array,@md,@env).songsheet + SiSU_XML_DOM::Source::Songsheet.new(@particulars).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure #file closed in songsheet @@ -99,12 +98,12 @@ module SiSU_XML_DOM end private class Songsheet - def initialize(data,md='',dir='') - @data,@md,@env=data,md,dir + def initialize(particulars) + @env,@md,@dal_array,@particulars=particulars.env,particulars.md,particulars.dal_array,particulars end def songsheet begin - SiSU_XML_DOM::Source::Scroll.new(@data,@md).songsheet + SiSU_XML_DOM::Source::Scroll.new(@particulars).songsheet SiSU_XML_DOM::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use SiSU_Rexml::Rexml.new(@md,@md.fn[:dom]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error @@ -117,8 +116,8 @@ module SiSU_XML_DOM require "#{SiSU_lib}/shared_txt" include SiSU_text_utils @@dp=nil - def initialize(data='',md='') - @data,@md=data,md + def initialize(particulars) + @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array @vz=SiSU_Env::Get_init.instance.skin @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ # @@ -128,7 +127,7 @@ module SiSU_XML_DOM end def songsheet pre - @data=markup(@data) + @data=markup(@dal_array) post publish end @@ -566,4 +565,3 @@ WOK end end __END__ - diff --git a/lib/sisu/v0/xml_scaffold.rb b/lib/sisu/v0/xml_scaffold.rb index ae8a0cc0..1404567c 100644 --- a/lib/sisu/v0/xml_scaffold.rb +++ b/lib/sisu/v0/xml_scaffold.rb @@ -59,20 +59,21 @@ =end module SiSU_XML_scaffold + require "#{SiSU_lib}/particulars" + include SiSU_Particulars require "#{SiSU_lib}/dal" require "#{SiSU_lib}/sysenv" include SiSU_Env - include SiSU_Param pwd=Dir.pwd class Source def initialize(opt) @opt=opt + @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) @sp=' ' end def read begin - @md=SiSU_Param::Parameters.new(@opt).get - @dal_array=SiSU_DAL::Source.new(@opt).get + @md,@dal_array=@particulars.md,@particulars.dal_array SiSU_XML_scaffold::Source::Scroll.new(@dal_array,@md).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure -- cgit v1.2.3