From 51ff08db7b77607a76753c0bd35333d8ee425bd5 Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Mon, 12 Jan 2026 13:06:13 -0500 Subject: [PATCH 1/4] Fix CI --- spec/ruby_liquid.rb | 4 ++-- spec/ruby_liquid_lax.rb | 4 ++-- spec/ruby_liquid_with_active_support.rb | 4 ++-- spec/ruby_liquid_yjit.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/ruby_liquid.rb b/spec/ruby_liquid.rb index 062e635f9..8d7f651bb 100644 --- a/spec/ruby_liquid.rb +++ b/spec/ruby_liquid.rb @@ -13,7 +13,7 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |ctx, source, options| +LiquidSpec.compile do |_ctx, source, options| Liquid::Template.parse(source, **options) end @@ -22,7 +22,7 @@ # @param template [Liquid::Template] compiled template # @param assigns [Hash] environment variables # @param options [Hash] :registers, :strict_errors, :exception_renderer -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |_ctx, template, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( diff --git a/spec/ruby_liquid_lax.rb b/spec/ruby_liquid_lax.rb index b9fc497a8..79f4518c0 100644 --- a/spec/ruby_liquid_lax.rb +++ b/spec/ruby_liquid_lax.rb @@ -12,14 +12,14 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |ctx, source, options| +LiquidSpec.compile do |_ctx, source, options| # Force lax mode options = options.merge(error_mode: :lax) Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |_ctx, template, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( diff --git a/spec/ruby_liquid_with_active_support.rb b/spec/ruby_liquid_with_active_support.rb index ab1ada372..b577668d6 100644 --- a/spec/ruby_liquid_with_active_support.rb +++ b/spec/ruby_liquid_with_active_support.rb @@ -14,7 +14,7 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |ctx, source, options| +LiquidSpec.compile do |_ctx, source, options| Liquid::Template.parse(source, **options) end @@ -23,7 +23,7 @@ # @param template [Liquid::Template] compiled template # @param assigns [Hash] environment variables # @param options [Hash] :registers, :strict_errors, :exception_renderer -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |_ctx, template, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( diff --git a/spec/ruby_liquid_yjit.rb b/spec/ruby_liquid_yjit.rb index e34e0abb6..d30afb8ac 100644 --- a/spec/ruby_liquid_yjit.rb +++ b/spec/ruby_liquid_yjit.rb @@ -19,14 +19,14 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |ctx, source, options| +LiquidSpec.compile do |_ctx, source, options| # Force strict mode options = { error_mode: :strict }.merge(options) Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |_ctx, template, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( From bbcf8d6ad8a8b1e051a7f013f84168ed7f470bab Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Mon, 12 Jan 2026 13:24:35 -0500 Subject: [PATCH 2/4] Better matrix CI check names --- .github/workflows/liquid.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/liquid.yml b/.github/workflows/liquid.yml index de57dd68d..3e26a7517 100644 --- a/.github/workflows/liquid.yml +++ b/.github/workflows/liquid.yml @@ -32,7 +32,7 @@ jobs: } - { ruby: head, allowed-failure: true, rubyopt: "--yjit" } - { ruby: head, allowed-failure: true, rubyopt: "--zjit" } - name: Test Ruby ${{ matrix.entry.ruby }} + name: Test Ruby ${{ matrix.entry.ruby }} ${{ matrix.entry.rubyopt }} --${{ matrix.entry.allowed-failure && 'allowed-failure' || 'strict' }} steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - uses: ruby/setup-ruby@a25f1e45f0e65a92fcb1e95e8847f78fb0a7197a # v1.273.0 From 7d90b524ea4450f473b4ece5aa1c12af2dece47b Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Mon, 12 Jan 2026 13:25:56 -0500 Subject: [PATCH 3/4] Remove on pull_request trigger. It's redundant. --- .github/workflows/liquid.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/liquid.yml b/.github/workflows/liquid.yml index 3e26a7517..c018a4954 100644 --- a/.github/workflows/liquid.yml +++ b/.github/workflows/liquid.yml @@ -1,5 +1,5 @@ name: Liquid -on: [push, pull_request] +on: [push] env: BUNDLE_JOBS: 4 From aa817c4cfd8a0ca693698193a4d6d19c1ecbe42e Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Tue, 13 Jan 2026 13:06:55 -0500 Subject: [PATCH 4/4] Update liquid-spec adapters for new ctx-based API liquid-spec main changed the adapter API: - compile block now receives (ctx, source, options) and should store the template in ctx[:template] - render block now receives (ctx, assigns, options) and retrieves the template from ctx[:template] Co-Authored-By: Claude Opus 4.5 --- Gemfile | 1 - spec/ruby_liquid.rb | 11 +++++------ spec/ruby_liquid_lax.rb | 8 ++++---- spec/ruby_liquid_with_active_support.rb | 11 +++++------ spec/ruby_liquid_yjit.rb | 8 ++++---- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index 4b68a939a..a6c448617 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,6 @@ group :test do end group :spec do - # Using feature branch until https://github.com/Shopify/liquid-spec/pull/97 is merged gem 'liquid-spec', github: 'Shopify/liquid-spec', branch: 'main' gem 'activesupport', require: false end diff --git a/spec/ruby_liquid.rb b/spec/ruby_liquid.rb index 8d7f651bb..628fbbfe3 100644 --- a/spec/ruby_liquid.rb +++ b/spec/ruby_liquid.rb @@ -13,16 +13,15 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |_ctx, source, options| - Liquid::Template.parse(source, **options) +LiquidSpec.compile do |ctx, source, options| + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -# @param ctx [Hash] adapter context (unused) -# @param template [Liquid::Template] compiled template +# @param ctx [Hash] adapter context containing :template # @param assigns [Hash] environment variables # @param options [Hash] :registers, :strict_errors, :exception_renderer -LiquidSpec.render do |_ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -33,5 +32,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end diff --git a/spec/ruby_liquid_lax.rb b/spec/ruby_liquid_lax.rb index 79f4518c0..4681ad415 100644 --- a/spec/ruby_liquid_lax.rb +++ b/spec/ruby_liquid_lax.rb @@ -12,14 +12,14 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |_ctx, source, options| +LiquidSpec.compile do |ctx, source, options| # Force lax mode options = options.merge(error_mode: :lax) - Liquid::Template.parse(source, **options) + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -LiquidSpec.render do |_ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -30,5 +30,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end diff --git a/spec/ruby_liquid_with_active_support.rb b/spec/ruby_liquid_with_active_support.rb index b577668d6..d8b05f76c 100644 --- a/spec/ruby_liquid_with_active_support.rb +++ b/spec/ruby_liquid_with_active_support.rb @@ -14,16 +14,15 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |_ctx, source, options| - Liquid::Template.parse(source, **options) +LiquidSpec.compile do |ctx, source, options| + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -# @param ctx [Hash] adapter context (unused) -# @param template [Liquid::Template] compiled template +# @param ctx [Hash] adapter context containing :template # @param assigns [Hash] environment variables # @param options [Hash] :registers, :strict_errors, :exception_renderer -LiquidSpec.render do |_ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -34,5 +33,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end diff --git a/spec/ruby_liquid_yjit.rb b/spec/ruby_liquid_yjit.rb index d30afb8ac..3ff51d1fd 100644 --- a/spec/ruby_liquid_yjit.rb +++ b/spec/ruby_liquid_yjit.rb @@ -19,14 +19,14 @@ end # Compile a template string into a Liquid::Template -LiquidSpec.compile do |_ctx, source, options| +LiquidSpec.compile do |ctx, source, options| # Force strict mode options = { error_mode: :strict }.merge(options) - Liquid::Template.parse(source, **options) + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -LiquidSpec.render do |_ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -37,5 +37,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end