-
Notifications
You must be signed in to change notification settings - Fork 791
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
Fix deprecation warning for Ruby 2.7 in base.rb. #660
Conversation
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 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. |
Yes, it is on my list I'm doing sometime next week |
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.
Resolves #659. This causes a new deprecation warning in sprockets-rails, but I'm opening a PR in sprockets-rails to fix that next.