From 08129b43792eeec92eacb9f47ce3f879489aa03c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Mar 2026 18:38:49 +0200 Subject: 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 --- bin/rcm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bin/rcm (limited to 'bin') diff --git a/bin/rcm b/bin/rcm new file mode 100755 index 0000000..2a7b6cd --- /dev/null +++ b/bin/rcm @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +# CLI entry point for RCM configuration management. +# Usage: rcm [--dry] [--debug] [--hosts host1,host2] + +if ARGV.empty? || ARGV.first.start_with?('-') + warn "Usage: rcm [--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 -- cgit v1.2.3