Class: Vedeu::Launcher

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/launcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) ⇒ Launcher

:nocov:



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/vedeu/launcher.rb', line 7

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 Method Details

#execute!Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/vedeu/launcher.rb', line 19

def execute!
  $stdin, $stdout, $stderr = @stdin, @stdout, @stderr

  Application.start(configuration)

  @exit_code = 0
rescue StandardError => uncaught_exception
  Vedeu.error(uncaught_exception)
ensure
  $stdin, $stdout, $stderr = STDIN, STDOUT, STDERR
  @kernel.exit(@exit_code)
end