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.
5 6 7 8 9 |
# File 'lib/ppl/command/external.rb', line 5 def initialize(name, command, description) @name = name @command = command @description = description end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/ppl/command/external.rb', line 3 def command @command end |
Instance Method Details
#execute(input, output) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/ppl/command/external.rb', line 11 def execute(input, output) if !input.arguments.empty? @command += " " + input.arguments.join(" ") end Dir.chdir(@storage.path) Kernel.exec(@command) end |