Class: Ppl::Command::External
- Inherits:
-
Application::Command
- Object
- Application::Command
- Ppl::Command::External
- Defined in:
- lib/ppl/command/external.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
Attributes inherited from Application::Command
Instance Method Summary collapse
- #execute(input, output) ⇒ Object
-
#initialize(name, command, description) ⇒ External
constructor
A new instance of External.
Methods inherited from Application::Command
Constructor Details
#initialize(name, command, description) ⇒ External
Returns a new instance of External.
6 7 8 9 10 |
# File 'lib/ppl/command/external.rb', line 6 def initialize(name, command, description) @name = name @command = command @description = description end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
4 5 6 |
# File 'lib/ppl/command/external.rb', line 4 def command @command end |
Instance Method Details
#execute(input, output) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ppl/command/external.rb', line 12 def execute(input, output) if !input.arguments.empty? @command += " " + input.arguments.join(" ") end Dir.chdir(@storage.path) Kernel.exec(@command) end |