Method: Tempfile::FinalizerManager#call

Defined in:
lib/tempfile.rb

#call(object_id) ⇒ Object



386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/tempfile.rb', line 386

def call(object_id)
  @open_files.delete(object_id).close

  if @open_files.empty? && !@unlinked && Process.pid == @pid
    $stderr.puts "removing #{@path}..." if $DEBUG
    begin
      File.unlink(@path)
    rescue Errno::ENOENT
    end
    $stderr.puts "done" if $DEBUG
  end
end