stompgem / stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.
http://stomp.github.com
Apache License 2.0
152 stars 80 forks source link

Warning: constant ::Fixnum is deprecated #165

Closed AlexeyNechitailo closed 4 years ago

AlexeyNechitailo commented 4 years ago

I get following deprecation error when trying to run Rails console after ruby upgrade to v2.5.3.

stomp-1.4.8/lib/connection/netio.rb:156: warning: constant ::Fixnum is deprecated

This happens because of changes related to https://bugs.ruby-lang.org/issues/12005.

ruby --version
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]

Proposed fix https://github.com/stompgem/stomp/pull/167

--- a/lib/connection/netio.rb
+++ b/lib/connection/netio.rb
@@ -116,7 +116,7 @@ module Stomp
           #
           # Note: experiments with JRuby seem to show that socket.ready? never
           # returns true.  It appears that in cases where Ruby returns true
-          # that JRuby returns a Fixnum.  We attempt to adjust for this
+          # that JRuby returns an Integer.  We attempt to adjust for this
           # in the _is_ready? method.
           #
           # Note 2: the draining of new lines must be done _after_ a message
@@ -178,7 +178,7 @@ module Stomp
           # rdy = true
           rdy = false # A test
         else
-          rdy = (rdy.class == Fixnum || rdy.class == TrueClass) ? true : false
+          rdy = (rdy.class == Integer || rdy.class == TrueClass) ? true : false
         end
gmallard commented 4 years ago

Closed. See: cbdd6db on dev branch.