Class: Nucleon::Action::Node::Exec
- Inherits:
-
Object
- Object
- Nucleon::Action::Node::Exec
- Defined in:
- lib/nucleon/action/node/exec.rb
Class Method Summary collapse
-
.describe ⇒ Object
—————————————————————————– Info.
Instance Method Summary collapse
-
#arguments ⇒ Object
—.
-
#configure ⇒ Object
—————————————————————————- Settings.
-
#execute ⇒ Object
—————————————————————————– Operations.
Class Method Details
.describe ⇒ Object
Info
10 11 12 |
# File 'lib/nucleon/action/node/exec.rb', line 10 def self.describe super(:node, :exec, 605) end |
Instance Method Details
#arguments ⇒ Object
25 26 27 |
# File 'lib/nucleon/action/node/exec.rb', line 25 def arguments [ :command ] end |
#configure ⇒ Object
Settings
17 18 19 20 21 |
# File 'lib/nucleon/action/node/exec.rb', line 17 def configure super do register :command, :array, nil end end |
#execute ⇒ Object
Operations
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/nucleon/action/node/exec.rb', line 32 def execute super do |node| if settings[:command].length > 1 settings[:command].collect! do |value| if value.strip.match(/\s+/) value = "\"#{value}\"" end value end end command_str = settings[:command].join(' ') if node result = node.exec({ :commands => [ command_str ] }).first else result = CORL.cli_run(command_str) end myself.status = result.status end end |