Class: SimpleCovMcp::AppConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/simplecov_mcp/app_config.rb

Overview

Configuration container for application options (used by both CLI and MCP modes) Uses Struct for simplicity and built-in functionality

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root: '.', resultset: nil, format: :table, sort_order: :descending, source_mode: nil, source_context: 2, color: $stdout.tty?, error_mode: :log, staleness: :off, tracked_globs: nil, log_file: nil, show_version: false) ⇒ AppConfig

Set sensible defaults - ALL SYMBOLS FOR ENUMS



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/simplecov_mcp/app_config.rb', line 22

def initialize(
  root: '.',
  resultset: nil,
  format: :table,
  sort_order: :descending,
  source_mode: nil,
  source_context: 2,
  color: $stdout.tty?,
  error_mode: :log,
  staleness: :off,
  tracked_globs: nil,
  log_file: nil,
  show_version: false
)
  super
end

Instance Attribute Details

#colorObject

Returns the value of attribute color

Returns:

  • (Object)

    the current value of color



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def color
  @color
end

#error_modeObject

Returns the value of attribute error_mode

Returns:

  • (Object)

    the current value of error_mode



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def error_mode
  @error_mode
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def format
  @format
end

#log_fileObject

Returns the value of attribute log_file

Returns:

  • (Object)

    the current value of log_file



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def log_file
  @log_file
end

#resultsetObject

Returns the value of attribute resultset

Returns:

  • (Object)

    the current value of resultset



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def resultset
  @resultset
end

#rootObject

Returns the value of attribute root

Returns:

  • (Object)

    the current value of root



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def root
  @root
end

#show_versionObject

Returns the value of attribute show_version

Returns:

  • (Object)

    the current value of show_version



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def show_version
  @show_version
end

#sort_orderObject

Returns the value of attribute sort_order

Returns:

  • (Object)

    the current value of sort_order



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def sort_order
  @sort_order
end

#source_contextObject

Returns the value of attribute source_context

Returns:

  • (Object)

    the current value of source_context



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def source_context
  @source_context
end

#source_modeObject

Returns the value of attribute source_mode

Returns:

  • (Object)

    the current value of source_mode



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def source_mode
  @source_mode
end

#stalenessObject

Returns the value of attribute staleness

Returns:

  • (Object)

    the current value of staleness



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def staleness
  @staleness
end

#tracked_globsObject

Returns the value of attribute tracked_globs

Returns:

  • (Object)

    the current value of tracked_globs



6
7
8
# File 'lib/simplecov_mcp/app_config.rb', line 6

def tracked_globs
  @tracked_globs
end

Instance Method Details

#formatter_optionsObject

Convenience method for SourceFormatter initialization



50
51
52
53
54
# File 'lib/simplecov_mcp/app_config.rb', line 50

def formatter_options
  {
    color_enabled: color
  }
end

#model_optionsObject

Convenience method for CoverageModel initialization



40
41
42
43
44
45
46
47
# File 'lib/simplecov_mcp/app_config.rb', line 40

def model_options
  {
    root: root,
    resultset: resultset,
    staleness: staleness,
    tracked_globs: tracked_globs
  }
end