aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-07-07 01:37:55 -0400
committerRalph Amissah <ralph@amissah.com>2014-07-07 01:37:55 -0400
commitea8c79ccb94c29daa34246dc3125b23406b9a8ac (patch)
treea6a2e24a0b20831efb8af2fcea5241fdddd59a3c /bin
parentdebian/changelog (5.4.4-1) (diff)
parentsisu.org, README minor (diff)
Merge tag 'sisu_5.4.5' into debian/sid
SiSU 5.4.5
Diffstat (limited to 'bin')
-rw-r--r--bin/sisu76
1 files changed, 47 insertions, 29 deletions
diff --git a/bin/sisu b/bin/sisu
index c53438f3..51840e07 100644
--- a/bin/sisu
+++ b/bin/sisu
@@ -28,7 +28,8 @@ class Orient
and File.dirname(processing.file_full_path) != Config::CONFIG['bindir']
:full_path_to_sisu_bin_in_sisu_dir_tree
elsif processing.file_full_path =~/\/gems\// \
- and processing.file_full_path =~/\/sisu-[#{version.stable}#{version.unstable}]\.(?:\d+|[a-z])\.(?:\d+|[a-z])\//
+ and processing.file_full_path \
+ =~ /\/sisu-[#{version.stable}#{version.unstable}]\.(?:\d+|[a-z])\.(?:\d+|[a-z])\//
:gem_install
else
:system_install
@@ -113,11 +114,14 @@ class Orient
end
def paths_set
if sisu_run_from == :system_install \
- and processing.called_as =~ /^#{Config::CONFIG['bindir']}\/sisu[#{version.stable}#{version.unstable}]?$/
+ and processing.called_as \
+ =~ /^#{Config::CONFIG['bindir']}\/sisu[#{version.stable}#{version.unstable}]?$/
:set_path_system
elsif sisu_run_from == :full_path_to_sisu_bin_in_sisu_dir_tree \
- and processing.called_as !~ /^#{Config::CONFIG['bindir']}\/sisu[#{version.stable}#{version.unstable}]?$/ \
- && File.expand_path(processing.called_as) =~/bin\/sisu[#{version.stable}#{version.unstable}]?$/ \
+ and processing.called_as \
+ !~ /^#{Config::CONFIG['bindir']}\/sisu[#{version.stable}#{version.unstable}]?$/ \
+ && File.expand_path(processing.called_as) \
+ =~ /bin\/sisu[#{version.stable}#{version.unstable}]?$/ \
&& FileTest.file?(processing.called_as)
:set_dir_tree_full_path
elsif sisu_run_from==:gem_install
@@ -130,7 +134,8 @@ class Orient
when :set_path_system
Config::CONFIG['datadir'] + '/sisu'
when :set_dir_tree_full_path
- File.expand_path(processing.called_as).sub(/\/bin\/sisu[#{version.stable}#{version.unstable}]?$/,'')
+ File.expand_path(processing.called_as).
+ sub(/\/bin\/sisu[#{version.stable}#{version.unstable}]?$/,'')
when :set_gem_path
Gem::Specification.find_by_name("sisu").gem_dir
else nil
@@ -141,15 +146,18 @@ class Orient
when :set_path_system
Config::CONFIG['datadir'] + '/sisu'
when :set_dir_tree_full_path
- File.expand_path(processing.called_as).sub(/\/bin\/sisu[#{version.stable}#{version.unstable}]?$/,'/data/sisu')
+ File.expand_path(processing.called_as).
+ sub(/\/bin\/sisu[#{version.stable}#{version.unstable}]?$/,'/data/sisu')
when :set_gem_path
Gem::Specification.find_by_name("sisu").gem_dir + '/data/sisu'
else nil
end
end
def sisu_path_specified_lib
- if (processing.called_as !~ /^#{Config::CONFIG['bindir']}\/sisu[#{version.stable}#{version.unstable}]?$/)
- File.expand_path(processing.called_as).sub(/bin\/sisu[#{version.stable}#{version.unstable}]?$/,'lib')
+ if (processing.called_as \
+ !~ /^#{Config::CONFIG['bindir']}\/sisu[#{version.stable}#{version.unstable}]?$/)
+ File.expand_path(processing.called_as).
+ sub(/bin\/sisu[#{version.stable}#{version.unstable}]?$/,'lib')
else nil
end
end
@@ -183,7 +191,9 @@ class Orient
command_line_modifiers << x
elsif x =~/\.ss[tm]/
if x =~/\//
- markup_path,markup_file =(/(\S+\/)((?:#{language_list.regex})?[^\/]+)/).match(x)[1,2]
+ markup_path,markup_file =
+ (/(\S+\/)((?:#{language_list.regex})?[^\/]+)/).
+ match(x)[1,2]
if not processing_files[markup_path]
processing_files[markup_path]=[]
end
@@ -212,32 +222,40 @@ class Orient
end
def control
require "#{sisu_is[:path_lib]}/hub"
- if get_processing_info.processing_files. length > 0
+ sisu_called_from_directory
+ if get_processing_info.processing_files.length > 0
get_processing_info.processing_files.each_pair do |markup_dir,markup_file|
- $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)
- 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
+ $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)
+ 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)
+ 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)
- else p "Error directory specified #{markup_dir} not found"
+ ensure
+ Dir.chdir(sisu_called_from_directory)
+ system("cd #{sisu_called_from_directory}")
end
- 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_document_markup_directory_base_fixed_path=
+ Dir.pwd.gsub(/(^|\/)(?:#{language_list.regex})$/,'')
SiSU::HubMaster.new(processing.argv)
end
end