njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
542 stars 135 forks source link

fix: unescape is now in CGI #136

Closed cuvoodoo closed 3 years ago

cuvoodoo commented 3 years ago

URI.unescape was deprecated for a long time. in ruby 3.0 this has been completely removed. uns CGI.unescape instead.

njh commented 3 years ago

This PR looks fine but CGI.escape and URI.escape are not the same - they escape different sets of characters. I have always found this confusing.

cuvoodoo commented 3 years ago

thanks for pointing it out. it seems there is no drop in alternative. URI.encode_www_form_component is an alternative, but maybe not the right one. Else there is the addressable gem, more fitting, but that would a dependency. I'm not knowledgeable enough in ruby-mqtt and the solutions to give the right answer (I mainly fixed it for my case so I can use ruby-mqtt with ruby 3).

ameuret commented 3 years ago

Could this be released as a new gem version? Presumably 0.5.1?