diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-10-01 16:12:14 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-10-01 16:12:14 -0400 |
commit | 52e870e3e04b3848d024e144ffb2a7f26b078cb3 (patch) | |
tree | e33e864b661903a4eb59c399ff160a53d4824028 /lib/sisu/v3/dal.rb | |
parent | v3: some fixes, cleaning, removing (diff) |
v3: dal, sysenv, file processing, split objects; remove ref to old ruby
* markup file processing, change to sourcefile readlines & split of sourcefile array
* removal of RUBY_VERSION references to older versions of ruby
Diffstat (limited to 'lib/sisu/v3/dal.rb')
-rw-r--r-- | lib/sisu/v3/dal.rb | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index a03ed55c..0e816091 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -273,13 +273,7 @@ module SiSU_DAL if @opt.fno =~/\.txz$/ Dir.chdir(@opt.f_pth[:pth]) end - file_array=@env.read_source_file(fn) - file_array.each do |l| - if l =~/\r\n/ then l.gsub!(/\r\n/,"\n") - end - end - meta=file_array.dup - meta=meta.join.split("\n\n") #check whether can be eliminated, some of these are large objects to have twice + meta=file_array=@env.source_file_processing_array(fn) @md=SiSU_Param::Parameters::Instructions.new(meta,@opt).extract meta=nil dal=SiSU_DAL::Make.new(fn,@md,file_array).song @@ -294,72 +288,56 @@ module SiSU_DAL def read_fnm dal=[] dal=if FileTest.file?(@fnm) - (RUBY_VERSION < '1.9') \ - ? (File.open(@fnm){ |f| dal=Marshal.load(f)}) - : (File.open(@fnm,'r:utf-8'){ |f| dal=Marshal.load(f)}) + File.open(@fnm,'r:utf-8'){ |f| dal=Marshal.load(f)} else SiSU_DAL::Source.new(@opt).create_dal end end def read_fnc dal=[] dal=if FileTest.file?(@fnc) - (RUBY_VERSION < '1.9') \ - ? (File.open(@fnc){ |f| dal=Marshal.load(f)}) - : (File.open(@fnc,'r:utf-8'){ |f| dal=Marshal.load(f)}) + File.open(@fnc,'r:utf-8'){ |f| dal=Marshal.load(f)} else SiSU_DAL::Source.new(@opt).create_dal end end def read_idx_sst m=[] m=if FileTest.file?(@idx_sst) - (RUBY_VERSION < '1.9') \ - ? (File.open(@idx_sst){ |f| m=Marshal.load(f)}) - : (File.open(@idx_sst,'r:utf-8'){ |f| m=Marshal.load(f)}) + File.open(@idx_sst,'r:utf-8'){ |f| m=Marshal.load(f)} else nil end end def read_idx_raw m=[] m=if FileTest.file?(@idx_raw) - (RUBY_VERSION < '1.9') \ - ? (File.open(@idx_raw){ |f| m=Marshal.load(f)}) - : (File.open(@idx_raw,'r:utf-8'){ |f| m=Marshal.load(f)}) + File.open(@idx_raw,'r:utf-8'){ |f| m=Marshal.load(f)} else nil end end def read_idx_html m=[] m=if FileTest.file?(@idx_html) - (RUBY_VERSION < '1.9') \ - ? (File.open(@idx_html){ |f| m=Marshal.load(f)}) - : (File.open(@idx_html,'r:utf-8'){ |f| m=Marshal.load(f)}) + File.open(@idx_html,'r:utf-8'){ |f| m=Marshal.load(f)} else nil end end def read_idx_xhtml m=[] m=if FileTest.file?(@idx_xhtml) - (RUBY_VERSION < '1.9') \ - ? (File.open(@idx_xhtml){ |f| m=Marshal.load(f)}) - : (File.open(@idx_xhtml,'r:utf-8'){ |f| m=Marshal.load(f)}) + File.open(@idx_xhtml,'r:utf-8'){ |f| m=Marshal.load(f)} else nil end end def read_map_nametags m=[] m=if FileTest.file?(@map_nametags) - (RUBY_VERSION < '1.9') \ - ? (File.open(@map_nametags){ |f| m=Marshal.load(f)}) - : (File.open(@map_nametags,'r:utf-8'){ |f| m=Marshal.load(f)}) + File.open(@map_nametags,'r:utf-8'){ |f| m=Marshal.load(f)} else nil end end def read_map_ocn_htmlseg m=[] m=if FileTest.file?(@map_ocn_htmlseg) - (RUBY_VERSION < '1.9') \ - ? (File.open(@map_ocn_htmlseg){ |f| m=Marshal.load(f)}) - : (File.open(@map_ocn_htmlseg,'r:utf-8'){ |f| m=Marshal.load(f)}) + File.open(@map_ocn_htmlseg,'r:utf-8'){ |f| m=Marshal.load(f)} else nil end end @@ -501,7 +479,6 @@ module SiSU_DAL def song reset data=@data - data=data.join.split("\n\n") data=SiSU_DAL_Insertions::Insertions.new(@md,data).expand_insertions? # dal_expand_insertions.rb data=SiSU_DAL_SubstituteAndInsert::SI.new(@md,data).substitutions_and_insertions? # dal_substitutions_and_insertions.rb data,metadata=SiSU_DAL_DocumentStructureExtract::Build.new(@md,data).identify_parts # dal_doc_str.rb |