diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-01 18:38:49 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-01 18:38:49 +0200 |
| commit | 08129b43792eeec92eacb9f47ce3f879489aa03c (patch) | |
| tree | f527ba7c71c58536fa68b0acaef41dcd56a3cfc6 /bin | |
| parent | 861e526d9ad9228f2b740dbcf00cf39d8fe652f2 (diff) | |
make rcm usable as a gem from any directory, fix bugs and tests
- 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>
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/rcm | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +# CLI entry point for RCM configuration management. +# Usage: rcm <config.rb> [--dry] [--debug] [--hosts host1,host2] + +if ARGV.empty? || ARGV.first.start_with?('-') + warn "Usage: rcm <config.rb> [--dry] [--debug] [--hosts host1,host2]" + exit 1 +end + +config_file = ARGV.shift + +unless File.exist?(config_file) + warn "Error: file not found: #{config_file}" + exit 1 +end + +require 'rcm' +load config_file |
