Class: Runner
- Inherits:
-
Object
- Object
- Runner
- Defined in:
- lib/runner.rb
Defined Under Namespace
Classes: ActionConfigError, NotAllowedInEnvError, UnknownActionError
Instance Method Summary collapse
-
#initialize(action_name, args, config, config_path) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #suggestions ⇒ Object
Constructor Details
#initialize(action_name, args, config, config_path) ⇒ Runner
Returns a new instance of Runner.
13 14 15 16 17 18 |
# File 'lib/runner.rb', line 13 def initialize(action_name, args, config, config_path) @action_name = action_name @args = args @config = config @config_path = config_path end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/runner.rb', line 20 def run return forward.run if forward do_before_all return builtin.run if builtin raise UnknownActionError, "Unknown action: #{@action_name}" unless action raise ActionConfigError, action.config_errors.join("; ") unless action.config_valid? do_before_action run_action end |
#suggestions ⇒ Object
35 36 37 |
# File 'lib/runner.rb', line 35 def suggestions @suggestions ||= ActionSuggester.new(action_list.names + action_list.aliases + builtin_names).check(@action_name) end |