Class: Ace::Review::CLI::Commands::Review

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
Support::Cli::Base
Defined in:
lib/ace/review/cli/commands/review.rb

Overview

ace-support-cli Command class for the review command

Executes code review using presets or custom configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



72
73
74
# File 'lib/ace/review/cli/commands/review.rb', line 72

def options
  @options
end

Instance Method Details

#call(**cli_options) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/ace/review/cli/commands/review.rb', line 74

def call(**cli_options)
  # Remove ace-support-cli specific keys (args is leftover arguments)
  cli_options = cli_options.reject { |k, _| k == :args }

  if cli_options[:version]
    puts "ace-review #{Ace::Review::VERSION}"
    return
  end

  if cli_options[:list_presets]
    show_list_presets
    return
  end

  if cli_options[:list_prompts]
    show_list_prompts
    return
  end

  # Type-convert numeric options (ace-support-cli returns strings, Thor converted to integers)
  cli_options[:gh_timeout] = cli_options[:gh_timeout]&.to_i if cli_options[:gh_timeout]

  # Build and store options for testing compatibility
  @options = build_review_options(cli_options)

  execute_review
end