summaryrefslogtreecommitdiff
path: root/lib/dsl.rb
AgeCommit message (Collapse)Author
2026-03-14Use active DSL registry for Resource.findPaul Buetow
2026-03-14Add agent-backed file processing DSLPaul Buetow
2026-03-01refactor: defer Config loading — add explicit Config.load! methodPaul Buetow
Loading config.toml at module eval time (during require) runs before the application's working directory is set, can slow down tests that don't use config at all, and gives no way to reload between calls. Move the load logic into Config.load! (mirrors the Options.parse! pattern added in the previous commit). The module body now just initialises @@config to {}. Call Config.load! alongside Options.parse! at the top of configure() so all entry points reload from the correct directory. Also qualify File as ::File inside the RCM module to avoid resolving it as RCM::File once the keyword files are loaded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01refactor: defer Options parsing — add explicit Options.parse! methodPaul Buetow
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>
2026-03-01refactor: extract register_keyword helper to eliminate 4x DSL duplicationPaul Buetow
Each of the file/symlink/touch/directory DSL methods repeated the same four-step pattern: nil-path identity return, @conds_met guard, create- configure-register, return object. Add a private register_keyword helper to DSL in dsl.rb and collapse each method to a one-liner. No behaviour changed; all 29 tests continue to pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01refactor: split file.rb into per-class files under lib/dslkeywords/Paul Buetow
file.rb was a ~400-line monolith holding seven unrelated classes/modules. Extract each into its own file so each file has a single responsibility and stays within the 50-line guideline: file_backup.rb — FileBackup mixin symlink.rb — Symlink class + DSL#symlink touch.rb — Touch class + DSL#touch directory.rb — Directory class + DSL#directory file.rb keeps BasicFile, BaseFile, File, and DSL#file. dsl.rb gains explicit require_relative lines for the new files. No logic was changed; all 29 tests continue to pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2025-02-19more on thisPaul Buetow
2025-02-18test for dup resourcePaul Buetow
2025-02-16change foo[...] to foo(...) syntax for depsPaul Buetow
test deps
2025-02-15add depends_on syntaxPaul Buetow
2025-02-15dsl keyword base class addedPaul Buetow
2025-02-14add configure_from_scratchPaul Buetow
2025-02-14test only_whenPaul Buetow
2025-02-14more testsPaul Buetow
2025-02-14add ensure_linePaul Buetow
2024-12-08use of endless methodsPaul Buetow
2024-12-08add gemspecPaul Buetow
2024-12-07cosmeticsPaul Buetow