aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/xml_dom.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-05-10 12:07:29 -0400
committerRalph Amissah <ralph@amissah.com>2008-05-10 12:07:29 -0400
commit34cee0148a445bcee5e97997575b7323df0a02b9 (patch)
tree5f2a1a7618b0484d6a5620ccaa80906412a3e486 /lib/sisu/v0/xml_dom.rb
parentsyenv updates, mostly sql related (diff)
introduced particulars (rename later) for commonly used document and environment details, and cleaned up some requires
Diffstat (limited to 'lib/sisu/v0/xml_dom.rb')
-rw-r--r--lib/sisu/v0/xml_dom.rb24
1 files changed, 11 insertions, 13 deletions
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__
-