Closed lcmen closed 4 months ago
I've also had to fixed it in #41 (but an explicit PR might be better).
@javierjulio @deivid-rodriguez who can I ping to merge it and release a new version?
Closes https://github.com/serpapi/turbo_tests/issues/52, which I created because such an issue would have saved me 15 minutes (I looked only in Issues, not in PRs).
Thank you @ilyazub !
Released in v2.2.1: https://rubygems.org/gems/turbo_tests/versions/2.2.1.
Thanks all ❤️ (I'm maintainer of json gem)
This PR introduced a problem in Ruby-core CI: https://github.com/ruby/ruby/pull/10496.
@ilyazub I encountered the same JSON gem related error in the rspec-rails repo when submitting a PR. I resolved that issue initially by requiring OpenStruct but since it was only one instance, I replaced it later with a Struct instead due to maintainer's suggestion. I wonder if it would help to do that same replacement here too? In general, it's long been advised to not use OpenStruct anyway.
@ilyazub I have a patch in https://github.com/serpapi/turbo_tests/pull/53 ready for review that should replace the OpenStruct with a Struct instead so the ostruct
dependency can be removed safely.
@javierjulio Makes sense. Thank you for debugging it!
I encountered the same JSON gem related error in the rspec-rails repo when submitting a PR.
I understood the consequences (rspec-rails
/ruby-core
had issues), but not the actual root cause. What error it was in the rspec-rails
repo?
@ilyazub you're welcome! It was the same error as reported here, essentially a "NameError: uninitialized constant OpenStruct" error message. This is a failed build on rspec-rails from my first PR where that error occurred. I'm not sure I understand the root cause but it's tied to the json gem somehow. The understanding I and others came to elsewhere was it would be best to remove the OpenStruct usage rather than continue to rely on it.
Thank you @javierjulio! https://github.com/rspec/rspec-rails/pull/2755 makes total sense.
Thank you guys for addressing from bigger picture perspective 🙇 . I wasn't aware of the problem in other repos.
The latest
json
gem version (2.7.2 for the time being) no longer requiresOpenStruct
(PR: https://github.com/flori/json/pull/565/files) making this gem incompatible with it.This PR modifies the codebase to explicitly
require 'ostruct'
so JSON gem is aware of it but most importantly it makesOpenStruct
available in lib/utils/hash_extension.