Method: Fast::File#delete!

Defined in:
lib/fast/file.rb

#delete!(*args) ⇒ Object Also known as: remove!, destroy!, del!, unlink!

Deletes the file(s) if it exists, does nothing otherwise



83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/fast/file.rb', line 83

def delete! *args
  unless args.empty?
    return_me = nil
    args.each do |path|
      return_me = normalize path
      ::File.unlink return_me if File.new.exist? path
    end
    return return_me
  else
    ::File.unlink @path if exist?
    @path
  end
end