diff options
author | Ralph Amissah <ralph@amissah.com> | 2015-05-01 18:51:40 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2015-05-01 18:51:40 -0400 |
commit | 58d01ddb946f666b2bc70b867314c00b1e78b1e3 (patch) | |
tree | 6ed99ea64d1ad4b02a1c8f901fb6248af9abfe08 /lib/sisu/current/ao_composite.rb | |
parent | debian/changelog (5.8.0-1) (diff) | |
parent | version & changelog, tag for release (diff) |
Merge tag 'sisu_6.5.0' into debian/sid
SiSU 6.5.0
Diffstat (limited to 'lib/sisu/current/ao_composite.rb')
-rw-r--r-- | lib/sisu/current/ao_composite.rb | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/lib/sisu/current/ao_composite.rb b/lib/sisu/current/ao_composite.rb index 611dd70c..24683cba 100644 --- a/lib/sisu/current/ao_composite.rb +++ b/lib/sisu/current/ao_composite.rb @@ -57,6 +57,7 @@ =end module SiSU_Assemble require_relative 'se' # se.rb + require_relative 'utils_composite' # utils_composite.rb class RemoteImage def initialize @env=SiSU_Env::InfoEnv.new @@ -86,7 +87,7 @@ module SiSU_Assemble end end class Composite - @@imager={} + include SiSU_Composite_Doc_Utils # composite doc, .ssm, extract all related insert files, array of filenames test def initialize(opt) @opt=opt @env=SiSU_Env::InfoEnv.new @@ -101,14 +102,14 @@ module SiSU_Assemble 'Composite Document', "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}", ).grey_title_hi unless @opt.act[:quiet][:set]==:on + composite_and_imported_filenames_array(@opt.fno) # composite doc, .ssm, extract all related insert files, array of filenames test assembled=loadfile(@opt.fno) - #assembled=insertions?(fns_array) - write(assembled) write(assembled) end Dir.chdir(pwd) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns). + location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -126,7 +127,6 @@ module SiSU_Assemble end end def loadfile(loadfilename) - tuned_file=[] begin if FileTest.file?(loadfilename) insert_array=IO.readlines(loadfilename,'') @@ -140,18 +140,17 @@ module SiSU_Assemble loadfilename, ).txt_grey end - if loadfilename =~/\S+?\.ss[im]$/ - insert_array.each do |para| - tuned_file << insert?(para) + tuned_file=if loadfilename =~/\S+?\.ss[im]$/ + insert_array.each.map do |para| + insert?(para) end elsif loadfilename =~/\S+?\.sst$/ - insert_array.each do |para| - tuned_file << para + insert_array.each.map do |para| + para end - end + end.flatten.compact end end - tuned_file=tuned_file.flatten.compact rescue SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -162,9 +161,6 @@ module SiSU_Assemble def url(loadfilename) if loadfilename =~ /((?:https?|file):\/\/\S+?\.ss[it])$/ # and NetTest loadfilename=$1 - imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/. - match(loadfilename).captures.join + - '/_sisu/image' #watch begin require 'uri' require 'open-uri' @@ -173,13 +169,10 @@ module SiSU_Assemble SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). error('uri, open-uri or pp NOT FOUND (LoadError)') end - image_uri=URI.parse(imagedir) insert=open(loadfilename) insert_array=insert.dup insert.close file=insertion(loadfilename,insert_array) - @@imager[image_uri] ||=[] - @@imager[image_uri] << file[:images] file[:prepared] end end @@ -238,7 +231,6 @@ module SiSU_Assemble end end class CompositeFileList - @@imager={} def initialize(opt) @opt=opt @env=SiSU_Env::InfoEnv.new |