Method: FileUtils.remove_entry

Defined in:
lib/fileutils.rb

.remove_entry(path, force = false) ⇒ Object

This method removes a file system entry path. path might be a regular file, a directory, or something. If path is a directory, remove it recursively.

See also remove_entry_secure.

[View source]

780
781
782
783
784
785
786
787
788
789
790
# File 'lib/fileutils.rb', line 780

def remove_entry(path, force = false)
  Entry_.new(path).postorder_traverse do |ent|
    begin
      ent.remove
    rescue
      raise unless force
    end
  end
rescue
  raise unless force
end