diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-01 23:37:42 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-01 23:37:42 +0200 |
| commit | 211e3650387bd299bfcc6d21b7230323e45217c2 (patch) | |
| tree | fa0a8ba47074f3286a88db7256812ade3adf4dcf /lib/config.rb | |
| parent | 1ef38a857c895e5f970d219ba6802b2627801620 (diff) | |
refactor: defer Options parsing — add explicit Options.parse! method
Parsing ARGV at module eval time (during require) is fragile: it runs
before the application is ready, can pick up test-runner flags, and
bleeds stale values across repeated configure calls in tests.
Move the OptionParser setup and ARGV slicing into Options.parse!. The
module body now only sets safe defaults. parse! resets to defaults
before each parse so state cannot accumulate across calls.
Call Options.parse! once at the top of configure() in dsl.rb so all
entry points (scripts, Rake tasks) still receive parsed options without
any caller needing to know about the details.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'lib/config.rb')
0 files changed, 0 insertions, 0 deletions
