Class: Rascal::CLI::Run
Instance Method Summary collapse
-
#initialize(thor, options, environment_name, command) ⇒ Run
constructor
A new instance of Run.
- #run ⇒ Object
Constructor Details
#initialize(thor, options, environment_name, command) ⇒ Run
Returns a new instance of Run.
6 7 8 9 10 |
# File 'lib/rascal/cli/run.rb', line 6 def initialize(thor, , environment_name, command) @environment_name = environment_name @command = command super(thor, ) end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/rascal/cli/run.rb', line 12 def run if (environment = find_environment(@environment_name)) fail_with_error('Missing command. Example: rascal run job -- bundle exec rake') if @command.empty? status = environment.run_command(*@command) exit(exit_code_for(status)) end end |