Class: Arli::CLI::Runner
- Inherits:
-
Object
- Object
- Arli::CLI::Runner
- Defined in:
- lib/arli/cli/runner.rb
Overview
For the reasons this file is the way it is, please refer to github.com/erikhuda/thor/wiki/Integrating-with-Aruba-In-Process-Runs
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) ⇒ Runner
constructor
A new instance of Runner.
- #print_debug_info ⇒ Object
Constructor Details
#initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) ⇒ Runner
Returns a new instance of Runner.
9 10 11 |
# File 'lib/arli/cli/runner.rb', line 9 def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel end |
Instance Method Details
#execute! ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/arli/cli/runner.rb', line 13 def execute! exit_code = begin $stderr = @stderr $stdin = @stdin $stdout = @stdout Arli::CLI::App.new(@argv).start print_debug_info 0 rescue StandardError 1 rescue SystemExit => e e.status ensure $stderr = STDERR $stdin = STDIN $stdout = STDOUT end @kernel.exit(exit_code) end |