Class: Diogenes::Cli::Evaluate
- Inherits:
-
Object
- Object
- Diogenes::Cli::Evaluate
- Defined in:
- lib/diogenes/cli/evaluate.rb
Class Method Summary collapse
-
.run(argv:, out:, err:, **opts) ⇒ Object
: (argv: Array, out: IO, err: IO, **untyped) -> Integer.
Class Method Details
.run(argv:, out:, err:, **opts) ⇒ Object
: (argv: Array, out: IO, err: IO, **untyped) -> Integer
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/diogenes/cli/evaluate.rb', line 10 def self.run(argv:, out:, err:, **opts) = {} #: Hash[Symbol, String] remaining = argv.dup OptionParser.new do |o| o.on("--answers ANSWERS") { |v| [:answers] = v } o.on("--format FORMAT") { |v| [:format] = v } end.parse!(remaining) description = remaining.join(" ").strip if description.empty? err.puts "Usage: diogenes evaluate \"<feature description>\" [--answers gate1=pass,...] [--format json]" return 1 end if [:answers] Evaluation::CiRunner.new(description:, answers: [:answers], format: [:format], out:, err:).run else Evaluation::Session.new(description:, out:, err:, **opts).run end end |