class EacRubyUtils::Fs::Temp::File

Public Class Methods

new(*tempfile_args) click to toggle source

Temporary file

Calls superclass method
# File lib/eac_ruby_utils/fs/temp/file.rb, line 11
def initialize(*tempfile_args)
  file = Tempfile.new(*tempfile_args)
  path = file.path
  file.close
  file.unlink
  super(path)
end

Public Instance Methods

remove() click to toggle source
# File lib/eac_ruby_utils/fs/temp/file.rb, line 19
def remove
  if directory?
    rmtree
  elsif file?
    unlink
  end
end
remove!() click to toggle source
# File lib/eac_ruby_utils/fs/temp/file.rb, line 27
def remove!
  remove
  raise "Tried to remove \"#{self}\", but it yet exists" if exist?
end