Class: SiSU_libs::HubClose

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

Instance Method Summary collapse

Constructor Details

#initialize(argv, call_path) ⇒ HubClose

Returns a new instance of HubClose.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/sisu.rb', line 75

def initialize(argv,call_path)
  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