Class: Simulacrum::CLI::Command
- Inherits:
-
Object
- Object
- Simulacrum::CLI::Command
- Defined in:
- lib/simulacrum/cli.rb
Overview
Class for wrappin up logic for running the process and handling exit
Instance Method Summary collapse
-
#initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = Kernel) ⇒ Command
constructor
A new instance of Command.
- #run_and_exit ⇒ Object
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_exit ⇒ Object
18 19 20 21 |
# File 'lib/simulacrum/cli.rb', line 18 def run_and_exit @exit_code = run @kernel.exit(@exit_code) end |