Open tannakartikey opened 2 years ago
URI.escape is also obsolete and it is used in lib/woocommerce_api.rb:100
I have the same problem.
@tannakartikey are you working on a PR?
No, I'm not. Feel free to handle if you want. Thanks.
On Sat, 17 Feb, 2024, 03:42 Ricardo Villagrana, @.***> wrote:
I have the same problem.
@tannakartikey https://github.com/tannakartikey are you working on a PR?
— Reply to this email directly, view it on GitHub https://github.com/woocommerce/wc-api-ruby/issues/57#issuecomment-1949408038, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADHFEB5WUQQ7JRIB3TK24LYT7KT3AVCNFSM53RNDMHKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJUHE2DAOBQGM4A . You are receiving this because you were mentioned.Message ID: @.***>
I have this problem as well. This module is broken as long as arguments are beeing passed to endpoint (which is set in querystring).
See https://github.com/woocommerce/wc-api-ruby/pull/61, this uses the updated method in URI module. Both solutions work, but please include and release, as this module is not usable anymore due to depreciation in Ruby (since 2020).
The obsolete method
URI.encode
is used in the code which is throwing the error while using the gem with the latest Ruby versions e.g.ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux]
.https://github.com/woocommerce/wc-api-ruby/blob/64336712a87ed81269ef68bde5dcdfcfc5ec4b78/lib/woocommerce_api.rb#L100
The method was marked as obsolete many years back in 2009 with https://github.com/ruby/ruby/commit/238b979f1789f95262a267d8df6239806f2859cc
It can be replaced with the
CGI.escape
method.More details: https://bugs.ruby-lang.org/issues/17309
There are many more discussions around the topic on https://bugs.ruby-lang.org/
I have monkeypatched the method in my Rails app until the patch is available on this gem.