Skip to content

Commit

Permalink
Add Support for Ruby 3.3
Browse files Browse the repository at this point in the history
Only change is minor backtrace format expectations.
  • Loading branch information
zacheryph authored and patbenatar committed Feb 25, 2024
1 parent 08fc0b1 commit b1d0d35
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ rvm:
- 3.0
- 3.1
- 3.2
- 3.3
script: bin/test
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.3
FROM ruby:3.3.0
RUN apt-get update -qq

WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion lib/rbexy/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.2.3
ruby-3.3.0
3 changes: 2 additions & 1 deletion spec/integration/component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <internal:numeric>:237
expect(error.backtrace[1]).to include "in `times'"
expect(error.backtrace[2]).to include "component_spec.rb"
end
end
Expand Down

0 comments on commit b1d0d35

Please sign in to comment.