Class: CodewarsCli::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/codewars_cli/runner.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Runner.



7
8
9
10
11
12
13
14
# File 'lib/codewars_cli/runner.rb', line 7

def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel)
  init_pry
  @argv = argv
  @stdin = stdin
  @stdout = stdout
  @stderr = stderr
  @kernel = kernel
end

Instance Method Details

#execute!Object



16
17
18
19
# File 'lib/codewars_cli/runner.rb', line 16

def execute!
  exit_code = run_cli
  @kernel.exit(exit_code)
end