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

#options ⇒ Object (readonly)

Returns the value of attribute options.



78
79
80
# File 'lib/ace/review/cli/commands/review.rb', line 78

def options
  @options
end

Instance Method Details

#call(**cli_options) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/ace/review/cli/commands/review.rb', line 80

def call(**cli_options)
  # Remove ace-support-cli specific keys (args is leftover arguments)
  cli_options = cli_options.except(: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

  if cli_options[:prepare_goals_brief]
    prepare_goals_brief(cli_options)
    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