Skip to content

Fix Ruby 2.7 Deprecation Warning About Keyword Args #453

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

Merged
merged 2 commits into from
Apr 5, 2020

Conversation

tit
Copy link
Contributor

@tit tit commented Feb 19, 2020

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • [*] Ensure all commits include DCO sign-off.
  • [*] Ensure that your contributions pass unit testing.
  • [*] Ensure that your contributions contain documentation if applicable.

Description

This code call Ruby warning:

return str.encode(default_encoding, str.encoding, encoding_options) if str.valid_encoding?
# => warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

@see https://piechowski.io/post/last-arg-keyword-deprecated-ruby-2-7/

Signed-off-by: Sergey Blohin sblohin@yandex.ru

```
$ ruby --version

$ irb -r git
```

This warning call because lines 1055 and 1057 have old Ruby syntax.

```
return str.encode(default_encoding, str.encoding, encoding_options) if str.valid_encoding?
```

@see https://piechowski.io/post/last-arg-keyword-deprecated-ruby-2-7/

Signed-off-by: Marcel Hoyer <mhoyer@pixelplastic.de>
Signed-off-by: Sergey Blohin <sblohin@yandex.ru>
@jcouball jcouball changed the title Ruby version compatibility conflict solution Fix Ruby 2.7 Deprecation Warning About Keyword Args Apr 5, 2020
Copy link
Member

@jcouball jcouball left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you!

@jcouball jcouball merged commit af4902b into ruby-git:master Apr 5, 2020
@pyrmont pyrmont mentioned this pull request Apr 14, 2020
@jcouball jcouball mentioned this pull request Apr 19, 2020
3 tasks
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.

3 participants