Class: Raif::CLI::Runner

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Runner

Returns a new instance of Runner.



19
20
21
22
# File 'lib/raif/cli.rb', line 19

def initialize(args)
  @args = args
  @command = args.shift
end

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/raif/cli.rb', line 24

def run
  case @command
  when "evals"
    Evals.new(@args).run
  when "evals:compare"
    EvalsCompare.new(@args).run
  when "evals:setup"
    EvalsSetup.new(@args).run
  when "version", "--version", "-v"
    show_version
  when "help", "--help", "-h", nil
    show_help
  else
    puts "Unknown command: #{@command}"
    puts ""
    show_help
    exit 1
  end
end