Class: Action
- Inherits:
-
Object
- Object
- Action
- Defined in:
- lib/action.rb
Overview
represents one action to be performed in the shell can assemble a command line from a command and args
Instance Method Summary collapse
- #alias ⇒ Object
- #command ⇒ Object
- #description ⇒ Object
-
#initialize(config, args, options) ⇒ Action
constructor
A new instance of Action.
- #run ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(config, args, options) ⇒ Action
Returns a new instance of Action.
8 9 10 11 12 |
# File 'lib/action.rb', line 8 def initialize(config, args, ) @config = config @args = args @options = end |
Instance Method Details
#alias ⇒ Object
24 25 26 |
# File 'lib/action.rb', line 24 def alias @config["alias"] end |
#command ⇒ Object
28 29 30 |
# File 'lib/action.rb', line 28 def command @config["command"] end |
#description ⇒ Object
32 33 34 |
# File 'lib/action.rb', line 32 def description @config["description"] end |
#run ⇒ Object
14 15 16 17 18 |
# File 'lib/action.rb', line 14 def run load_secrets if load_secrets? Kernel.exec(to_s) end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/action.rb', line 20 def to_s "#{command} #{@args.join(' ')}" end |