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

Fix deprecation warning for Ruby 2.7 in base.rb. #660

Merged
merged 2 commits into from
Dec 27, 2019

Conversation

connorshea
Copy link
Contributor

Resolves #659. This causes a new deprecation warning in sprockets-rails, but I'm opening a PR in sprockets-rails to fix that next.

@connorshea
Copy link
Contributor Author

rails/sprockets-rails#454 actually may be the only PR that needs to be merged here. The deprecation warning is fixed by the change in sprockets-rails regardless of whether this change is present.

That said, if the deprecation warning weren't fixed in sprockets, I wouldn't have known that there was a problem in sprockets-rails. So I think this might be worth fixing to make it easier to determine the true source of deprecation warnings in other gems.

@@ -115,8 +115,8 @@ def find_all_linked_assets(*args)
#
# environment['application.js']
#
def [](*args)
find_asset(*args)
def [](*args, **options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spockets-rails method call should not raise any warning since it is passing a hash as second argument, not keyword arguments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. It is because find_asset is doing the split.

@rafaelfranca rafaelfranca merged commit b1d2da8 into rails:master Dec 27, 2019
@connorshea connorshea deleted the ruby-27-deprecation-fixes branch December 29, 2019 22:52
@yahonda
Copy link
Member

yahonda commented May 8, 2020

@rafaelfranca Would you consider to release the next version of sprockets including this fix? Since Rails 6.0.3 has been released to address Ruby 2.7 keyword arguments deprecation warnings.
sprockets 4.0.0 and sprockets-rails 3.2.1 still show these warnings.

@rafaelfranca
Copy link
Member

Yes, it is on my list I'm doing sometime next week

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jun 7, 2020
Update ruby-sprockets to 4.0.2.


## 4.0.2

- Fix `etag` and digest path compilation that were generating string with invalid digest since 4.0.1.

## 4.0.1

- Fix for Ruby 2.7 keyword arguments warning in `base.rb`. [#660](rails/sprockets#660)
- Fix for when `x_sprockets_linecount` is missing from a source map.
- Fix subresource integrity to match the digest of the asset.
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 2.7 deprecation warning
3 participants