Class: Diogenes::Evaluation::CiRunner
- Inherits:
-
Object
- Object
- Diogenes::Evaluation::CiRunner
- Defined in:
- lib/diogenes/evaluation/ci_runner.rb
Instance Method Summary collapse
-
#initialize(description:, answers:, out:, err:, format: nil) ⇒ CiRunner
constructor
: (description: String, answers: String, out: IO, err: IO, ?format: String?) -> void.
-
#run ⇒ Object
: () -> Integer.
Constructor Details
#initialize(description:, answers:, out:, err:, format: nil) ⇒ CiRunner
: (description: String, answers: String, out: IO, err: IO, ?format: String?) -> void
10 11 12 13 14 15 16 |
# File 'lib/diogenes/evaluation/ci_runner.rb', line 10 def initialize(description:, answers:, out:, err:, format: nil) @description = description @parsed_answers = parse_answers(answers) #: Hash[Symbol, bool] @format = format @out = out @err = err end |
Instance Method Details
#run ⇒ Object
: () -> Integer
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/diogenes/evaluation/ci_runner.rb', line 19 def run missing = Gates::ALL.map(&:key) - @parsed_answers.keys unless missing.empty? @err.puts "Missing answer#{"s" if missing.size > 1} for: #{missing.join(", ")}. " \ "Provide all 5 gate answers: --answers failure_mode=pass,user_verifiable=pass,..." return 1 end results = build_results (@format == "json") ? output_json(results) : output_text(results) results.all?(&:passed?) ? 0 : 1 end |