diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-12-02 23:59:06 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-12-02 23:59:06 -0500 |
commit | 3d4ec6deee066dec01b9445f9b54f844d9443aae (patch) | |
tree | fa3be2eaef7b963f2fd3a7b5b912ee3f173037b7 /lib/sisu/v5/ao.rb | |
parent | v5: renaming files & modules ao & AO (from dal & DAL) (diff) |
v5: some renaming to ao from dal continued
Diffstat (limited to 'lib/sisu/v5/ao.rb')
-rw-r--r-- | lib/sisu/v5/ao.rb | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/lib/sisu/v5/ao.rb b/lib/sisu/v5/ao.rb index 00484ff9..7c367980 100644 --- a/lib/sisu/v5/ao.rb +++ b/lib/sisu/v5/ao.rb @@ -89,7 +89,7 @@ module SiSU_AO end end class Source <Instantiate - @@dal_array=[] + @@ao_array=[] @@idx_arr={ sst: [], tex: [], html: [], xhtml: [] } @@map_arr={ nametags: [], ocn_htmlseg: [] } @@fns=nil @@ -105,23 +105,23 @@ module SiSU_AO opt.fns end @make_fns=SiSU_Env::InfoFile.new(fn_use) - @fnm=@make_fns.marshal.dal_metadata - @fnc=@make_fns.marshal.dal_content - @idx_sst=@make_fns.marshal.dal_idx_sst_rel_html_seg - @idx_raw=@make_fns.marshal.dal_idx_sst_rel - @idx_html=@make_fns.marshal.dal_idx_html - @idx_xhtml=@make_fns.marshal.dal_idx_xhtml - @map_nametags=@make_fns.marshal.dal_map_nametags - @map_ocn_htmlseg=@make_fns.marshal.dal_map_ocn_htmlseg + @fnm=@make_fns.marshal.ao_metadata + @fnc=@make_fns.marshal.ao_content + @idx_sst=@make_fns.marshal.ao_idx_sst_rel_html_seg + @idx_raw=@make_fns.marshal.ao_idx_sst_rel + @idx_html=@make_fns.marshal.ao_idx_html + @idx_xhtml=@make_fns.marshal.ao_idx_xhtml + @map_nametags=@make_fns.marshal.ao_map_nametags + @map_ocn_htmlseg=@make_fns.marshal.ao_map_ocn_htmlseg @env=SiSU_Env::InfoEnv.new end - def read #creates dal + def read #creates ao begin - @@dal_array=[] + @@ao_array=[] @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ ? @fnx : @opt.fns - create_dal + create_ao rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@@fns).location do __LINE__.to_s + ':' + __FILE__ @@ -130,19 +130,19 @@ module SiSU_AO SiSU_AO::Instantiate.new end end - def get #reads dal, unless does not exist then creates first + def get #reads ao, unless does not exist then creates first begin - dal=[] + ao=[] unless @@fns==@opt.fns \ or @@fns==@fnx @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ ? @fnx : @opt.fns - @@dal_array=[] + @@ao_array=[] end - dal=(@@dal_array.empty?) \ + ao=(@@ao_array.empty?) \ ? read_fnc - : @@dal_array.dup + : @@ao_array.dup rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -151,9 +151,9 @@ module SiSU_AO SiSU_AO::Instantiate.new end end - def get_idx_sst #reads dal idx.sst, #unless does not exist then creates first + def get_idx_sst #reads ao idx.sst, #unless does not exist then creates first begin - dal=[] + ao=[] unless @@fns==@opt.fns \ or @@fns==@fnx @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ @@ -161,7 +161,7 @@ module SiSU_AO : @opt.fns @@idx_arr[:sst]=[] end - dal=(@@idx_arr[:sst].empty?) ? read_idx_sst : @@idx_arr[:sst].dup #check + ao=(@@idx_arr[:sst].empty?) ? read_idx_sst : @@idx_arr[:sst].dup #check rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -172,7 +172,7 @@ module SiSU_AO end def get_idx_raw begin - dal=[] + ao=[] unless @@fns==@opt.fns \ or @@fns==@fnx @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ @@ -180,7 +180,7 @@ module SiSU_AO : @opt.fns @@idx_arr[:tex]=[] end - dal=(@@idx_arr[:tex].empty?) ? read_idx_raw : @@idx_arr[:tex].dup #check + ao=(@@idx_arr[:tex].empty?) ? read_idx_raw : @@idx_arr[:tex].dup #check rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -189,9 +189,9 @@ module SiSU_AO SiSU_AO::Instantiate.new end end - def get_idx_html #reads dal idx.html, #unless does not exist then creates first + def get_idx_html #reads ao idx.html, #unless does not exist then creates first begin - dal=[] + ao=[] unless @@fns==@opt.fns \ or @@fns==@fnx @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ @@ -199,7 +199,7 @@ module SiSU_AO : @opt.fns @@idx_arr[:html]=[] end - dal=(@@idx_arr[:html].empty?) ? read_idx_html : @@idx_arr[:html].dup + ao=(@@idx_arr[:html].empty?) ? read_idx_html : @@idx_arr[:html].dup rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -208,9 +208,9 @@ module SiSU_AO SiSU_AO::Instantiate.new end end - def get_idx_xhtml #reads dal idx.xhtml, #unless does not exist then creates first + def get_idx_xhtml #reads ao idx.xhtml, #unless does not exist then creates first begin - dal=[] + ao=[] unless @@fns==@opt.fns \ or @@fns==@fnx @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ @@ -218,7 +218,7 @@ module SiSU_AO : @opt.fns @@idx_arr[:xthml]=[] end - dal=(@@idx_arr[:xhtml].empty?) ? read_idx_xhtml : @@idx_arr[:xhtml].dup + ao=(@@idx_arr[:xhtml].empty?) ? read_idx_xhtml : @@idx_arr[:xhtml].dup rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -227,9 +227,9 @@ module SiSU_AO SiSU_AO::Instantiate.new end end - def get_map_nametags #reads dal map.nametags, #unless does not exist then creates first + def get_map_nametags #reads ao map.nametags, #unless does not exist then creates first begin - dal=[] + ao=[] unless @@fns==@opt.fns \ or @@fns==@fnx @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ @@ -237,7 +237,7 @@ module SiSU_AO : @opt.fns @@map_arr[:nametags]=[] end - dal=(@@map_arr[:nametags].empty?) ? read_map_nametags : @@map_arr[:nametags].dup + ao=(@@map_arr[:nametags].empty?) ? read_map_nametags : @@map_arr[:nametags].dup rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -246,9 +246,9 @@ module SiSU_AO SiSU_AO::Instantiate.new end end - def get_map_ocn_htmlseg #reads dal map.ocn_htmlseg, #unless does not exist then creates first + def get_map_ocn_htmlseg #reads ao map.ocn_htmlseg, #unless does not exist then creates first begin - dal=[] + ao=[] unless @@fns==@opt.fns \ or @@fns==@fnx @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \ @@ -256,7 +256,7 @@ module SiSU_AO : @opt.fns @@map_arr[:ocn_htmlseg]=[] end - dal=(@@map_arr[:ocn_htmlseg].empty?) ? read_map_ocn_htmlseg : @@map_arr[:ocn_htmlseg].dup + ao=(@@map_arr[:ocn_htmlseg].empty?) ? read_map_ocn_htmlseg : @@map_arr[:ocn_htmlseg].dup rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -266,8 +266,8 @@ module SiSU_AO end end protected - def create_dal - dal_array=[] + def create_ao + ao_array=[] unless @opt.act[:quiet][:set]==:on tell=(@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ @@ -285,7 +285,7 @@ module SiSU_AO meta=file_array=@env.source_file_processing_array(fn) @md=SiSU_Param::Parameters::Instructions.new(meta,@opt).extract meta=nil - dal=SiSU_AO::Make.new(fn,@md,file_array).song + ao=SiSU_AO::Make.new(fn,@md,file_array).song if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) @@ -294,12 +294,12 @@ module SiSU_AO || @opt.act[:verbose_plus][:set]==:on) SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"~meta/#{@opt.fns}.meta").output elsif @opt.act[:maintenance][:set]==:on - SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"dal -> #{cf.meta}").txt_grey + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"ao -> #{cf.meta}").txt_grey end end - dal.each {|s| dal_array << s} + ao.each {|s| ao_array << s} if @opt.act[:maintenance][:set]==:on - dal_array.each do |obj| + ao_array.each do |obj| if defined? obj.parent if defined? obj.ln if defined? obj.node @@ -317,19 +317,19 @@ module SiSU_AO end end end - dal_array + ao_array end def read_fnm - dal=[] - dal=(FileTest.file?(@fnm)) \ - ? (File.open(@fnm,'r:utf-8'){ |f| dal=Marshal.load(f)}) - : SiSU_AO::Source.new(@opt).create_dal + ao=[] + ao=(FileTest.file?(@fnm)) \ + ? (File.open(@fnm,'r:utf-8'){ |f| ao=Marshal.load(f)}) + : SiSU_AO::Source.new(@opt).create_ao end def read_fnc - dal=[] - dal=(FileTest.file?(@fnc)) \ - ? (File.open(@fnc,'r:utf-8'){ |f| dal=Marshal.load(f)}) - : SiSU_AO::Source.new(@opt).create_dal + ao=[] + ao=(FileTest.file?(@fnc)) \ + ? (File.open(@fnc,'r:utf-8'){ |f| ao=Marshal.load(f)}) + : SiSU_AO::Source.new(@opt).create_ao end def read_idx_sst m=[] @@ -439,21 +439,21 @@ module SiSU_AO end end else - hard="#{@dir.processing_path.dal}/#{@md.fns}.meta" + hard="#{@dir.processing_path.ao}/#{@md.fns}.meta" File.unlink(hard) if FileTest.file?(hard) - hard="#{@dir.processing_path.dal}/#{@md.fns}.txt" + hard="#{@dir.processing_path.ao}/#{@md.fns}.txt" File.unlink(hard) if FileTest.file?(hard) - hard="#{@dir.processing_path.dal}/#{@md.fns}.debug.txt" + hard="#{@dir.processing_path.ao}/#{@md.fns}.debug.txt" File.unlink(hard) if FileTest.file?(hard) end end def make_marshal_content - marshal_dal=@make.marshal.dal_content - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) + marshal_ao=@make.marshal.ao_content + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_metadata - marshal_dal=@make.marshal.dal_metadata - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) + marshal_ao=@make.marshal.ao_metadata + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def idx_html_hard_output if @md.book_idx \ @@ -464,33 +464,33 @@ module SiSU_AO @data.each {|s| filename_meta.puts s.strip + "\n" unless s.strip.empty?} end else - hard_idx_html="#{@dir.processing_path.dal}/#{@md.fns}.idx.html" + hard_idx_html="#{@dir.processing_path.ao}/#{@md.fns}.idx.html" File.unlink(hard_idx_html) if FileTest.file?(hard_idx_html) end end def make_marshal_idx_sst_html_seg - marshal_dal=@make.marshal.dal_idx_sst_rel_html_seg - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) + marshal_ao=@make.marshal.ao_idx_sst_rel_html_seg + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_idx_sst_rel - marshal_dal=@make.marshal.dal_idx_sst_rel - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) + marshal_ao=@make.marshal.ao_idx_sst_rel + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_idx_html - marshal_dal=@make.marshal.dal_idx_html - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) + marshal_ao=@make.marshal.ao_idx_html + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_idx_xhtml - marshal_dal=@make.marshal.dal_idx_xhtml - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) + marshal_ao=@make.marshal.ao_idx_xhtml + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_map_nametags - marshal_dal=@make.marshal.dal_map_nametags - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Hash) + marshal_ao=@make.marshal.ao_map_nametags + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Hash) end def make_marshal_map_name_ocn_htmlseg - marshal_dal=@make.marshal.dal_map_ocn_htmlseg - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Hash) + marshal_ao=@make.marshal.ao_map_ocn_htmlseg + File.open(marshal_ao,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Hash) end end class Make @@ -505,17 +505,17 @@ module SiSU_AO def song reset data=@data - data=SiSU_AO_Insertions::Insertions.new(@md,data).expand_insertions? # dal_expand_insertions.rb - data=SiSU_AO_MiscArrangeText::SI.new(@md,data).prepare_text # dal_misc_arrange.rb - data,metadata=SiSU_AO_DocumentStructureExtract::Build.new(@md,data).identify_parts # dal_doc_str.rb - data=SiSU_AO_Syntax::Markup.new(@md,data).songsheet # dal_syntax.rb - data,endnote_array=SiSU_AO_CharacterCheck::Check.new(data).character_check_and_oldstyle_endnote_array # dal_character_check.rb - data=SiSU_AO_Images::Images.new(@md,data).images # dal_images.rb - data,tags_map,ocn_html_seg_map=SiSU_AO_Numbering::Numbering.new(@md,data).numbering_song # dal_numbering.rb - data,book_index_rel,book_index_rel_html_seg,html_idx,xhtml_idx=SiSU_AO_BookIndex::BookIndex.new(@md,data,@env).indexing_song if @md.book_idx # dal_idx.rb - data=SiSU_AO_Endnotes::Endnotes.new(@md,data,endnote_array).endnotes # dal_endnotes.rb + data=SiSU_AO_Insertions::Insertions.new(@md,data).expand_insertions? # ao_expand_insertions.rb + data=SiSU_AO_MiscArrangeText::SI.new(@md,data).prepare_text # ao_misc_arrange.rb + data,metadata=SiSU_AO_DocumentStructureExtract::Build.new(@md,data).identify_parts # ao_doc_str.rb + data=SiSU_AO_Syntax::Markup.new(@md,data).songsheet # ao_syntax.rb + data,endnote_array=SiSU_AO_CharacterCheck::Check.new(data).character_check_and_oldstyle_endnote_array # ao_character_check.rb + data=SiSU_AO_Images::Images.new(@md,data).images # ao_images.rb + data,tags_map,ocn_html_seg_map=SiSU_AO_Numbering::Numbering.new(@md,data).numbering_song # ao_numbering.rb + data,book_index_rel,book_index_rel_html_seg,html_idx,xhtml_idx=SiSU_AO_BookIndex::BookIndex.new(@md,data,@env).indexing_song if @md.book_idx # ao_idx.rb + data=SiSU_AO_Endnotes::Endnotes.new(@md,data,endnote_array).endnotes # ao_endnotes.rb outputdata=data - if (@md.opt.act[:dal][:set]==:on \ + if (@md.opt.act[:ao][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) SiSU_AO::Output.new(@fn,@md,outputdata).hard_output SiSU_AO::Output.new(@fn,@md,outputdata).make_marshal_content |