Class: Bashy::Remove
- Inherits:
-
Object
- Object
- Bashy::Remove
- Defined in:
- lib/bashy.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Remove
constructor
A new instance of Remove.
Constructor Details
#initialize(options = {}) ⇒ Remove
Returns a new instance of Remove.
87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/bashy.rb', line 87 def initialize( = {}) # Check that our directories are in tact. Bashy::check_and_load_config_directory # Loop through passed names, and remove all that we can. [:names].each do |snippet| if Bashy.config[:snippets].include?(snippet) Bashy.config[:snippets].delete(snippet) Bashy.save_config FileUtils.rm(File.join(SNIPPET_PATH, snippet)) end end end |