Class: Vedeu::Launcher
- Inherits:
-
Object
- Object
- Vedeu::Launcher
- Defined in:
- lib/vedeu/launcher.rb
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
private
Returns the value of attribute argv.
Instance Method Summary collapse
-
#execute! ⇒ Object
[].
-
#initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) ⇒ Launcher
constructor
:nocov:.
Constructor Details
#initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) ⇒ Launcher
:nocov:
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/vedeu/launcher.rb', line 11 def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) @argv = argv @stdin = stdin @stdout = stdout @stderr = stderr @kernel = kernel @exit_code = 1 end |
Instance Attribute Details
#argv ⇒ Object (readonly, private)
Returns the value of attribute argv.
44 45 46 |
# File 'lib/vedeu/launcher.rb', line 44 def argv @argv end |
Instance Method Details
#execute! ⇒ Object
Returns [].
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vedeu/launcher.rb', line 24 def execute! $stdin, $stdout, $stderr = @stdin, @stdout, @stderr Configuration.configure(argv) Application.start @exit_code = 0 rescue StandardError => uncaught_exception puts uncaught_exception. puts uncaught_exception.backtrace.join("\n") ensure $stdin, $stdout, $stderr = STDIN, STDOUT, STDERR @kernel.exit(@exit_code) end |