123456789_123456789_123456789_123456789_123456789_

Class: Tempfile::Remover

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/tempfile.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(path) ⇒ Remover

[ GitHub ]

  
# File 'lib/tempfile.rb', line 309

def initialize(path)
  @pid = Process.pid
  @path = path
end

Instance Method Details

#call(*args)

[ GitHub ]

  
# File 'lib/tempfile.rb', line 314

def call(*args)
  return if @pid != Process.pid

  $stderr.puts "removing #{@path}..." if $DEBUG

  begin
    File.unlink(@path)
  rescue Errno::ENOENT
  end

  $stderr.puts "done" if $DEBUG
end