Skip to content
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

OpenStruct is deprecated #11163

Open
JamieMagee opened this issue Dec 20, 2024 · 0 comments
Open

OpenStruct is deprecated #11163

JamieMagee opened this issue Dec 20, 2024 · 0 comments
Labels

Comments

@JamieMagee
Copy link
Contributor

Code improvement description

As of Ruby 3.4.0 OpenStruct (AKA ostruct) has been deprecated and is no longer loaded by default. In Ruby 3.5.0 it will be completely removed1.

There are currently a couple of places where we use OpenStruct:

  • common/lib/dependabot/git_metadata_fetcher.rb
  • dependabot/file_fetchers/base.rb
  • metadata_finders/base/changelog_finder.rb
  • metadata_finders/base/release_finder.rb

These should be migrated to, preferably, ruby classes or hashes.

If we don't want to do this, for some reason, we can also add an explicit reference to the ostruct gem2

Footnotes

  1. https://bugs.ruby-lang.org/issues/20309

  2. https://rubygems.org/gems/ostruct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant