Skip to content

Commit

Permalink
Merge pull request #691 from casperisfine/ruby-3.2-raise
Browse files Browse the repository at this point in the history
Fix the Kernel#raise patch to be Ruby 3.2 compatible
  • Loading branch information
byroot authored Jan 9, 2023
2 parents 4581232 + 21e272f commit 77fbbfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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

0 comments on commit 77fbbfb

Please sign in to comment.