-
Notifications
You must be signed in to change notification settings - Fork 8
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 ruby keyword parameter deprecation warnings #5
base: master
Are you sure you want to change the base?
Conversation
In ruby 2.7, using the last argument as keyword parameters became deprecated in preparation for ruby 3.0. When running the tests, we saw numerous deprecation warnings. This commit fixes up those deprecation warnings by explicitly passing the last argument(s) as keyword argument(s). See: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ Fixes envygeeks#4 Side note: this commit did not fix the `#binread` method because it was untested, and when attempting to add tests, we got the following failing test: ``` 1) Pathutil#binread when set to normalize should use encode to convert CRLF to LF Failure/Error: File.binread(self, *args, kwd).encode({ :universal_newline => true }) TypeError: no implicit conversion of Hash into Integer # ./lib/pathutil.rb:509:in `binread' # ./lib/pathutil.rb:509:in `binread' # ./spec/tests/lib/pathutil_spec.rb:943:in `block (4 levels) in <top (required)>' ``` ...which appears to be occuring because of an interface mismatch as `IO#binread` does not take keyword arguments. https://ruby-doc.org/core-2.7.1/IO.html#method-c-binread
This now breaks in Ruby 3.0.0, can we get this merged please? @envygeeks |
One year and still waiting to be merge, so sad. The author working time is less now for an open-source project? |
Hey, I'll take a peek today and try and get this merged for ya'll! |
Any update on this issue? Is there any walkaround? |
bummmp 🐛 |
Jekyll depends on `pathutils` and that contains code that won't run on Ruby 3. This PR needs to be merged and the maintainer has gone away (?) envygeeks/pathutil#5
The only walk-around is to make the changes in this PR locally on your pathutil file. Otherwise, if you encountered this issue trying to build Jekyll using Ruby version 3, you'll have to downgrade to Ruby version 2.7.x. I hope this gets merged soon, but it looks like the owner of this repository is MIA. |
@envygeeks Any chance this might be merged? Jekyll depends on pathutil, so it doesn't work on Ruby 3 because of this issue. I don't want to hound you about this issue, but it's been over a year and a half since this PR opened. |
Jekyll v3.9.2 finally removed Jekyll's main dependency on pathutil (jekyll/jekyll@55e3648). Now that Github Pages updated to that version of Jekyll (see github/pages-gem#833), this issue shouldn't affect Github pages or Jekyll anymore. |
@envygeeks this is still very much needed. 22.04 with a bare standard Wiki based on jekyl freaks out without it. |
This looks kind of ridiculous. The diff looks small and simple. Why has this been open for over 2 years? |
So far, what stopped ruby 3.0 working with jekyll was an unmerged PR in the pathutil package[1]. The maintainer being inactive, jekyll chose to instead remove this dependency[2] and GitHub pages has also upgraded its jekyll version to something recent enough now[3]. All that's left to do for us is to add webrick[4] as a dependency to the Gemfile. Fixes: #37 [1]: envygeeks/pathutil#5 [2]: jekyll/jekyll@55e3648 [3]: github/pages-gem#833 [4]: jekyll/jekyll#8523
@envygeeks is there anything that external contributors can help with to get this merged? |
This isn't officially supported by Jekyll and is a bit hacky, so I'm deliberately not documenting the support, however as recent Ubuntu versions now ship with Ruby 3 (not 2.7) and Jekyll isn't showing any signs of moving towards supporting Ruby 3 we're not left with many alternatives. This works around: - github/pages-gem#752 - envygeeks/pathutil#5
This isn't officially supported by Jekyll and is a bit hacky, so I'm deliberately not documenting the support, however as recent Ubuntu versions now ship with Ruby 3 (not 2.7) and Jekyll isn't showing any signs of moving towards supporting Ruby 3 we're not left with many alternatives. This works around: - github/pages-gem#752 - envygeeks/pathutil#5
Jekyll depends on `pathutils` and that contains code that won't run on Ruby 3. This PR needs to be merged and the maintainer has gone away (?) envygeeks/pathutil#5
In ruby 2.7, using the last argument as keyword parameters became
deprecated in preparation for ruby 3.0. When running the tests, we saw
numerous deprecation warnings. This commit fixes up those deprecation
warnings by explicitly passing the last argument(s) as keyword
argument(s).
See: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
Fixes #4
Side note: this commit did not fix the
#binread
method because it wasuntested, and when attempting to add tests, we got the following failing
test:
...which appears to be occuring because of an interface mismatch as
IO#binread
does not take keyword arguments.https://ruby-doc.org/core-2.7.1/IO.html#method-c-binread