weppos / publicsuffix-ruby

Domain name parser for Ruby based on the Public Suffix List.
https://simonecarletti.com/code/publicsuffix
MIT License
620 stars 109 forks source link

Ruby 2.7 warning about PublicSuffix::List.default #167

Closed BrianHawley closed 4 years ago

BrianHawley commented 4 years ago

Seen in testing:

.../publicsuffix-ruby/lib/public_suffix/list.rb:51: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
.../publicsuffix-ruby/lib/public_suffix/list.rb:69: warning: The called method `parse' is defined here
koic commented 4 years ago

FYI, Ruby 2.8.0-dev does not perform deprecation warnings and implicit conversions. https://github.com/ruby/ruby/pull/2794

With this change, the following error occurs in Ruby 2.8.0-dev.

% ruby -v
ruby 2.8.0dev (2020-01-05T05:35:14Z master 54fd50c951) [x86_64-darwin17]
% bundle exec rake
(snip)

Error:
AcceptanceTest#test_ignore_private:
ArgumentError: wrong number of arguments (given 2, expected 1)
    /Users/koic/src/github.com/weppos/publicsuffix-ruby/lib/public_suffix/list.rb:69:in `parse'
    /Users/koic/src/github.com/weppos/publicsuffix-ruby/lib/public_suffix/list.rb:51:in `default'
    /Users/koic/src/github.com/weppos/publicsuffix-ruby/lib/public_suffix.rb:69:in `parse'
    /Users/koic/src/github.com/weppos/publicsuffix-ruby/lib/public_suffix.rb:143:in `domain'
    /Users/koic/src/github.com/weppos/publicsuffix-ruby/test/acceptance_test.rb:105:in `block in test_ignore_private'
    /Users/koic/src/github.com/weppos/publicsuffix-ruby/test/acceptance_test.rb:101:in `each'
    /Users/koic/src/github.com/weppos/publicsuffix-ruby/test/acceptance_test.rb:101:in `test_ignore_private'

I look forward to this patch release of public_suffix gem because that resolves the error of Ruby 2.8.0-dev CI matrix in dependent gems.

weppos commented 4 years ago

@koic are you able to confirm that https://github.com/weppos/publicsuffix-ruby/pull/168 will solve your issue in Ruby 2.8.0-dev?

weppos commented 4 years ago

Actually, I believe I can confirm it does given the CI run completed.

weppos commented 4 years ago

4.0.3 packaged and released. Thanks.

koic commented 4 years ago

Thanks for your prompt reply! Yeah, #168 solved my issue in Ruby 2.8.0-dev. BTW, rubygems.org doesn't seem to have released 4.0.3 yet. Could you please confirm at your convenience? https://rubygems.org/gems/public_suffix

weppos commented 4 years ago

It should be released now.

koic commented 4 years ago

Thank you!