| Age | Commit message (Collapse) | Author |
|
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>
|
|
Touch and Directory inherited content/from from BaseFile but had no use
for them. Directory worked around this by repurposing content() as a
source-directory path store, which was semantically misleading.
Changes:
- Move content/from down into BaseFile (only File and Symlink need them)
- Move evaluate_absent! up into BasicFile (Touch and Directory need it)
- Move UnsupportedOperation up into BasicFile (validate raises it there)
- Re-parent Touch and Directory to BasicFile directly
- Add Directory#source accessor to replace the content() misuse
- Update DSL#directory to call d.source(...) instead of d.content(...)
All 29 tests continue to pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
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>
|