module EacRubyUtils::Fs::Temp

def directory(*tempfile_args)

Returns:
  • (Pathname) -
def directory(*tempfile_args)
  ::EacRubyUtils::Fs::Temp::Directory.new(*tempfile_args)
end

def file(*tempfile_args)

Returns:
  • (Pathname) -
def file(*tempfile_args)
  ::EacRubyUtils::Fs::Temp::File.new(*tempfile_args)
end

def on_directory(*tempfile_args)

when the block is finished.
Run a block while a temporary directory pathname is provided. The directory is deleted
def on_directory(*tempfile_args)
  temp_dir = directory(*tempfile_args)
  begin
    yield(temp_dir)
  ensure
    temp_dir.remove
  end
end

def on_file(*tempfile_args)

is finished.
Run a block while a temporary file pathname is providade. The file is deleted when block
def on_file(*tempfile_args)
  temp_file = file(*tempfile_args)
  begin
    yield(temp_file)
  ensure
    temp_file.remove
  end
end