iande / onstomp

A STOMP messaging client library for Ruby
http://mathish.com/projects/onstomp.html
Other
23 stars 11 forks source link

escape the undefined method empty? when given a boolean value. #33

Closed sonncui closed 6 years ago

sonncui commented 6 years ago

escape the undefined method empty? when given a boolean value. https://github.com/iande/onstomp/issues/32

sonncui commented 6 years ago

Of course, I will add the test, thanks for reviewing

sonncui commented 6 years ago

Hi iande, I have add the related test, but my question is that why you transfer the boolean value to string value when generate Frame headers using OnStomp::Components::FrameHeaders.new(headers) in https://github.com/iande/onstomp/blob/master/lib/onstomp/components/frame.rb#L20 Although it does no influence on our code, just wonder why to do that transfer.

iande commented 6 years ago

Ultimately the STOMP protocol is only string based, so I imagine my intent was to covert them to strings so the serialization was straightforward when writing out the frames. I think it would have been better to convert values to strings earlier on to prevent the error you surfaced, but since that's a pretty significant and potentially breaking changes, I'll save that for a future version.