microformats / microformats-ruby

Ruby gem that parse HTML containing microformats/microformats2 and returns Ruby objects, a Ruby hash or a JSON hash
https://rubygems.org/gems/microformats
Creative Commons Zero v1.0 Universal
100 stars 29 forks source link

Fix ruby 2.7 warning in open() #114

Closed hugopeixoto closed 4 years ago

hugopeixoto commented 4 years ago

parser.rb:46: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

This warning was introduced in 2.7 so that codebases can get ready for ruby 3, where conversion from Hashes into keyword parameters will be dropped:

https://blog.bigbinary.com/2020/04/14/ruby-2-7-deprecates-conversion-of-keyword-arguments.html

parser.rb:46: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

This was announced in ruby 2.5, but there was no movement until 2.7: https://bugs.ruby-lang.org/issues/15893

Since we still support ruby 2.4.x, which didn't support URI.open, there's a fallback to Kernel#open. When ruby 2.4.x support is removed, this fallback can be removed as well.