diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7fc5a46..37409a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: matrix: gemfile: [rails_6_1, rails_7_0, rails_7_1, rails_master] # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' - ruby: ['3.0', 3.1, 3.2] + ruby: ['3.0', 3.1, 3.2, 3.3] runs-on: ubuntu-latest env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile diff --git a/.travis.yml b/.travis.yml index 337ab14..9535ffd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,5 @@ rvm: - 3.0 - 3.1 - 3.2 + - 3.3 script: bin/test diff --git a/Dockerfile b/Dockerfile index 4040e1e..901ea40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.2.3 +FROM ruby:3.3.0 RUN apt-get update -qq WORKDIR /app diff --git a/lib/rbexy/runtime.rb b/lib/rbexy/runtime.rb index aa09a39..bab1b09 100644 --- a/lib/rbexy/runtime.rb +++ b/lib/rbexy/runtime.rb @@ -30,7 +30,7 @@ def evaluate(code) @output_buffer = ActionView::OutputBuffer.new instance_eval(code) rescue => e - e.set_backtrace(e.backtrace.map { |l| l.gsub("(eval)", "(rbx template string)") }) + e.set_backtrace(e.backtrace.map { |l| l.gsub(/\(eval( at [^)]+)?\)/, "(rbx template string)") }) raise e end end diff --git a/spec/dummy/.ruby-version b/spec/dummy/.ruby-version index ab96aa9..03463f3 100644 --- a/spec/dummy/.ruby-version +++ b/spec/dummy/.ruby-version @@ -1 +1 @@ -ruby-3.2.3 +ruby-3.3.0 diff --git a/spec/integration/component_spec.rb b/spec/integration/component_spec.rb index bc18285..a2de543 100644 --- a/spec/integration/component_spec.rb +++ b/spec/integration/component_spec.rb @@ -65,7 +65,8 @@ def call expect { ErroringComponent.new(view_context).render_in } .to raise_error do |error| expect(error.backtrace[0]).to include "erroring_component.rbx:3" - expect(error.backtrace[1]).to include "erroring_component.rbx:3:in `times'" + # Ruby <3.3 show the rbx file name, 3.3 shows :237 + expect(error.backtrace[1]).to include "in `times'" expect(error.backtrace[2]).to include "component_spec.rb" end end