Method: Ing::Files#remove_file
- Defined in:
- lib/ing/actions/file_manipulation.rb
#remove_file(path, config = {}) ⇒ Object Also known as: remove_dir
Removes a file at the given location.
Parameters
- path<String>
-
path of the file to be changed
- config<Hash>
-
give :verbose => false to not log the status.
Example
remove_file 'README'
remove_file 'app/controllers/application_controller.rb'
281 282 283 284 285 286 287 |
# File 'lib/ing/actions/file_manipulation.rb', line 281 def remove_file(path, config={}) return if revoke? path = File.(path, destination_root) shell.say_status :remove, relative_to_original_destination_root(path), config.fetch(:verbose, true) ::FileUtils.rm_rf(path) if ![:pretend] && File.exists?(path) end |