summaryrefslogtreecommitdiff
path: root/lib/dslkeywords/file.rb
AgeCommit message (Collapse)Author
2026-03-14Resolve multi-word agent names in file DSLdevelopPaul Buetow
2026-03-14Validate agent configs during dry runsPaul Buetow
2026-03-14Add agent-backed file processing DSLPaul Buetow
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: narrow BasicFile interface — apply ISP to Touch and DirectoryPaul Buetow
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>
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>
2026-03-01fix: correct backup_resursively! typo in evaluate_present_recursively!Paul Buetow
The method is defined as backup_recursively! but was called as backup_resursively! — a NoMethodError at runtime for any configuration using the recursive directory copy directive. Also fix the matching misspelling in the log message string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01fix dry-run crash when parent directory does not exist yet, add rake and rcm ↵Paul Buetow
fallback to examples
2026-03-01make rcm usable as a gem from any directory, fix bugs and testsPaul Buetow
- Add lib/rcm.rb entry point and bin/rcm CLI executable - Update gemspec: v0.1.0, proper files list, executables, runtime deps - Support standalone arg parsing and --hosts filtering in options - Fix inverted logic and typo in FileBackup#different? (== vs !=, cecksum_b) - Fix unqualified File.directory? resolving to RCM::File in Directory - Fix test_chown assertions running before evaluate! creates files - Add setup to file tests to prevent order-dependent failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2025-02-28fixPaul Buetow
2025-02-28joPaul Buetow
2025-02-28can copy recursively a directoryPaul Buetow
2025-02-26only run when resource not yet exists as expectedPaul Buetow
2025-02-26rename dry? to do?Paul Buetow
2025-02-26can change owner of files and dirsPaul Buetow
2025-02-25initial mode supportPaul Buetow
2025-02-25add touch filePaul Buetow
2025-02-25can purge a dirPaul Buetow
2025-02-20can backup alo a directoryPaul Buetow
2025-02-19initial directory supportPaul Buetow
2025-02-19factor out symlink testPaul Buetow
2025-02-19adding dryPaul Buetow
2025-02-19fixPaul Buetow
2025-02-19fixPaul Buetow
2025-02-19more on symlinksPaul Buetow
2025-02-19refactorPaul Buetow
2025-02-19make this workPaul Buetow
2025-02-19more on thisPaul Buetow
2025-02-19nicerPaul Buetow
2025-02-18refactor file DSLPaul Buetow
2025-02-18refactorPaul Buetow
2025-02-18can clean up a file which is cleaning whole pathPaul Buetow
2025-02-18add support to delete a filePaul Buetow
2025-02-18add ensure absent for file linePaul Buetow
2025-02-18rename temp dirPaul Buetow
2025-02-18testing backupPaul Buetow
2025-02-18only backup file when it changedPaul Buetow
2025-02-18backupping file when changePaul Buetow
2025-02-16can find resource objsPaul Buetow
2025-02-15add depends_on syntaxPaul Buetow
2025-02-15dsl keyword base class addedPaul Buetow
2025-02-14joPaul Buetow
2025-02-14more testsPaul Buetow
2025-02-14initial testsPaul Buetow
2025-02-14add ensure_linePaul Buetow
2024-12-08use of endless methodsPaul Buetow
2024-12-07cosmeticsPaul Buetow
2024-12-07playingPaul Buetow
2024-12-07sugarPaul Buetow
2024-12-06refactorPaul Buetow