From e1af490a06710b65ac1b0d40e856b2e656a74a66 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2014 21:32:30 -0400 Subject: v5 v6: bin/sisu, hub, hub close (ensure), remove /tmp/ processing dir --- bin/sisu | 67 +++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 30 deletions(-) (limited to 'bin') diff --git a/bin/sisu b/bin/sisu index ffc5a8a5..44263adc 100644 --- a/bin/sisu +++ b/bin/sisu @@ -225,40 +225,47 @@ class Orient def control require "#{sisu_is[:path_lib]}/hub" sisu_called_from_directory - if get_processing_info.processing_files.length > 0 - get_processing_info.processing_files.each_pair do |markup_dir,markup_file| - begin - $sisu_document_markup_directory=markup_dir.gsub(/\/$/,'') - argv_sub=get_processing_info.command_line_modifiers + markup_file - if FileTest.directory?(markup_dir) - system("cd #{markup_dir}") - Dir.chdir(markup_dir) - $sisu_document_markup_directory_base_fixed_path= - Dir.pwd.gsub(/\/(?:#{language_list.regex})$/,'') - SiSU::HubMaster.new(argv_sub,sisu_called_from_directory) - elsif markup_dir =~/https?:/ - markup_file.each do |mf| - (FileTest.file?(mf)) \ - ? (puts 'requested remote file already exists in current directory ' \ - + Dir.pwd + ' using ' + mf) - : (system("wget #{markup_dir}/#{mf}")) + begin + if get_processing_info.processing_files.length > 0 + get_processing_info.processing_files.each_pair do |markup_dir,markup_file| + begin + $sisu_document_markup_directory=markup_dir.gsub(/\/$/,'') + argv_sub=get_processing_info.command_line_modifiers + markup_file + if FileTest.directory?(markup_dir) + system("cd #{markup_dir}") + Dir.chdir(markup_dir) + $sisu_document_markup_directory_base_fixed_path= + Dir.pwd.gsub(/\/(?:#{language_list.regex})$/,'') + SiSU::HubMaster.new(argv_sub,sisu_called_from_directory) + elsif markup_dir =~/https?:/ + markup_file.each do |mf| + (FileTest.file?(mf)) \ + ? (puts 'requested remote file already exists in current directory ' \ + + Dir.pwd + ' using ' + mf) + : (system("wget #{markup_dir}/#{mf}")) + end + $sisu_document_markup_directory_base_fixed_path= + Dir.pwd.gsub(/\/(?:#{language_list.regex})$/,'') + argv_sub=command_line_modifiers + markup_file + SiSU::HubMaster.new(argv_sub,sisu_called_from_directory) + else p "Error directory specified #{markup_dir} not found" end - $sisu_document_markup_directory_base_fixed_path= - Dir.pwd.gsub(/\/(?:#{language_list.regex})$/,'') - argv_sub=command_line_modifiers + markup_file - SiSU::HubMaster.new(argv_sub,sisu_called_from_directory) - else p "Error directory specified #{markup_dir} not found" + ensure + Dir.chdir(sisu_called_from_directory) + system("cd #{sisu_called_from_directory}") end - ensure - Dir.chdir(sisu_called_from_directory) - system("cd #{sisu_called_from_directory}") end + else + $sisu_document_markup_directory=Dir.pwd.gsub(/\/$/,'') + $sisu_document_markup_directory_base_fixed_path= + Dir.pwd.gsub(/(^|\/)(?:#{language_list.regex})$/,'') + SiSU::HubMaster.new(processing.argv,sisu_called_from_directory) end - else - $sisu_document_markup_directory=Dir.pwd.gsub(/\/$/,'') - $sisu_document_markup_directory_base_fixed_path= - Dir.pwd.gsub(/(^|\/)(?:#{language_list.regex})$/,'') - SiSU::HubMaster.new(processing.argv,sisu_called_from_directory) + rescue + ensure + SiSU::HubClose.new(sisu_called_from_directory) + Dir.chdir(sisu_called_from_directory) + system("cd #{sisu_called_from_directory}") end end end -- cgit v1.2.3