Class: CleoQualityReview::CLI
- Inherits:
-
Object
- Object
- CleoQualityReview::CLI
- Defined in:
- lib/cleo_quality_review/cli.rb
Overview
Command-line interface entry point
Constant Summary collapse
- SUBCOMMANDS =
{ "analyze" => :run_analyze, "render" => :run_render, "publish-pr-review" => :run_publish_pr_review, }.freeze
Instance Method Summary collapse
-
#initialize(argv, stdout: $stdout, stderr: $stderr) ⇒ CLI
constructor
A new instance of CLI.
-
#run ⇒ Integer
Execute the CLI.
Constructor Details
#initialize(argv, stdout: $stdout, stderr: $stderr) ⇒ CLI
Returns a new instance of CLI.
27 28 29 30 31 |
# File 'lib/cleo_quality_review/cli.rb', line 27 def initialize(argv, stdout: $stdout, stderr: $stderr) @argv = argv @stdout = stdout @stderr = stderr end |
Instance Method Details
#run ⇒ Integer
Execute the CLI
36 37 38 39 40 41 |
# File 'lib/cleo_quality_review/cli.rb', line 36 def run dispatch_command rescue Error, OptionParser::ParseError, ArgumentError => error stderr.puts("check_quality: #{error.}") 1 end |