Sha256: 2ce982d299658e0af3c829686d9a496c7e3bf4a2388eed79a071b5b6ff4dc908
Contents?: true
Size: 643 Bytes
Versions: 378
Compression:
Stored size: 643 Bytes
Contents
# frozen_string_literal: true require 'pathname' require 'tempfile' module EacRubyUtils module Fs module Temp class File < Pathname # Temporary file def initialize(*tempfile_args) file = Tempfile.new(*tempfile_args) path = file.path file.close file.unlink super(path) end def remove if directory? rmtree elsif file? unlink end end def remove! remove raise "Tried to remove \"#{self}\", but it yet exists" if exist? end end end end end
Version data entries
378 entries across 378 versions & 4 rubygems