Class: Rly::Commands::Remove
- Inherits:
-
Rly::Command
- Object
- Rly::Command
- Rly::Commands::Remove
- Defined in:
- lib/rly/commands/remove.rb
Instance Method Summary collapse
- #execute(input: $stdin, output: $stdout) ⇒ Object
-
#initialize(name, options) ⇒ Remove
constructor
A new instance of Remove.
Methods inherited from Rly::Command
#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which
Constructor Details
#initialize(name, options) ⇒ Remove
Returns a new instance of Remove.
9 10 11 12 |
# File 'lib/rly/commands/remove.rb', line 9 def initialize(name, ) @name = name @options = end |
Instance Method Details
#execute(input: $stdin, output: $stdout) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/rly/commands/remove.rb', line 14 def execute(input: $stdin, output: $stdout) shortcuts = Rly::Shortcuts.new if shortcuts.exist?(@name) shortcuts.destroy(@name) output.puts "removed #{@name} for this directory" else output.puts "can't find shortcut with name #{@name}" end end |