From 1f5410ae2d117f2904373eedbeb762f7a02b421a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Mar 2026 20:26:49 +0200 Subject: add rcm LoadError fallback to rake and gem examples --- examples/gem/config.rb | 6 +++++- examples/rake/Rakefile | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/gem/config.rb b/examples/gem/config.rb index c4bbc23..e6d30d1 100755 --- a/examples/gem/config.rb +++ b/examples/gem/config.rb @@ -2,7 +2,11 @@ # Example: Using RCM as a gem inside a Bundler-managed project, without Rake. # # rcm is declared in the Gemfile and loaded via bundler. -require 'rcm' +begin + require 'rcm' +rescue LoadError + require_relative '../../lib/dsl' +end configure do # Only run on the host named 'earth' diff --git a/examples/rake/Rakefile b/examples/rake/Rakefile index 27b7e7a..4392f20 100644 --- a/examples/rake/Rakefile +++ b/examples/rake/Rakefile @@ -7,7 +7,11 @@ # # This example assumes rcm is available via bundler (see Gemfile), # or you can swap the require for: require_relative '../../lib/dsl' -require 'rcm' +begin + require 'rcm' +rescue LoadError + require_relative '../../lib/dsl' +end desc 'Apply system configuration' task :setup do -- cgit v1.2.3