Class: SiSU::HubClose

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/hub.rb

Instance Method Summary collapse

Constructor Details

#initialize(call_path, argv) ⇒ HubClose

Returns a new instance of HubClose.



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/sisu/hub.rb', line 258

def initialize(call_path,argv)
  begin
    env=SiSU_Env::InfoEnv.new
  rescue
  ensure
    if FileTest.directory?(env.processing_path.processing) \
    and FileTest.directory?(env.processing_path.processing_base_tmp) \
    and env.processing_path.processing_base_tmp =~/#{env.processing_path.processing}/ \
    and env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/ \
    and not argv.inspect =~/"--maintenance"|"-M"/
      FileUtils::cd(env.processing_path.processing_base_tmp) do
        FileUtils::rm_rf('.')
      end
    end
    Dir.chdir(call_path)
  end
end