From 232ac727f46dfc0c96f7731b612edddc46f7d7f8 Mon Sep 17 00:00:00 2001 From: autobolt Date: Wed, 20 May 2026 14:33:09 -0600 Subject: [PATCH 1/4] Document constrained isolated loader lookup --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7e8fc06..57a4049 100644 --- a/README.md +++ b/README.md @@ -248,12 +248,18 @@ A gem that needs zero new top-level namespaces from this dependency can load the namespace. On Ruby 3.1+, use `Kernel.load(path, module)`: ```ruby -auth_sanitizer_spec = Gem.loaded_specs["auth-sanitizer"] || - Gem::Specification.find_by_name("auth-sanitizer") +auth_sanitizer_requirement = Gem::Requirement.new("~> 0.1", ">= 0.1.3") +auth_sanitizer_spec = Gem.loaded_specs["auth-sanitizer"] +unless auth_sanitizer_spec && auth_sanitizer_requirement.satisfied_by?(auth_sanitizer_spec.version) + auth_sanitizer_spec = Gem::Specification.find_by_name("auth-sanitizer", auth_sanitizer_requirement) +end auth_sanitizer_loader_path = File.join( auth_sanitizer_spec.full_gem_path, "lib/auth_sanitizer/loader.rb", ) +unless File.file?(auth_sanitizer_loader_path) + raise LoadError, "auth-sanitizer #{auth_sanitizer_requirement} loader not found at #{auth_sanitizer_loader_path}" +end auth_sanitizer_loader_namespace = Module.new Kernel.load(auth_sanitizer_loader_path, auth_sanitizer_loader_namespace) @@ -274,12 +280,18 @@ Ruby 2.2 through Ruby 3.0 do not support `Kernel.load(path, module)`. For those inside an anonymous namespace with `Module#module_eval`: ```ruby -auth_sanitizer_spec = Gem.loaded_specs["auth-sanitizer"] || - Gem::Specification.find_by_name("auth-sanitizer") +auth_sanitizer_requirement = Gem::Requirement.new("~> 0.1", ">= 0.1.3") +auth_sanitizer_spec = Gem.loaded_specs["auth-sanitizer"] +unless auth_sanitizer_spec && auth_sanitizer_requirement.satisfied_by?(auth_sanitizer_spec.version) + auth_sanitizer_spec = Gem::Specification.find_by_name("auth-sanitizer", auth_sanitizer_requirement) +end auth_sanitizer_loader_path = File.join( auth_sanitizer_spec.full_gem_path, "lib/auth_sanitizer/loader.rb", ) +unless File.file?(auth_sanitizer_loader_path) + raise LoadError, "auth-sanitizer #{auth_sanitizer_requirement} loader not found at #{auth_sanitizer_loader_path}" +end auth_sanitizer_loader_namespace = Module.new auth_sanitizer_loader_namespace.module_eval( From 40252291f5a658036e6fe7c3c5e04e15ad027c26 Mon Sep 17 00:00:00 2001 From: autobolt Date: Wed, 20 May 2026 22:20:30 -0600 Subject: [PATCH 2/4] Add tree-sitter setup to locked deps CI --- .github/workflows/locked_deps.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/locked_deps.yml b/.github/workflows/locked_deps.yml index eb6621c..54d89f2 100644 --- a/.github/workflows/locked_deps.yml +++ b/.github/workflows/locked_deps.yml @@ -73,6 +73,9 @@ jobs: - name: Checkout uses: actions/checkout@v6 + - name: Install tree-sitter library + uses: kettle-rb/ts-grammar-action@main + - name: Setup Ruby & RubyGems uses: ruby/setup-ruby@v1 with: From 8dafcd5b384bd44e51ea99151699a42cd61a196b Mon Sep 17 00:00:00 2001 From: autobolt Date: Wed, 20 May 2026 23:36:31 -0600 Subject: [PATCH 3/4] =?UTF-8?q?=E2=9E=96=20No=20templating=20deps=20in=20C?= =?UTF-8?q?I?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 24bcdb3..25dbd0b 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem "nomono", "~> 1.0" gem "logger" # Templating (env-switched: KETTLE_RB_DEV=true for local paths) -eval_gemfile "gemfiles/modular/templating.gemfile" if ENV.fetch("K_JEM_TEMPLATING", "true").casecmp("true").zero? +eval_gemfile "gemfiles/modular/templating.gemfile" if ENV.fetch("K_JEM_TEMPLATING", "false").casecmp("true").zero? # Debugging eval_gemfile "gemfiles/modular/debug.gemfile" From 24bcb7b9a82f2b2f9572bb89ba0ea9931f31e8cd Mon Sep 17 00:00:00 2001 From: autobolt Date: Wed, 20 May 2026 23:52:33 -0600 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=91=B7=20No=20appraisal=20for=20main?= =?UTF-8?q?=20Gemfile=20(locked=5Fdeps.yml)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/locked_deps.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/locked_deps.yml b/.github/workflows/locked_deps.yml index 54d89f2..6416f7d 100644 --- a/.github/workflows/locked_deps.yml +++ b/.github/workflows/locked_deps.yml @@ -84,19 +84,5 @@ jobs: bundler: ${{ matrix.bundler }} bundler-cache: true - - name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}" - id: bundleAppraisalAttempt1 - if: ${{ !env.ACT }} - run: bundle exec appraisal ${{ matrix.appraisal }} install - # Continue to the next step on failure - continue-on-error: true - - # Effectively an automatic retry of the previous step. - - name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}" - id: bundleAppraisalAttempt2 - # If bundleAppraisalAttempt1 failed, try again here; Otherwise skip. - if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && !env.ACT }} - run: bundle exec appraisal ${{ matrix.appraisal }} install - - name: Checks the kitchen sink via ${{ matrix.exec_cmd }} run: bundle exec ${{ matrix.exec_cmd }}