diff options
Diffstat (limited to 'lib/sisu/v3/sisupod_make.rb')
-rw-r--r-- | lib/sisu/v3/sisupod_make.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb index 5607bb1f..21255bb7 100644 --- a/lib/sisu/v3/sisupod_make.rb +++ b/lib/sisu/v3/sisupod_make.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -61,9 +61,9 @@ module SiSU_Doc include SiSU_Env class Source include FileUtils #::Verbose - require "#{SiSU_lib}/sysenv" # sysenv.rb - require "#{SiSU_lib}/response" # response.rb - require "#{SiSU_lib}/particulars" # particulars.rb + require_relative 'sysenv' # sysenv.rb + require_relative 'response' # response.rb + require_relative 'particulars' # particulars.rb def initialize(opt) @opt=opt m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @@ -71,7 +71,7 @@ module SiSU_Doc @env=SiSU_Env::Info_env.new(@opt.fns) @ver=SiSU_Env::Info_version.instance.get_version @ans=SiSU_Response::Response.new - pod_path="#{@env.path.processing}/sisupod" + pod_path="#{@env.processing_path.processing}/sisupod" @v=if @opt.cmd =~/[VM]/; 'v' else '' end @@ -82,7 +82,7 @@ module SiSU_Doc else @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1') end mkdir_p(pod_path) unless FileTest.directory?(pod_path) - rm_rf("#{@env.path.processing}sisupod/*") if FileTest.directory?("#{@env.path.processing}sisupod") + rm_rf("#{@env.processing_path.processing}sisupod/*") if FileTest.directory?("#{@env.processing_path.processing}sisupod") end def read unless @opt.cmd =~/q/ @@ -146,7 +146,7 @@ module SiSU_Doc "#{@env.path.pwd}/_sisu/skin", "#{@env.path.home}/.sisu/skin", '/etc/sisu/skin', - "#{@env.path.processing}/external_document/skin" + "#{@env.processing_path.processing}/external_document/skin" ] sk_doc,sk_dir="doc/#{skin}.rb","dir/skin_#{@env.stub_pwd}.rb" skin_path.each do |v| #document skin priority 1 @@ -171,7 +171,7 @@ module SiSU_Doc @rgx_skin=/^\s+:skin:\s+(\S+)/ @rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/ use_file=@opt.fns =~/(?:\.ssm|\.ssm\.sst)$/ \ - ? "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" \ + ? "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" \ : @opt.fns file_array=IO.readlines(use_file,'') skin,images,doc_import=[],[],[] @@ -195,7 +195,7 @@ module SiSU_Doc else skin_source=select end - docskin_place="#{@env.path.processing}/sisupod/_sisu/skin/#{skin_source[:type]}" + docskin_place="#{@env.processing_path.processing}/sisupod/_sisu/skin/#{skin_source[:type]}" if skin_source[:type] =~/dir/ docskin_with_path="#{docskin_place}/skin_#{@env.stub_pwd}.rb" docskin=[docskin_with_path.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')] @@ -225,7 +225,7 @@ module SiSU_Doc images.delete_if {|x| x =~/https?:\/\// } #images.sort! image_path_pwd='_sisu/image' - path_pod_conf="#{@env.path.processing}/sisupod/_sisu" + path_pod_conf="#{@env.processing_path.processing}/sisupod/_sisu" images_path_pod="#{path_pod_conf}/image" #unattractive hard coding ... ! images_pwd="#{@env.path.pwd}/#{image_path_pwd}" @@ -251,24 +251,24 @@ module SiSU_Doc if doc_import.flatten.length > 0 \ and @opt.fns =~/\.ssm\.sst$/ doc_import.flatten.each do |f| - cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}") + cp_r("#{@env.path.pwd}/#{f}","#{@env.processing_path.processing}/sisupod/#{f}") end end if x[:f] \ and x[:f].length > 1 #store multiple document language versions, sisupod x[:f].each do |f| - cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}") + cp_r("#{@env.path.pwd}/#{f}","#{@env.processing_path.processing}/sisupod/#{f}") end elsif @opt.fns =~/\.ssm\.sst/ ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm') - cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}") - else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}") + cp_r("#{@env.path.pwd}/#{ssm}","#{@env.processing_path.processing}/sisupod/#{ssm}") + else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.processing_path.processing}/sisupod/#{@opt.fns}") end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end def sisupod_7zip #look at later mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) system(%{ - cd #{@env.path.processing} + cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt #7zip -qz #{@opt.fns}.7z sisu_zip.txt < sisu_zip.txt 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@zipfile}.7z sisu_zip.txt @@ -282,7 +282,7 @@ module SiSU_Doc def sisupod_zip mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) system(%{ - cd #{@env.path.processing} + cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt zip -qz #{@zipfile}.zip sisu_zip.txt < sisu_zip.txt zip -qr #{@zipfile}.zip sisupod |