Sha256: 8c234f8a5ca8c881c0e7153e7b2ff08e87e26a0d1a363662136cff688dc4c12e

Contents?: true

Size: 830 Bytes

Versions: 5

Compression:

Stored size: 830 Bytes

Contents

require_relative 'application'
require_relative 'configuration'

module Vedeu
  class Launcher
    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

    # :nocov:
    def execute!
      $stdin, $stdout, $stderr = @stdin, @stdout, @stderr

      Application.start(configuration)

      @exit_code = 0
    ensure
      $stdin, $stdout, $stderr = STDIN, STDOUT, STDERR
      @kernel.exit(@exit_code)
    end
    # :nocov:

    private

    attr_reader :argv

    # :nocov:
    def configuration
      Configuration.configure(argv)
    end
    # :nocov:
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.0.30 lib/vedeu/launcher.rb
vedeu-0.0.29 lib/vedeu/launcher.rb
vedeu-0.0.28 lib/vedeu/launcher.rb
vedeu-0.0.27 lib/vedeu/launcher.rb
vedeu-0.0.26 lib/vedeu/launcher.rb