Crash: undefined method `escape' for URI:Module (NoMethodError)
Expected Behavior:
I can use the schleuder-cli to list key subscriptions.
Actual Behavior:
The CLI crashes, and it doesn't work:
schleuder-cli32 subscriptions list asdf@schleuder.example.org
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
/usr/local/lib/ruby/gems/3.2/gems/schleuder-cli-0.1.0/lib/schleuder-cli/helper.rb:22:in `block in url': undefined method `escape' for URI:Module (NoMethodError)
"#{URI.escape(k.to_s)}=#{URI.escape(v.to_s)}"
^^^^^^^
from /usr/local/lib/ruby/gems/3.2/gems/schleuder-cli-0.1.0/lib/schleuder-cli/helper.rb:21:in `each'
from /usr/local/lib/ruby/gems/3.2/gems/schleuder-cli-0.1.0/lib/schleuder-cli/helper.rb:21:in `map'
from /usr/local/lib/ruby/gems/3.2/gems/schleuder-cli-0.1.0/lib/schleuder-cli/helper.rb:21:in `url'
from /usr/local/lib/ruby/gems/3.2/gems/schleuder-cli-0.1.0/lib/schleuder-cli/subscriptions.rb:8:in `list'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor.rb:238:in `block in subcommand'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /usr/local/lib/ruby/gems/3.2/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
from /usr/local/lib/ruby/gems/3.2/gems/schleuder-cli-0.1.0/bin/schleuder-cli:7:in `<top (required)>'
from /usr/local/bin/schleuder-cli32:25:in `load'
from /usr/local/bin/schleuder-cli32:25:in `<main>'
Hotfix:
If anyone just needs a quick fix, this worked for me. Just change line 22 in /usr/local/lib/ruby/gems/3.2/gems/schleuder-cli-0.1.0/lib/schleuder-cli/helper.rb
to:
"#{(k.to_s)}=#{(v.to_s)}"
Simply removing the URI.escape
calls worked for me. You need to take care what commands you enter in the future though.