-
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
pathutil.rb:502: warning: Using the last argument as keyword parameters is deprecated #4
Comments
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
Apparently this is now causing the gem to outright break under Ruby 3.0.0...
|
@ISSOtm I am also stuck with the same issue, did you find any solution for that? |
I reverted to |
I got this on a jekyll project as well with ruby 3.0.1. Reverted to Ruby2.7 for the time being but I hope this is fixed soon. |
I was able to make it work on ruby 3.0.1 by the changes suggested in this #5 PR. |
More explicit steps for those intimidated by the process of editing a file such as
Then find occurrences of For example, the
Repeat for other occurrences, save, then try something like That updated file is now saved just on your system, under that specific ruby version. |
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. |
Description
Using ruby 2.7.0, when starting a local development jekyll server (which uses pathutil 16.2), I see the following warning:
It looks like this deprecation warning is in preparation for ruby 3. See "Separation of positional and keyword arguments in Ruby 3.0".
Steps
Output
Note the warning after the
Jekyll Feed
step.Expected
Note the lack warning after the
Jekyll Feed
step.The text was updated successfully, but these errors were encountered: