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

Use OpenStruct only if available #562

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Use OpenStruct only if available #562

merged 1 commit into from
Apr 29, 2024

Conversation

yahonda
Copy link
Member

@yahonda yahonda commented Apr 16, 2024

This commit uses OpenStruct only if available because of the following reasons:

  • Starting from Ruby 3.4.0dev, Using ostruct raises the following warning.

ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.

  • And when the warning category is :performance it also raises this warning.

"OpenStruct use is discouraged for performance reasons

Refer to
https://bugs.ruby-lang.org/issues/20309
ruby/ruby#10428
ruby/ostruct#56
Fix #561

This commit uses OpenStruct only if available because of the following reasons:

- Starting from Ruby 3.4.0dev, Using `ostruct` raises the following warning.
> ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.

- And when the warning category is `:performance` it also raises this warning.
> "OpenStruct use is discouraged for performance reasons

Refer to
https://bugs.ruby-lang.org/issues/20309
ruby/ruby#10428
ruby/ostruct#56
Fix #561
@dhh dhh merged commit 0919e3f into rails:main Apr 29, 2024
38 checks passed
that-jill referenced this pull request in powerhome/power-web-development-interview May 1, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jbuilder](https://github.com/rails/jbuilder)
([changelog](https://github.com/rails/jbuilder/releases/tag/v2.12.0))
| `2.11.5` -> `2.12.0` |
[![age](https://developer.mend.io/api/mc/badges/age/rubygems/jbuilder/2.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/rubygems/jbuilder/2.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/rubygems/jbuilder/2.11.5/2.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/rubygems/jbuilder/2.11.5/2.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>rails/jbuilder (jbuilder)</summary>

###
[`v2.12.0`](https://github.com/rails/jbuilder/releases/tag/v2.12.0)

[Compare
Source](https://github.com/rails/jbuilder/compare/v2.11.5...v2.12.0)

#### What's Changed

- Use OpenStruct only if available by
[@&#8203;yahonda](https://github.com/yahonda) in
[https://github.com/rails/jbuilder/pull/562](https://github.com/rails/jbuilder/pull/562)
- Replace deprecated `ProxyObject` with `BasicObject` by
[@&#8203;Earlopain](https://github.com/Earlopain) in
[https://github.com/rails/jbuilder/pull/563](https://github.com/rails/jbuilder/pull/563)
- Avoid loading `ActionController::API` constant by
[@&#8203;nvasilevski](https://github.com/nvasilevski) in
[https://github.com/rails/jbuilder/pull/529](https://github.com/rails/jbuilder/pull/529)
- Fixed a bug where
[#&#8203;501](https://github.com/rails/jbuilder/issues/501) broke
compatibility with Enumerable by
[@&#8203;yuki24](https://github.com/yuki24) in
[https://github.com/rails/jbuilder/pull/531](https://github.com/rails/jbuilder/pull/531)
- Fix namespace issue when generating jbuilder views by
[@&#8203;hahmed](https://github.com/hahmed) in
[https://github.com/rails/jbuilder/pull/536](https://github.com/rails/jbuilder/pull/536)
- Remove reliance on ERBTracker from rails by
[@&#8203;HParker](https://github.com/HParker) in
[https://github.com/rails/jbuilder/pull/504](https://github.com/rails/jbuilder/pull/504)
- Fix require path of dependency_tracker in railtie.rb by
[@&#8203;jalyna](https://github.com/jalyna) in
[https://github.com/rails/jbuilder/pull/552](https://github.com/rails/jbuilder/pull/552)

#### New Contributors

- [@&#8203;nvasilevski](https://github.com/nvasilevski) made their
first contribution in
[https://github.com/rails/jbuilder/pull/529](https://github.com/rails/jbuilder/pull/529)
- [@&#8203;okuramasafumi](https://github.com/okuramasafumi) made their
first contribution in
[https://github.com/rails/jbuilder/pull/526](https://github.com/rails/jbuilder/pull/526)
- [@&#8203;berkos](https://github.com/berkos) made their first
contribution in
[https://github.com/rails/jbuilder/pull/528](https://github.com/rails/jbuilder/pull/528)
- [@&#8203;hahmed](https://github.com/hahmed) made their first
contribution in
[https://github.com/rails/jbuilder/pull/536](https://github.com/rails/jbuilder/pull/536)
- [@&#8203;casperisfine](https://github.com/casperisfine) made their
first contribution in
[https://github.com/rails/jbuilder/pull/550](https://github.com/rails/jbuilder/pull/550)
- [@&#8203;jalyna](https://github.com/jalyna) made their first
contribution in
[https://github.com/rails/jbuilder/pull/552](https://github.com/rails/jbuilder/pull/552)
- [@&#8203;yahonda](https://github.com/yahonda) made their first
contribution in
[https://github.com/rails/jbuilder/pull/562](https://github.com/rails/jbuilder/pull/562)
- [@&#8203;Earlopain](https://github.com/Earlopain) made their first
contribution in
[https://github.com/rails/jbuilder/pull/563](https://github.com/rails/jbuilder/pull/563)
- [@&#8203;stefannibrasil](https://github.com/stefannibrasil) made
their first contribution in
[https://github.com/rails/jbuilder/pull/539](https://github.com/rails/jbuilder/pull/539)

**Full Changelog**:
rails/jbuilder@v2.11.5...v2.12.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/powerhome/power-web-development-interview).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ruby 3.4.0dev deprecates OpenStruct
2 participants