Class: Snip::Command::Remove
- Inherits:
-
Object
- Object
- Snip::Command::Remove
- Defined in:
- lib/snip/command/remove.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args, options = {}) ⇒ Remove
constructor
A new instance of Remove.
Constructor Details
#initialize(args, options = {}) ⇒ Remove
Returns a new instance of Remove.
6 7 8 9 |
# File 'lib/snip/command/remove.rb', line 6 def initialize(args, ={}) @args = Array(args) @options = end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/snip/command/remove.rb', line 11 def execute name = @args raise NotInitializedError unless Snip::initialized? raise SnippetNotFoundError unless Snip::snippet_exists?(name) FileUtils.rm(File.join(Snip::INSTALL_DIR, name)) if Snip::snippet_exists?(name) end |