Class: Simulacrum::CLI::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/simulacrum/cli.rb

Overview

Class for wrappin up logic for running the process and handling exit

Instance Method Summary collapse

Constructor Details

#initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = Kernel) ⇒ Command

Returns a new instance of Command.



14
15
16
# File 'lib/simulacrum/cli.rb', line 14

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

#run_and_exitObject



18
19
20
21
# File 'lib/simulacrum/cli.rb', line 18

def run_and_exit
  @exit_code = run
  @kernel.exit(@exit_code)
end