Class: SimpleCovMcp::ConfigParser
- Inherits:
-
Object
- Object
- SimpleCovMcp::ConfigParser
- Defined in:
- lib/simplecov_mcp/config_parser.rb
Overview
Centralized configuration parser for both CLI and MCP modes Parses argv (which should already include environment options merged by caller)
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
-
.parse(argv) ⇒ AppConfig
Parse argv (with env opts already merged) and return config.
Instance Method Summary collapse
-
#initialize(argv) ⇒ ConfigParser
constructor
A new instance of ConfigParser.
- #parse ⇒ Object
Constructor Details
#initialize(argv) ⇒ ConfigParser
Returns a new instance of ConfigParser.
12 13 14 15 |
# File 'lib/simplecov_mcp/config_parser.rb', line 12 def initialize(argv) @argv = argv @config = AppConfig.new end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
10 11 12 |
# File 'lib/simplecov_mcp/config_parser.rb', line 10 def argv @argv end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/simplecov_mcp/config_parser.rb', line 10 def config @config end |
Class Method Details
.parse(argv) ⇒ AppConfig
Parse argv (with env opts already merged) and return config
20 21 22 |
# File 'lib/simplecov_mcp/config_parser.rb', line 20 def self.parse(argv) new(argv).parse end |
Instance Method Details
#parse ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/simplecov_mcp/config_parser.rb', line 24 def parse # Build and execute the option parser parser = OptionParserBuilder.new(config).build_option_parser parser.parse!(argv) config end |