diff options
Diffstat (limited to 'lib/sisu/v3/sisupod_make.rb')
-rw-r--r-- | lib/sisu/v3/sisupod_make.rb | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb index e2ac4f51..b154bc1d 100644 --- a/lib/sisu/v3/sisupod_make.rb +++ b/lib/sisu/v3/sisupod_make.rb @@ -57,10 +57,8 @@ =end module SiSU_Doc - require 'fileutils' include SiSU_Env class Source - include FileUtils #::Verbose require_relative 'sysenv' # sysenv.rb require_relative 'response' # response.rb require_relative 'particulars' # particulars.rb @@ -79,8 +77,8 @@ module SiSU_Doc @zipfile=(@opt.fns =~/\.ssm\.sst$/) \ ? @opt.fns.gsub(/(?:\~\S{2,3})?\.ssm\.sst$/,'.ssm') : @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1') - mkdir_p(pod_path) unless FileTest.directory?(pod_path) - rm_rf("#{@env.processing_path.processing}sisupod/*") if FileTest.directory?("#{@env.processing_path.processing}sisupod") + FileUtils::mkdir_p(pod_path) unless FileTest.directory?(pod_path) + FileUtils::rm_rf("#{@env.processing_path.processing}sisupod/*") if FileTest.directory?("#{@env.processing_path.processing}sisupod") end def read unless @opt.cmd =~/q/ @@ -224,7 +222,7 @@ module SiSU_Doc and docskin #imperfect, revisit unless skin_source[:name].nil? \ or skin_source[:name].empty? - cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb") + FileUtils::cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb") skinfile_array=IO.readlines(skin_source[:name],'') para_images=[] skinfile_array.each do |f| #% work area @@ -255,13 +253,13 @@ module SiSU_Doc #Dir.chdir(image_source_base) #base_images=Dir.glob('*') #base_images.each do |i| - # cp_r(i,"#{images_path_pod}/#{i}") + # FileUtils::cp_r(i,"#{images_path_pod}/#{i}") #end #Dir.chdir(dir_pwd) if FileTest.directory?(images_pwd) images=images.uniq images.each do |i| - cp_r("#{images_pwd}/#{i}","#{images_path_pod}/#{i}") if FileTest.file?("#{images_pwd}/#{i}") + FileUtils::cp_r("#{images_pwd}/#{i}","#{images_path_pod}/#{i}") if FileTest.file?("#{images_pwd}/#{i}") end else puts "\tWARN, did not find - #{images_pwd} #{images_path_pod}" end @@ -269,7 +267,7 @@ module SiSU_Doc if doc_import.length > 0 \ and use_file =~/\.ssm$/ doc_import.each do |f| - cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f}","#{@env.processing_path.processing}/sisupod/doc/#{@opt.lng}/#{f}") + FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f}","#{@env.processing_path.processing}/sisupod/doc/#{@opt.lng}/#{f}") end end x=@env.document_language_versions_found #check multiple document language versions (param not used) @@ -277,13 +275,13 @@ module SiSU_Doc and x[:f].length > 0 #store multiple document language versions, sisupod x[:f].each do |f| (use_file =~/\.ssm$/) \ - ? cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}") - : cp_r("#{@env.path.pwd}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}") + ? FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}") + : FileUtils::cp_r("#{@env.path.pwd}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}") end end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end def sisupod_xz - mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir) + FileUtils::mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir) tree=(@opt.cmd =~/[vVM]/ \ && SiSU_Env::System_call.new.program_found?('tree')) \ ? 'tree sisupod' @@ -294,9 +292,9 @@ module SiSU_Doc #{tree} tar -cJf #{@zipfile}.txz sisupod #echo "#{@file.place_file.sisupod.dir}" - mv #{@zipfile}.txz #{@file.place_file.sisupod.dir} & - rm -r sisupod/* }) + FileUtils::mv("#{@zipfile}.txz", @file.place_file.sisupod.dir) + FileUtils::rm_r(Dir.glob("sisupod/*")) Dir.chdir(@env.path.pwd) SiSU_Screen::Ansi.new('',"#{@opt.fns}.txz").blue_tab unless @opt.cmd =~/q/ else |