Skip to content

Commit

Permalink
Merge pull request #652 from byroot/v2.7.x-pure-compat
Browse files Browse the repository at this point in the history
Instantiate Parser with a kwsplat
  • Loading branch information
byroot authored Oct 25, 2024
2 parents 31a9100 + 4af0ea5 commit 04b43d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changes

* Workaround another issue caused by conflicting versions of both `json_pure` and `json` being loaded.

### 2024-10-25 (2.7.4)

* Workaround a bug in 3.4.8 and older https://github.com/rubygems/rubygems/pull/6490.
Expand Down
7 changes: 6 additions & 1 deletion lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ def parse(source, opts = nil)
if opts.nil?
Parser.new(source).parse
else
Parser.new(source, opts).parse
# NB: The ** shouldn't be required, but we have to deal with
# different versions of the `json` and `json_pure` gems being
# loaded concurrently.
# Prior to 2.7.3, `JSON::Ext::Parser` would only take kwargs.
# Ref: https://github.com/ruby/json/issues/650
Parser.new(source, **opts).parse
end
end

Expand Down

0 comments on commit 04b43d2

Please sign in to comment.