aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-07-22 21:32:30 -0400
committerRalph Amissah <ralph@amissah.com>2014-07-22 21:32:30 -0400
commite1af490a06710b65ac1b0d40e856b2e656a74a66 (patch)
treeda7ad28e75b264c430b4691292db38fcc5971733 /lib
parentv5 v6: cosmetic code (diff)
v5 v6: bin/sisu, hub, hub close (ensure), remove /tmp/ processing dir
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v5/hub.rb23
-rw-r--r--lib/sisu/v6/hub.rb23
2 files changed, 42 insertions, 4 deletions
diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb
index 6a0f4640..510e2092 100644
--- a/lib/sisu/v5/hub.rb
+++ b/lib/sisu/v5/hub.rb
@@ -93,6 +93,22 @@ module SiSU
end
end
end
+ class HubClose
+ def initialize(call_path)
+ begin
+ @env=SiSU_Env::InfoEnv.new
+ rescue
+ ensure
+ if FileTest.directory?(@env.processing_path.processing) \
+ and @env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/
+ FileUtils::cd(@env.processing_path.processing_base_tmp) do
+ FileUtils::rm_rf('.')
+ end
+ end
+ Dir.chdir(call_path)
+ end
+ end
+ end
class OptionLoopFiles
attr_reader :opt
def initialize(opt)
@@ -111,6 +127,7 @@ module SiSU
@opt.pth=@opt.f_pths[i][:pth]
@opt.lng=@opt.f_pths[i][:lng]
Dir.chdir(@opt.f_pth[:pth]) #watch
+ SiSU_Env::FilenameLanguageCodeInsert.new(@opt,@opt.lng).language_code_insert # ... track
@env=SiSU_Env::InfoEnv.new(fno)
yield
end
@@ -784,8 +801,10 @@ module SiSU
and @@env.user \
and FileTest.directory?(@@env.processing_path.processing) \
and @@env.processing_path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area
- FileUtils::cd(@@env.processing_path.processing_base_tmp) do
- FileUtils::rm_rf(@@env.user) unless @opt.act[:maintenance][:set] ==:on
+ if @@env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/
+ FileUtils::cd(@@env.processing_path.processing_base_tmp) do
+ FileUtils::rm_rf('.') unless @opt.act[:maintenance][:set] ==:on
+ end
end
end
elsif action_on_file_ == :true \
diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb
index 1818a714..e061ee46 100644
--- a/lib/sisu/v6/hub.rb
+++ b/lib/sisu/v6/hub.rb
@@ -93,6 +93,22 @@ module SiSU
end
end
end
+ class HubClose
+ def initialize(call_path)
+ begin
+ @env=SiSU_Env::InfoEnv.new
+ rescue
+ ensure
+ if FileTest.directory?(@env.processing_path.processing) \
+ and @env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/
+ FileUtils::cd(@env.processing_path.processing_base_tmp) do
+ FileUtils::rm_rf('.')
+ end
+ end
+ Dir.chdir(call_path)
+ end
+ end
+ end
class OptionLoopFiles
attr_reader :opt
def initialize(opt)
@@ -111,6 +127,7 @@ module SiSU
@opt.pth=@opt.f_pths[i][:pth]
@opt.lng=@opt.f_pths[i][:lng]
Dir.chdir(@opt.f_pth[:pth]) #watch
+ SiSU_Env::FilenameLanguageCodeInsert.new(@opt,@opt.lng).language_code_insert # ... track
@env=SiSU_Env::InfoEnv.new(fno)
yield
end
@@ -784,8 +801,10 @@ module SiSU
and @@env.user \
and FileTest.directory?(@@env.processing_path.processing) \
and @@env.processing_path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area
- FileUtils::cd(@@env.processing_path.processing_base_tmp) do
- FileUtils::rm_rf(@@env.user) unless @opt.act[:maintenance][:set] ==:on
+ if @@env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/
+ FileUtils::cd(@@env.processing_path.processing_base_tmp) do
+ FileUtils::rm_rf('.') unless @opt.act[:maintenance][:set] ==:on
+ end
end
end
elsif action_on_file_ == :true \