Bio::Command::Tmpdir is a wrapper class to handle temporary directory like Tempfile class. A temporary directory is created when the object of the class is created, and automatically removed when the object is destroyed by GC.
BioRuby library internal use only.
Creates a new Tmpdir object. The arguments are the same as Bio::Command.mktmpdir.
Arguments:
(optional) prefix_suffix: String (or Array)
(optional) tmpdir: String: temporary directory's path
Returns |
Tmpdir object |
# File lib/bio/command.rb, line 668 def initialize(prefix_suffix = nil, tmpdir = nil) @data = [] @clean_proc = Remover.new(@data) ObjectSpace.define_finalizer(self, @clean_proc) @data.push(@path = Bio::Command.mktmpdir(prefix_suffix, tmpdir).freeze) end
Removes the temporary directory.
Returns |
nil |
# File lib/bio/command.rb, line 685 def close! # raise error if path is nil self.path # finilizer object is called to remove the directory @clean_proc.call # unregister finalizer ObjectSpace.undefine_finalizer(self) # @data and @path is removed @data = @path = nil end
Generated with the Darkfish Rdoc Generator 2.