Skip to content

Fix the Kernel#raise patch to be Ruby 3.2 compatible #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ '2.7', '3.0.2', '3.1', 'head' ]
ruby: [ '2.7', '3.0.2', '3.1', '3.2', 'head' ]
rails: [ '6.0', '6.1', '7.0', 'edge' ]
exclude:
- ruby: '3.1'
rails: '6.0'
- ruby: '3.1'
rails: '6.1'
- ruby: '3.2'
rails: '6.0'
- ruby: '3.2'
rails: '6.1'

env:
RAILS_VERSION: ${{ matrix.rails }}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next Release

* Fix a small compatibility issue with Ruby 3.2 causing `Kernel#raise` to not accept a `cause`.

## 4.1.0

* * Fix bug which makes commands to freeze when the Rails application is writing to STDERR.
Expand Down
4 changes: 2 additions & 2 deletions lib/spring/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ def shush_backtraces
Kernel.module_eval do
old_raise = Kernel.method(:raise)
remove_method :raise
define_method :raise do |*args|
define_method :raise do |*args, **kwargs|
begin
old_raise.call(*args)
old_raise.call(*args, **kwargs)
ensure
if $!
lib = File.expand_path("..", __FILE__)
Expand Down