Keep the declared MultiJson minimum working after the API rename - #289
Closed
OskarEichler wants to merge 1 commit into
Closed
Keep the declared MultiJson minimum working after the API rename#289OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
apotonick
reviewed
Aug 28, 2026
| def from_json(data, *args) | ||
| data = MultiJSON.parse(data) | ||
| data = defined?(::MultiJSON) ? ::MultiJSON.parse(data) : ::MultiJson.load(data) | ||
| from_hash(data, *args) |
Member
There was a problem hiding this comment.
This is something that should be checked once at compile time, when the gem is loaded, and not at every parsing and rendering invocation. Maybe Claude isn't aware that this is very bad style, but we are.
Member
|
This a non-sense AI SLOP without any human supervision or even testing. The code is guarded in line 1, that code will never run if the gem is not present. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merged #273 uses MultiJSON.parse/generate, but the optional dependency minimum (multi_json 1.14.1) exposes only MultiJson.load/dump. Select legacy names when the modern module is absent.
Reproduction
Verification
nullbreaks parsing #264/Update MultiJSON usage to address deprecations #273 source backports: 544 tests / 700 assertions pass on Ruby 3.2.11, plus 4,410 focused checks and 36 boundary checks. Package retains 104 paths and unchanged compared metadata. All 36 runtime files compile on both Rubies; no newly introduced default Lint offenses.With multi_json 1.14.1 as well as installed 1.21.1, 140 focused JSON roundtrips pass on Ruby 4.0.6 with deprecation warnings enabled. Current master against 1.14.1 reproduces NameError for MultiJSON. The isolated old-version suite retains the same 545/701 result and eight Ruby 4 inspection failures.
Breaking changes / limitations
No dependency bump or range narrowing. Modern MultiJSON stays on its warning-free API and the declared legacy range works again.
No new/modified checked-in tests. Ruby 2.4–3.1, JRuby, Windows and Linux were not executed locally. Ruby >=2.4 and runtime dependency ranges remain unchanged. External test tooling supplies a legacy MiniTest alias and ruby-prof 1.7.x; no assertions were changed. No production verification is claimed.