Class: SkillBench::Services::ResultPrinterService Deprecated
- Inherits:
-
Object
- Object
- SkillBench::Services::ResultPrinterService
- Defined in:
- lib/skill_bench/services/result_printer_service.rb
Overview
Deprecated.
Use Cli::ResultPrinter instead.
Service object for printing formatted evaluation results to stdout. Handles result formatting, score parsing, and provides standardized output for both successful and failed evaluations.
Constant Summary collapse
- RESULTS_BANNER =
"\n=========================================\n " \ "RESULTS \n" \ "=========================================\n"
Class Method Summary collapse
-
.call(result, stdout: $stdout) ⇒ Hash
Prints formatted evaluation results to the specified output stream.
Instance Method Summary collapse
-
#call ⇒ Hash
Prints the evaluation results in a formatted, user-friendly manner.
-
#initialize(result, stdout: $stdout) ⇒ ResultPrinterService
constructor
Initializes a new result printer instance.
Constructor Details
#initialize(result, stdout: $stdout) ⇒ ResultPrinterService
Initializes a new result printer instance.
36 37 38 39 |
# File 'lib/skill_bench/services/result_printer_service.rb', line 36 def initialize(result, stdout: $stdout) @result = result @stdout = stdout end |
Class Method Details
.call(result, stdout: $stdout) ⇒ Hash
Prints formatted evaluation results to the specified output stream.
28 29 30 |
# File 'lib/skill_bench/services/result_printer_service.rb', line 28 def self.call(result, stdout: $stdout) new(result, stdout: stdout).call end |
Instance Method Details
#call ⇒ Hash
Prints the evaluation results in a formatted, user-friendly manner. Handles both successful evaluations and error cases.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/skill_bench/services/result_printer_service.rb', line 46 def call @stdout.puts RESULTS_BANNER unless @result[:success] error_msg = @result.dig(:response, :error, :message) || 'Unknown error' @stdout.puts "Evaluation failed: #{error_msg}" return { success: true, response: {} } end @result[:tasks]&.each do |task_result| @stdout.puts "\n=========================================" @stdout.puts " RESULTS: #{task_result[:path]} " @stdout.puts "=========================================\n" print_task_result(task_result) end { success: true, response: {} } end |