daddyz / phonelib

Ruby gem for phone validation and formatting using google libphonenumber library data
MIT License
1.04k stars 130 forks source link

Fix for ruby 2.7 deprecation warning #245

Closed james-caresnap closed 2 years ago

james-caresnap commented 2 years ago

Fixes a deprecation warning introduced by changes in Ruby 2.7 handling of positional vs keyword arguments. I believe this also improves Ruby 3 compatibility since the changes in 2.7 were in preparation for a transition to Ruby 3.

Details: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

Fixes #233

Note: I only tested this against ruby 2.7. I think this should work transparently under 2.6, but I'm not sure. Looks like CI tests 2.5.x and 2.6.x

james-caresnap commented 2 years ago

Looks like this failed the ruby 1.9.x test suites. Obviously the double splat operator was introduced in 2.0. How badly do you want to keep 1.9.x compatibility?