Class: RubyCode::Views::Cli::ConfigurationTable

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycode/views/cli/configuration_table.rb

Overview

Builds configuration table display

Class Method Summary collapse

Class Method Details

.build(directory:, model:, adapter: :ollama, debug_mode: false, auto_approve: false) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rubycode/views/cli/configuration_table.rb', line 11

def self.build(directory:, model:, adapter: :ollama, debug_mode: false, auto_approve: false) # rubocop:disable Lint/UnusedMethodArgument
  pastel = Pastel.new

  rows = [
    ["Adapter", adapter.to_s.capitalize],
    ["Model", model],
    ["Directory", directory]
  ]

  # Add auto-approve status if enabled
  rows << ["Auto-approve", "#{pastel.green("ENABLED")} #{pastel.yellow("⚠")}"] if auto_approve

  table = TTY::Table.new(
    header: [pastel.bold("Setting"), pastel.bold("Value")],
    rows: rows
  )

  "\n#{table.render(:unicode, padding: [0, 1])}"
end