class Bio::Command::Tmpdir::Remover

Internal use only. Users should not use this class directly.

Bio::Command::Tmpdir::Remover is a class to remove temporary directory.

Acknowledgement: The essense of the code is taken from tempfile.rb in Ruby trunk (svn 34413) and in Ruby 1.8.7.

Public Class Methods

new(data) click to toggle source

Internal use only. Users should not call this method.

# File lib/bio/command.rb, line 637
def initialize(data)
  @pid = $$
  @data = data
end

Public Instance Methods

call(*args) click to toggle source

Internal use only. Users should not call this method.

# File lib/bio/command.rb, line 643
def call(*args)
  return if @pid != $$

  path, = *@data

  STDERR.print "removing ", path, "..." if $DEBUG
  if path and !path.empty? and
      File.directory?(path) and
      !File.symlink?(path) then
    Bio::Command.remove_entry_secure(path)
    $stderr.print "done\n" if $DEBUG
  else
    $stderr.print "skipped\n" if $DEBUG
  end
end