Class: SkillBench::EvaluateCommand Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/evaluate_command.rb

Overview

Deprecated.

Implements the ‘skill-bench run` CLI command. Orchestrates option parsing, evaluation execution, result printing, and output persistence.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv, stdout:) ⇒ EvaluateCommand

Returns a new instance of EvaluateCommand.

Parameters:

  • argv (Array<String>)

    Raw CLI arguments.

  • stdout (#puts, #write)

    Output stream for user-visible messages.



27
28
29
30
31
# File 'lib/skill_bench/evaluate_command.rb', line 27

def initialize(argv, stdout:)
  @argv = argv
  @stdout = stdout
  @options = nil
end

Class Method Details

.call(argv, stdout: $stdout) ⇒ Integer

Parses arguments, runs the evaluator, prints the report, and records history.

Parameters:

  • argv (Array<String>)

    Raw CLI arguments.

  • stdout (#puts, #write) (defaults to: $stdout)

    Output stream for user-visible messages.

Returns:

  • (Integer)

    Shell-compatible exit code.

Raises:

  • (OptionParser::ParseError)

    when invalid CLI flags are provided.

  • (SystemCallError)

    if writing output fails.



21
22
23
# File 'lib/skill_bench/evaluate_command.rb', line 21

def self.call(argv, stdout: $stdout)
  new(argv, stdout: stdout).call
end

Instance Method Details

#callInteger

Executes the command by orchestrating service objects.

Returns:

  • (Integer)

    Shell-compatible exit code.

Raises:

  • (OptionParser::ParseError)

    when invalid CLI flags are provided.

  • (SystemCallError)

    when the optional JSON output file cannot be written.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/skill_bench/evaluate_command.rb', line 38

def call
  return 1 unless parse_options? && validate_options?

  result = run_evaluation
  return 1 unless result[:success]

  return 1 unless persist_output?(result)

  SkillBench::HistoryRecorder.record(
    result,
    source_path: result[:source_path],
    model: SkillBench::Config.model
  )

  0
end