Class: ForemanAdmin::ExternalCommand
- Defined in:
- lib/foreman_admin/external_command.rb
Direct Known Subclasses
BackupCommand, DebugCommand, RestoreCommand, TaskExportCommand, UpdateCommand
Class Method Summary collapse
-
.external_invocation(invocation = nil) ⇒ Object
The base command that will be executed externally.
Instance Method Summary collapse
- #execute ⇒ Object
-
#external_command ⇒ Object
The exact assembled command that will be executed externally.
- #external_invocation ⇒ Object
Methods inherited from Command
command_name, #command_name, description, #description
Class Method Details
.external_invocation(invocation = nil) ⇒ Object
The base command that will be executed externally. Think of this as ARGV of what we’re running externally.
7 8 9 10 |
# File 'lib/foreman_admin/external_command.rb', line 7 def self.external_invocation(invocation = nil) @external_invocation = invocation if invocation @external_invocation end |
Instance Method Details
#execute ⇒ Object
22 23 24 |
# File 'lib/foreman_admin/external_command.rb', line 22 def execute puts `#{external_command}` end |
#external_command ⇒ Object
The exact assembled command that will be executed externally. Override this in a child class if you want it have logic.
18 19 20 |
# File 'lib/foreman_admin/external_command.rb', line 18 def external_command "#{external_invocation}" end |
#external_invocation ⇒ Object
12 13 14 |
# File 'lib/foreman_admin/external_command.rb', line 12 def external_invocation self.class.external_invocation end |