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(tmpfile) ⇒ Remover

[ GitHub ]

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

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

Instance Method Details

#call(*args)

[ GitHub ]

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

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

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

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

  $stderr.puts "done" if $DEBUG
end