ynab / ynab-sdk-ruby

YNAB API Client for Ruby
https://api.ynab.com
Apache License 2.0
65 stars 12 forks source link

fixup ruby 2.7 warning #54

Closed eredi93 closed 4 years ago

eredi93 commented 4 years ago

When using the SDK w/ Ruby 2.7 URI.escape warning are being logged

/../gems/ynab-1.16.0/lib/ynab/configuration.rb:178: warning: URI.escape is obsolete
/../gems/ynab-1.16.0/lib/ynab/api_client.rb:270: warning: URI.escape is obsolete

From the URI docs: https://ruby-doc.org/stdlib-2.6.3/libdoc/uri/rdoc/URI/Escape.html

encode(*arg)click to toggle source Alias for: escape

escape(*arg) Escapes the string, replacing all unsafe characters with codes. This method is obsolete and should not be used. Instead, use CGI.escape, URI.encode_www_form or URI.encode_www_form_component depending on your specific use case.

I just removed the URI.encode as it seems is not really needed. By looking at the source it seems that there are no GET params to escape

eredi93 commented 4 years ago

👋 @bradymholt any chance you could look at this? 🙏

bradymholt commented 4 years ago

Thanks for the PR @eredi93 ! I'll go ahead and merge this. I'll need to update our generation template too but I can do that separately. I'll try to get a new version released today and post back here when it is available.

bradymholt commented 4 years ago

Version 1.18 should drop usage of URI.encode to avoid that error.

eredi93 commented 4 years ago

Thanks @bradymholt 😄