Class: Dev::Cmd::Clean

Inherits:
Object
  • Object
show all
Defined in:
lib/dev/cmd/Clean.rb

Class Method Summary collapse

Class Method Details

.clean_tmpObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dev/cmd/Clean.rb', line 7

def self.clean_tmp
  puts_debug "Dev::Cmd::Clean.clean_temp"
  begin
    status=Timeout::timeout(30){
   puts_debug "tmp dir=#{Dir.tmpdir}"
   if File.exists?(Dir.tmpdir)
     if RUBY_PLATFORM.include?("w32")
       cmd="del /Q #{Dir.tmpdir.gsub('/','\\')}"
    puts_debug cmd
       `#{cmd}` if RUBY_PLATFORM.include?("w32")
     end
end
 }
  rescue
 puts_debug "timeout met."
  end
end