qpid-proton git commit: PROTON:1519 ruby: Integer mapping does not work with Ruby 2.4

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

qpid-proton git commit: PROTON:1519 ruby: Integer mapping does not work with Ruby 2.4

aconway-2
Repository: qpid-proton
Updated Branches:
  refs/heads/master 9eaca615c -> f23b52321


PROTON:1519 ruby: Integer mapping does not work with Ruby 2.4

Ruby < 2.4 had separate Fixnum, Bignum subclasses of Integer. Ruby 2.4 makes
them all the same class, this breaks class-equality type mapping in mapping.rb.

Replaced all uses of Fixnum/Bignum with Integer. Type-mapping now uses
superclass match - type X maps if X is known OR if any superclass of X is known.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f23b5232
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f23b5232
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f23b5232

Branch: refs/heads/master
Commit: f23b52321f3756202f2dd213303c35a87e85f542
Parents: 9eaca61
Author: Jason Frey <[hidden email]>
Authored: Tue Jul 18 11:49:23 2017 -0400
Committer: Alan Conway <[hidden email]>
Committed: Fri Aug 11 09:49:24 2017 -0400

----------------------------------------------------------------------
 proton-c/bindings/ruby/lib/codec/data.rb        | 65 ++++++++++----------
 proton-c/bindings/ruby/lib/codec/mapping.rb     |  6 +-
 proton-c/bindings/ruby/lib/core/connection.rb   |  8 +--
 proton-c/bindings/ruby/lib/core/delivery.rb     |  2 +-
 proton-c/bindings/ruby/lib/core/disposition.rb  |  4 +-
 proton-c/bindings/ruby/lib/core/link.rb         | 20 +++---
 proton-c/bindings/ruby/lib/core/message.rb      |  9 ++-
 proton-c/bindings/ruby/lib/core/receiver.rb     |  6 +-
 proton-c/bindings/ruby/lib/core/sasl.rb         |  4 +-
 proton-c/bindings/ruby/lib/core/sender.rb       |  6 +-
 proton-c/bindings/ruby/lib/core/session.rb      | 10 +--
 proton-c/bindings/ruby/lib/core/ssl_domain.rb   |  2 +-
 proton-c/bindings/ruby/lib/core/terminus.rb     | 10 +--
 proton-c/bindings/ruby/lib/core/transport.rb    | 34 +++++-----
 proton-c/bindings/ruby/lib/handler/acking.rb    |  2 +-
 .../ruby/lib/handler/messaging_handler.rb       |  2 +-
 .../bindings/ruby/lib/messenger/messenger.rb    |  2 +-
 proton-c/bindings/ruby/lib/reactor/reactor.rb   |  4 +-
 18 files changed, 97 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/codec/data.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/codec/data.rb b/proton-c/bindings/ruby/lib/codec/data.rb
index 010177d..01799fd 100644
--- a/proton-c/bindings/ruby/lib/codec/data.rb
+++ b/proton-c/bindings/ruby/lib/codec/data.rb
@@ -82,13 +82,12 @@ module Qpid::Proton::Codec
 
     # Creates a new instance with the specified capacity.
     #
-    # @param capacity [Fixnum, Object] The initial capacity or content.
+    # @param capacity [Integer, Object] The initial capacity or content.
     #
     def initialize(capacity = 16)
-      if (!capacity.nil?) &&
-         (capacity.is_a?(Fixnum) ||
-          capacity.is_a?(Bignum))
-        @data = Cproton.pn_data(capacity)
+      # TODO aconway 2017-08-11: error prone, confusion between capacity and Integer content.
+      if capacity.is_a?(Integer)
+        @data = Cproton.pn_data(capacity.to_i)
         @free = true
       else
         @data = capacity
@@ -165,7 +164,7 @@ module Qpid::Proton::Codec
 
     # Returns the numeric type code of the current node.
     #
-    # @return [Fixnum] The current node type.
+    # @return [Integer] The current node type.
     # @return [nil] If there is no current node.
     #
     def type_code
@@ -175,7 +174,7 @@ module Qpid::Proton::Codec
 
     # Return the type object for the current node
     #
-    # @param [Fixnum] The object type.
+    # @param [Integer] The object type.
     #
     # @see #type_code
     #
@@ -319,7 +318,7 @@ module Qpid::Proton::Codec
     # is the descriptor and may be of any type.
     #
     # @param described [Boolean] True if the array is described.
-    # @param element_type [Fixnum] The AMQP type for each element of the array.
+    # @param element_type [Integer] The AMQP type for each element of the array.
     #
     # @example
     #
@@ -489,7 +488,7 @@ module Qpid::Proton::Codec
 
     # Puts an unsigned byte value.
     #
-    # @param value [Fixnum] The unsigned byte value.
+    # @param value [Integer] The unsigned byte value.
     #
     def ubyte=(value)
       check(Cproton.pn_data_put_ubyte(@data, value))
@@ -498,7 +497,7 @@ module Qpid::Proton::Codec
     # If the current node is an unsigned byte, returns its value. Otherwise,
     # it returns 0.
     #
-    # @return [Fixnum] The unsigned byte value.
+    # @return [Integer] The unsigned byte value.
     #
     def ubyte
       Cproton.pn_data_get_ubyte(@data)
@@ -506,7 +505,7 @@ module Qpid::Proton::Codec
 
     # Puts a byte value.
     #
-    # @param value [Fixnum] The byte value.
+    # @param value [Integer] The byte value.
     #
     def byte=(value)
       check(Cproton.pn_data_put_byte(@data, value))
@@ -515,7 +514,7 @@ module Qpid::Proton::Codec
     # If the current node is an byte, returns its value. Otherwise,
     # it returns 0.
     #
-    # @return [Fixnum] The byte value.
+    # @return [Integer] The byte value.
     #
     def byte
       Cproton.pn_data_get_byte(@data)
@@ -523,7 +522,7 @@ module Qpid::Proton::Codec
 
     # Puts an unsigned short value.
     #
-    # @param value [Fixnum] The unsigned short value
+    # @param value [Integer] The unsigned short value
     #
     def ushort=(value)
       check(Cproton.pn_data_put_ushort(@data, value))
@@ -532,7 +531,7 @@ module Qpid::Proton::Codec
     # If the current node is an unsigned short, returns its value. Otherwise,
     # it returns 0.
     #
-    # @return [Fixnum] The unsigned short value.
+    # @return [Integer] The unsigned short value.
     #
     def ushort
       Cproton.pn_data_get_ushort(@data)
@@ -540,7 +539,7 @@ module Qpid::Proton::Codec
 
     # Puts a short value.
     #
-    # @param value [Fixnum] The short value.
+    # @param value [Integer] The short value.
     #
     def short=(value)
       check(Cproton.pn_data_put_short(@data, value))
@@ -549,7 +548,7 @@ module Qpid::Proton::Codec
     # If the current node is a short, returns its value. Otherwise,
     # returns a 0.
     #
-    # @return [Fixnum] The short value.
+    # @return [Integer] The short value.
     #
     def short
       Cproton.pn_data_get_short(@data)
@@ -557,7 +556,7 @@ module Qpid::Proton::Codec
 
     # Puts an unsigned integer value.
     #
-    # @param value [Fixnum] the unsigned integer value
+    # @param value [Integer] the unsigned integer value
     #
     def uint=(value)
       raise TypeError if value.nil?
@@ -568,7 +567,7 @@ module Qpid::Proton::Codec
     # If the current node is an unsigned int, returns its value. Otherwise,
     # returns 0.
     #
-    # @return [Fixnum] The unsigned integer value.
+    # @return [Integer] The unsigned integer value.
     #
     def uint
       Cproton.pn_data_get_uint(@data)
@@ -586,7 +585,7 @@ module Qpid::Proton::Codec
     # If the current node is an integer, returns its value. Otherwise,
     # returns 0.
     #
-    # @return [Fixnum] The integer value.
+    # @return [Integer] The integer value.
     #
     def int
       Cproton.pn_data_get_int(@data)
@@ -594,7 +593,7 @@ module Qpid::Proton::Codec
 
     # Puts a character value.
     #
-    # @param value [Fixnum] The character value.
+    # @param value [Integer] The character value.
     #
     def char=(value)
       check(Cproton.pn_data_put_char(@data, value))
@@ -603,7 +602,7 @@ module Qpid::Proton::Codec
     # If the current node is a character, returns its value. Otherwise,
     # returns 0.
     #
-    # @return [Fixnum] The character value.
+    # @return [Integer] The character value.
     #
     def char
       Cproton.pn_data_get_char(@data)
@@ -611,7 +610,7 @@ module Qpid::Proton::Codec
 
     # Puts an unsigned long value.
     #
-    # @param value [Fixnum] The unsigned long value.
+    # @param value [Integer] The unsigned long value.
     #
     def ulong=(value)
       raise TypeError if value.nil?
@@ -622,7 +621,7 @@ module Qpid::Proton::Codec
     # If the current node is an unsigned long, returns its value. Otherwise,
     # returns 0.
     #
-    # @return [Fixnum] The unsigned long value.
+    # @return [Integer] The unsigned long value.
     #
     def ulong
       Cproton.pn_data_get_ulong(@data)
@@ -630,7 +629,7 @@ module Qpid::Proton::Codec
 
     # Puts a long value.
     #
-    # @param value [Fixnum] The long value.
+    # @param value [Integer] The long value.
     #
     def long=(value)
       check(Cproton.pn_data_put_long(@data, value))
@@ -638,14 +637,14 @@ module Qpid::Proton::Codec
 
     # If the current node is a long, returns its value. Otherwise, returns 0.
     #
-    # @return [Fixnum] The long value.
+    # @return [Integer] The long value.
     def long
       Cproton.pn_data_get_long(@data)
     end
 
     # Puts a timestamp value.
     #
-    # @param value [Fixnum] The timestamp value.
+    # @param value [Integer] The timestamp value.
     #
     def timestamp=(value)
       value = value.to_i if (!value.nil? && value.is_a?(Time))
@@ -655,7 +654,7 @@ module Qpid::Proton::Codec
     # If the current node is a timestamp, returns its value. Otherwise,
     # returns 0.
     #
-    # @return [Fixnum] The timestamp value.
+    # @return [Integer] The timestamp value.
     #
     def timestamp
       Cproton.pn_data_get_timestamp(@data)
@@ -697,7 +696,7 @@ module Qpid::Proton::Codec
 
     # Puts a decimal32 value.
     #
-    # @param value [Fixnum] The decimal32 value.
+    # @param value [Integer] The decimal32 value.
     #
     def decimal32=(value)
       check(Cproton.pn_data_put_decimal32(@data, value))
@@ -706,7 +705,7 @@ module Qpid::Proton::Codec
     # If the current node is a decimal32, returns its value. Otherwise,
     # returns 0.
     #
-    # @return [Fixnum] The decimal32 value.
+    # @return [Integer] The decimal32 value.
     #
     def decimal32
       Cproton.pn_data_get_decimal32(@data)
@@ -714,7 +713,7 @@ module Qpid::Proton::Codec
 
     # Puts a decimal64 value.
     #
-    # @param value [Fixnum] The decimal64 value.
+    # @param value [Integer] The decimal64 value.
     #
     def decimal64=(value)
       check(Cproton.pn_data_put_decimal64(@data, value))
@@ -723,7 +722,7 @@ module Qpid::Proton::Codec
     # If the current node is a decimal64, returns its value. Otherwise,
     # it returns 0.
     #
-    # @return [Fixnum] The decimal64 value.
+    # @return [Integer] The decimal64 value.
     #
     def decimal64
       Cproton.pn_data_get_decimal64(@data)
@@ -731,7 +730,7 @@ module Qpid::Proton::Codec
 
     # Puts a decimal128 value.
     #
-    # @param value [Fixnum] The decimal128 value.
+    # @param value [Integer] The decimal128 value.
     #
     def decimal128=(value)
       raise TypeError, "invalid decimal128 value: #{value}" if value.nil?
@@ -744,7 +743,7 @@ module Qpid::Proton::Codec
     # If the current node is a decimal128, returns its value. Otherwise,
     # returns 0.
     #
-    # @return [Fixnum] The decimal128 value.
+    # @return [Integer] The decimal128 value.
     #
     def decimal128
       value = ""

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/codec/mapping.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/codec/mapping.rb b/proton-c/bindings/ruby/lib/codec/mapping.rb
index f392b9c..421aadc 100644
--- a/proton-c/bindings/ruby/lib/codec/mapping.rb
+++ b/proton-c/bindings/ruby/lib/codec/mapping.rb
@@ -34,7 +34,7 @@ module Qpid::Proton::Codec
     #
     # * code    - the AMQP code for this type
     # * name    - the AMQP name for this type
-    # * klasses - the Ruby classes for this type
+    # * klasses - native Ruby classes that are mapped to this AMQP type
     # * getter  - overrides the get method for the type
     def initialize(code, name, klasses = nil, getter = nil)
 
@@ -77,7 +77,7 @@ module Qpid::Proton::Codec
     end
 
     def self.for_class(klass) # :nodoc:
-      @@by_class[klass]
+      klass and (@@by_class[klass] or self.for_class(klass.superclass))
     end
 
     def self.for_code(code)
@@ -96,7 +96,7 @@ module Qpid::Proton::Codec
   INT        = Mapping.new(Cproton::PN_INT, "int")
   CHAR       = Mapping.new(Cproton::PN_CHAR, "char")
   ULONG      = Mapping.new(Cproton::PN_ULONG, "ulong")
-  LONG       = Mapping.new(Cproton::PN_LONG, "long", RUBY_VERSION < "2.4" ? [Fixnum, Bignum] : [Integer])
+  LONG       = Mapping.new(Cproton::PN_LONG, "long", [Integer])
   TIMESTAMP  = Mapping.new(Cproton::PN_TIMESTAMP, "timestamp", [Date, Time])
   FLOAT      = Mapping.new(Cproton::PN_FLOAT, "float")
   DOUBLE     = Mapping.new(Cproton::PN_DOUBLE, "double", [Float])

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/connection.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/connection.rb b/proton-c/bindings/ruby/lib/core/connection.rb
index 252193d..c1bcaf3 100644
--- a/proton-c/bindings/ruby/lib/core/connection.rb
+++ b/proton-c/bindings/ruby/lib/core/connection.rb
@@ -224,7 +224,7 @@ module Qpid::Proton
     # @see Endpoint#LOCAL_CLOSED
     # @see Endpoint#LOCAL_MASK
     #
-    # @return [Fixnum] The state flags.
+    # @return [Integer] The state flags.
     #
     def state
       Cproton.pn_connection_state(@impl)
@@ -248,7 +248,7 @@ module Qpid::Proton
     # remote flags, then a match occurs if a*any* of the local or remote flags
     # are set, respectively.
     #
-    # @param mask [Fixnum] The state mask to be matched.
+    # @param mask [Integer] The state mask to be matched.
     #
     # @return [Session] The first matching session, or nil if none matched.
     #
@@ -272,7 +272,7 @@ module Qpid::Proton
     # then a match occurs if *any* of the local ore remote flags are set,
     # respectively.
     #
-    # @param mask [Fixnum] The state mask to be matched.
+    # @param mask [Integer] The state mask to be matched.
     #
     # @return [Link] The first matching link, or nil if none matched.
     #
@@ -307,7 +307,7 @@ module Qpid::Proton
 
     # Returns the code for a connection error.
     #
-    # @return [Fixnum] The error code.
+    # @return [Integer] The error code.
     #
     def error
       Cproton.pn_error_code(Cproton.pn_connection_error(@impl))

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/delivery.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/delivery.rb b/proton-c/bindings/ruby/lib/core/delivery.rb
index 5c0b25c..8849840 100644
--- a/proton-c/bindings/ruby/lib/core/delivery.rb
+++ b/proton-c/bindings/ruby/lib/core/delivery.rb
@@ -104,7 +104,7 @@ module Qpid::Proton
 
     # @!attribute [r] pending
     #
-    # @return [Fixnum] Return the amount of pending message data for the
+    # @return [Integer] Return the amount of pending message data for the
     # delivery.
     #
     proton_caller :pending

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/disposition.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/disposition.rb b/proton-c/bindings/ruby/lib/core/disposition.rb
index 20dafd7..daa7069 100644
--- a/proton-c/bindings/ruby/lib/core/disposition.rb
+++ b/proton-c/bindings/ruby/lib/core/disposition.rb
@@ -62,13 +62,13 @@ module Qpid::Proton
 
     # @!attribute section_number
     #
-    # @return [Fixnum] The section number of the disposition.
+    # @return [Integer] The section number of the disposition.
     #
     proton_accessor :section_number
 
     # @!attribute section_offset
     #
-    #  @return [Fixnum] The section offset of the disposition.
+    #  @return [Integer] The section offset of the disposition.
     #
     proton_accessor :section_offset
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/link.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/link.rb b/proton-c/bindings/ruby/lib/core/link.rb
index 86a307a..97f30f6 100644
--- a/proton-c/bindings/ruby/lib/core/link.rb
+++ b/proton-c/bindings/ruby/lib/core/link.rb
@@ -113,7 +113,7 @@ module Qpid::Proton
     # the link until enough credit is obtained from the receiver to send them
     # over the wire. In this case the balance reported will go negative.
     #
-    # @return [Fixnum] The credit balance.
+    # @return [Integer] The credit balance.
     #
     # @see #flow
     #
@@ -130,7 +130,7 @@ module Qpid::Proton
     # @see #queued
     # @see #credit
     #
-    # @return [Fixnum] The remove view of the credit.
+    # @return [Integer] The remove view of the credit.
     #
     proton_caller :remote_credit
 
@@ -142,7 +142,7 @@ module Qpid::Proton
     # deliveries that might be able to be sent if sufficient credit were issued
     # by the receiving link endpoint.
     #
-    # @return [Fixnum] The available deliveries hint.
+    # @return [Integer] The available deliveries hint.
     #
     # @see Sender#offered
     #
@@ -156,7 +156,7 @@ module Qpid::Proton
     # be insufficient credit to send them to the receiver, or they simply may
     # not have yet had a chance to be written to the wire.
     #
-    # @return [Fixnum] The number of queued deliveries.
+    # @return [Integer] The number of queued deliveries.
     #
     # @see #credit
     #
@@ -203,7 +203,7 @@ module Qpid::Proton
     # When invoked on a Receiver, this operation will return and reset the
     # number of credits the sender has released back to it.
     #
-    # @return [Fixnum] The number of credits drained.
+    # @return [Integer] The number of credits drained.
     #
     proton_caller :drained
 
@@ -243,7 +243,7 @@ module Qpid::Proton
 
     # Returns the next link that matches the given state mask.
     #
-    # @param state_mask [Fixnum] The state mask.
+    # @param state_mask [Integer] The state mask.
     #
     # @return [Sender, Receiver] The next link.
     #
@@ -328,7 +328,7 @@ module Qpid::Proton
 
     # Sets the local sender settle mode.
     #
-    # @param mode [Fixnum] The settle mode.
+    # @param mode [Integer] The settle mode.
     #
     # @see #SND_UNSETTLED
     # @see #SND_SETTLED
@@ -340,7 +340,7 @@ module Qpid::Proton
 
     # Returns the local sender settle mode.
     #
-    # @return [Fixnum] The local sender settle mode.
+    # @return [Integer] The local sender settle mode.
     #
     # @see #snd_settle_mode
     #
@@ -350,7 +350,7 @@ module Qpid::Proton
 
     # Sets the local receiver settle mode.
     #
-    # @param mode [Fixnum] The settle mode.
+    # @param mode [Integer] The settle mode.
     #
     # @see #RCV_FIRST
     # @see #RCV_SECOND
@@ -361,7 +361,7 @@ module Qpid::Proton
 
     # Returns the local receiver settle mode.
     #
-    # @return [Fixnum] The local receiver settle mode.
+    # @return [Integer] The local receiver settle mode.
     #
     def rcv_settle_mode
       Cproton.pn_link_rcv_settle_mode(@impl)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/message.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/message.rb b/proton-c/bindings/ruby/lib/core/message.rb
index 53e7092..26a3ae2 100644
--- a/proton-c/bindings/ruby/lib/core/message.rb
+++ b/proton-c/bindings/ruby/lib/core/message.rb
@@ -224,7 +224,7 @@ module Qpid::Proton
     # * priority - the priority value
     #
     def priority=(priority)
-      raise TypeError.new("invalid priority: #{priority}") if priority.nil? || !([Float, Fixnum].include?(priority.class))
+      raise TypeError.new("invalid priority: #{priority}") if not priority.is_a?(Numeric)
       raise RangeError.new("priority out of range: #{priority}") if ((priority > 255) || (priority < 0))
       Cproton.pn_message_set_priority(@impl, priority.floor)
     end
@@ -242,8 +242,8 @@ module Qpid::Proton
     # * time - the time in milliseconds
     #
     def ttl=(time)
-      raise TypeError.new("invalid ttl: #{time}") if time.nil? || !([Float, Fixnum].include?(time.class))
-      raise RangeError.new("time out of range: #{time}") if ((time < 0))
+      raise TypeError.new("invalid ttl: #{time}") if not time.is_a?(Numeric)
+      raise RangeError.new("ttl out of range: #{time}") if ((time.to_i < 0))
       Cproton.pn_message_set_ttl(@impl, time.floor)
     end
 
@@ -275,9 +275,8 @@ module Qpid::Proton
     # * count - the delivery count
     #
     def delivery_count=(count)
-      raise ::ArgumentError.new("invalid count: #{count}") if count.nil? || !([Float, Fixnum].include?(count.class))
+      raise ::ArgumentError.new("invalid count: #{count}") if not count.is_a?(Numeric)
       raise RangeError.new("count out of range: #{count}") if count < 0
-
       Cproton.pn_message_set_delivery_count(@impl, count.floor)
     end
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/receiver.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/receiver.rb b/proton-c/bindings/ruby/lib/core/receiver.rb
index ca7c5e1..2be36ab 100644
--- a/proton-c/bindings/ruby/lib/core/receiver.rb
+++ b/proton-c/bindings/ruby/lib/core/receiver.rb
@@ -58,7 +58,7 @@ module Qpid::Proton
 
     # Grants credit for incoming deliveries.
     #
-    # @param n [Fixnum] The amount to increment the link credit.
+    # @param n [Integer] The amount to increment the link credit.
     #
     def flow(n)
       Cproton.pn_link_flow(@impl, n)
@@ -74,9 +74,9 @@ module Qpid::Proton
     # #receive until nil is returned, or verify that #partial? is false and
     # Delivery#pending is 0.
     #
-    # @param limit [Fixnum] The maximum bytes to receive.
+    # @param limit [Integer] The maximum bytes to receive.
     #
-    # @return [Fixnum, nil] The number of bytes received, or nil if the end of
+    # @return [Integer, nil] The number of bytes received, or nil if the end of
     # the stream was reached.t
     #
     # @see Deliver#pending To see how much buffer space is needed.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/sasl.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/sasl.rb b/proton-c/bindings/ruby/lib/core/sasl.rb
index 7870652..be57044 100644
--- a/proton-c/bindings/ruby/lib/core/sasl.rb
+++ b/proton-c/bindings/ruby/lib/core/sasl.rb
@@ -73,7 +73,7 @@ module Qpid::Proton
 
     # Returns the outcome of the SASL negotiation.
     #
-    # @return [Fixnum] The outcome.
+    # @return [Integer] The outcome.
     #
     def outcome
       outcome = Cprotn.pn_sasl_outcome(@impl)
@@ -83,7 +83,7 @@ module Qpid::Proton
 
     # Set the condition of the SASL negotiation.
     #
-    # @param outcome [Fixnum] The outcome.
+    # @param outcome [Integer] The outcome.
     #
     def done(outcome)
       Cproton.pn_sasl_done(@impl, outcome)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/sender.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/sender.rb b/proton-c/bindings/ruby/lib/core/sender.rb
index 9ddcaa0..a63ff9f 100644
--- a/proton-c/bindings/ruby/lib/core/sender.rb
+++ b/proton-c/bindings/ruby/lib/core/sender.rb
@@ -33,7 +33,7 @@ module Qpid::Proton
 
     # Signals the availability of deliveries.
     #
-    # @param n [Fixnum] The number of deliveries potentially available.
+    # @param n [Integer] The number of deliveries potentially available.
     #
     def offered(n)
       Cproton.pn_link_offered(@impl, n)
@@ -44,7 +44,7 @@ module Qpid::Proton
     # @param object [Object] The content to send.
     # @param tag [Object] The tag
     #
-    # @return [Fixnum] The number of bytes sent.
+    # @return [Integer] The number of bytes sent.
     #
     def send(object, tag = nil)
       if object.respond_to? :proton_send
@@ -58,7 +58,7 @@ module Qpid::Proton
     #
     # @param bytes [Array] The bytes to send.
     #
-    # @return n [Fixnum] The number of bytes sent.
+    # @return n [Integer] The number of bytes sent.
     #
     def stream(bytes)
       Cproton.pn_link_send(@impl, bytes)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/session.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/session.rb b/proton-c/bindings/ruby/lib/core/session.rb
index 2c9c3a1..1dbb9bd 100644
--- a/proton-c/bindings/ruby/lib/core/session.rb
+++ b/proton-c/bindings/ruby/lib/core/session.rb
@@ -41,7 +41,7 @@ module Qpid::Proton
     # negotatied frame size of the transport, it will be rounded up to one full
     # frame.
     #
-    # @return [Fixnum] The incoing capacity of the session, measured in bytes.
+    # @return [Integer] The incoing capacity of the session, measured in bytes.
     #
     proton_accessor :incoming_capacity
 
@@ -50,13 +50,13 @@ module Qpid::Proton
 
     # @!attribute [r] outgoing_bytes
     #
-    # @return [Fixnum] The number of outgoing bytes currently being buffered.
+    # @return [Integer] The number of outgoing bytes currently being buffered.
     #
     proton_caller :outgoing_bytes
 
     # @!attribute [r] incoming_bytes
     #
-    # @return [Fixnum] The number of incomign bytes currently being buffered.
+    # @return [Integer] The number of incomign bytes currently being buffered.
     #
     proton_caller :incoming_bytes
 
@@ -71,7 +71,7 @@ module Qpid::Proton
 
     # @!attribute [r] state
     #
-    # @return [Fixnum] The endpoint state.
+    # @return [Integer] The endpoint state.
     #
     proton_caller :state
 
@@ -104,7 +104,7 @@ module Qpid::Proton
     # When uses with Connection#session_head an application can access all of
     # the session son the connection that match the given state.
     #
-    # @param state_mask [Fixnum] The state mask to match.
+    # @param state_mask [Integer] The state mask to match.
     #
     # @return [Session, nil] The next session if one matches, or nil.
     #

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/ssl_domain.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/ssl_domain.rb b/proton-c/bindings/ruby/lib/core/ssl_domain.rb
index ef3c03c..26b4e9d 100644
--- a/proton-c/bindings/ruby/lib/core/ssl_domain.rb
+++ b/proton-c/bindings/ruby/lib/core/ssl_domain.rb
@@ -123,7 +123,7 @@ module Qpid::Proton
     # call returns. SSL instances created before invoking this method will use
     # the domain's previous setting.
     #
-    # @param verify_mode [Fixnum] The level of validation to apply to the peer.
+    # @param verify_mode [Integer] The level of validation to apply to the peer.
     # @param trusted_CAs [String] The path to a database of trusted CAs that
     #   the server will advertise to the peer client if the server has been
     #   configured to verify its peer.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/terminus.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/terminus.rb b/proton-c/bindings/ruby/lib/core/terminus.rb
index 4bd22d7..fa2d8ab 100644
--- a/proton-c/bindings/ruby/lib/core/terminus.rb
+++ b/proton-c/bindings/ruby/lib/core/terminus.rb
@@ -73,7 +73,7 @@ module Qpid::Proton
 
     # @!attribute type
     #
-    # @return [Fixnum] The terminus type.
+    # @return [Integer] The terminus type.
     #
     # @see SOURCE
     # @see TARGET
@@ -89,7 +89,7 @@ module Qpid::Proton
 
     # @!attribute durability
     #
-    # @return [Fixnum] The durability mode of the terminus.
+    # @return [Integer] The durability mode of the terminus.
     #
     # @see NONDURABLE
     # @see CONFIGURATION
@@ -99,7 +99,7 @@ module Qpid::Proton
 
     # @!attribute expiry_policy
     #
-    # @return [Fixnum] The expiry policy.
+    # @return [Integer] The expiry policy.
     #
     # @see EXPIRE_WITH_LINK
     # @see EXPIRE_WITH_SESSION
@@ -110,7 +110,7 @@ module Qpid::Proton
 
     # @!attribute timeout
     #
-    # @return [Fixnum] The timeout period.
+    # @return [Integer] The timeout period.
     #
     proton_accessor :timeout
 
@@ -122,7 +122,7 @@ module Qpid::Proton
 
     # @!attribute distribution_mode
     #
-    # @return [Fixnum] The distribution mode.
+    # @return [Integer] The distribution mode.
     #
     # @see DIST_MODE_UNSPECIFIED
     # @see DIST_MODE_COPY

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/core/transport.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/transport.rb b/proton-c/bindings/ruby/lib/core/transport.rb
index 9ba5dc8..c3cacc7 100644
--- a/proton-c/bindings/ruby/lib/core/transport.rb
+++ b/proton-c/bindings/ruby/lib/core/transport.rb
@@ -89,37 +89,37 @@ module Qpid::Proton
 
     # @!attribute channel_max
     #
-    # @return [Fixnum] The maximum allowed channel.
+    # @return [Integer] The maximum allowed channel.
     #
     proton_accessor :channel_max
 
     # @!attribute [r] remote_channel_max
     #
-    # @return [Fixnum] The maximum allowed channel of a transport's remote peer.
+    # @return [Integer] The maximum allowed channel of a transport's remote peer.
     #
     proton_caller :remote_channel_max
 
     # @!attribute max_frame_size
     #
-    # @return [Fixnum] The maximum frame size.
+    # @return [Integer] The maximum frame size.
     #
     proton_accessor :max_frame_size
 
     # @!attribute [r] remote_max_frame_size
     #
-    # @return [Fixnum] The maximum frame size of the transport's remote peer.
+    # @return [Integer] The maximum frame size of the transport's remote peer.
     #
     proton_reader :remote_max_frame_size
 
     # @!attribute idle_timeout
     #
-    # @return [Fixnum] The idle timeout.
+    # @return [Integer] The idle timeout.
     #
     proton_accessor :idle_timeout
 
     # @!attribute [r] remote_idle_timeout
     #
-    # @return [Fixnum] The idle timeout for the transport's remote peer.
+    # @return [Integer] The idle timeout for the transport's remote peer.
     #
     proton_accessor :remote_idle_timeout
 
@@ -135,7 +135,7 @@ module Qpid::Proton
     # Calls to #process may alter the value of this value. See #process for
     # more details
     #
-    # @return [Fixnum] The amount of free space for input following the
+    # @return [Integer] The amount of free space for input following the
     # transport's tail pointer.
     #
     proton_caller :capacity
@@ -170,7 +170,7 @@ module Qpid::Proton
     #
     # Calls to #pop may alter the value of this pointer as well.
     #
-    # @return [Fixnum] The number of pending output bytes following the header
+    # @return [Integer] The number of pending output bytes following the header
     # pointer.
     #
     # @raise [TransportError] If any error other than an end of stream occurs.
@@ -188,13 +188,13 @@ module Qpid::Proton
 
     # @!attribute [r] frames_output
     #
-    # @return [Fixnum] The number of frames output by a transport.
+    # @return [Integer] The number of frames output by a transport.
     #
     proton_reader :frames_output
 
     # @!attribute [r] frames_input
     #
-    # @return [Fixnum] The number of frames input by a transport.
+    # @return [Integer] The number of frames input by a transport.
     #
     proton_reader :frames_input
 
@@ -218,7 +218,7 @@ module Qpid::Proton
 
     # Creates a new transport instance.
     #
-    # @param mode [Fixnum] The transport mode, either CLIENT or SERVER
+    # @param mode [Integer] The transport mode, either CLIENT or SERVER
     # @param impl [pn_transport_t] Should not be used.
     #
     # @raise [TransportError] If the mode is invalid.
@@ -268,7 +268,7 @@ module Qpid::Proton
 
     # Updates the transports trace flags.
     #
-    # @param level [Fixnum] The trace level.
+    # @param level [Integer] The trace level.
     #
     # @see TRACE_OFF
     # @see TRACE_RAW
@@ -302,7 +302,7 @@ module Qpid::Proton
     #
     # @param data [String] The bytes to be pushed.
     #
-    # @return [Fixnum] The number of bytes pushed.
+    # @return [Integer] The number of bytes pushed.
     #
     def push(data)
       Cproton.pn_transport_push(@impl, data, data.length)
@@ -315,7 +315,7 @@ module Qpid::Proton
     # pointer. It may also change the value for #tail, as well as the amount of
     # free space reported by #capacity.
     #
-    # @param size [Fixnum] The number of bytes to process.
+    # @param size [Integer] The number of bytes to process.
     #
     # @raise [TransportError] If an error occurs.
     #
@@ -335,7 +335,7 @@ module Qpid::Proton
 
     # Returns the specified number of bytes from the transport's buffers.
     #
-    # @param size [Fixnum] The number of bytes to return.
+    # @param size [Integer] The number of bytes to return.
     #
     # @return [String] The data peeked.
     #
@@ -351,7 +351,7 @@ module Qpid::Proton
     # Removes the specified number of bytes from the pending output queue
     # following the transport's head pointer.
     #
-    # @param size [Fixnum] The number of bytes to remove.
+    # @param size [Integer] The number of bytes to remove.
     #
     def pop(size)
       Cproton.pn_transport_pop(@impl, size)
@@ -378,7 +378,7 @@ module Qpid::Proton
     #
     # @param now [Time] The timestamp.
     #
-    # @return [Fixnum] If non-zero, the expiration time of the next pending
+    # @return [Integer] If non-zero, the expiration time of the next pending
     #   timer event for the transport. The caller must invoke #tick again at
     #   least once at or before this deadline occurs.
     #

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/handler/acking.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/handler/acking.rb b/proton-c/bindings/ruby/lib/handler/acking.rb
index 2c94cfe..1c4f69d 100644
--- a/proton-c/bindings/ruby/lib/handler/acking.rb
+++ b/proton-c/bindings/ruby/lib/handler/acking.rb
@@ -58,7 +58,7 @@ module Qpid::Proton::Handler
     # is specified.
     #
     # @param delivery [Qpid::Proton::Delivery] The delivery.
-    # @param state [Fixnum] The delivery state.
+    # @param state [Integer] The delivery state.
     #
     def settle(delivery, state = nil)
       delivery.update(state) unless state.nil?

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/handler/messaging_handler.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/handler/messaging_handler.rb b/proton-c/bindings/ruby/lib/handler/messaging_handler.rb
index b4a0bcf..3278452 100644
--- a/proton-c/bindings/ruby/lib/handler/messaging_handler.rb
+++ b/proton-c/bindings/ruby/lib/handler/messaging_handler.rb
@@ -29,7 +29,7 @@ module Qpid::Proton::Handler
 
     # Creates a new instance.
     #
-    # @param [Fixnum] prefetch
+    # @param [Integer] prefetch
     # @param [Boolean] auto_accept
     # @param [Boolean] auto_settle
     # @param [Boolean] peer_close_is_error

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/messenger/messenger.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/messenger/messenger.rb b/proton-c/bindings/ruby/lib/messenger/messenger.rb
index 70a01de..79a9bcf 100644
--- a/proton-c/bindings/ruby/lib/messenger/messenger.rb
+++ b/proton-c/bindings/ruby/lib/messenger/messenger.rb
@@ -694,7 +694,7 @@ module Qpid::Proton::Messenger
     end
 
     def valid_window?(window)
-      !window.nil? && [Float, Fixnum].include?(window.class)
+      !window.nil? && window.is_a?(Numeric)
     end
 
   end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f23b5232/proton-c/bindings/ruby/lib/reactor/reactor.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/reactor/reactor.rb b/proton-c/bindings/ruby/lib/reactor/reactor.rb
index a0ff7e0..a84a716 100644
--- a/proton-c/bindings/ruby/lib/reactor/reactor.rb
+++ b/proton-c/bindings/ruby/lib/reactor/reactor.rb
@@ -89,7 +89,7 @@ module Qpid::Proton::Reactor
 
     # Returns the timeout period.
     #
-    # @return [Fixnum] The timeout period, in seconds.
+    # @return [Integer] The timeout period, in seconds.
     #
     def timeout
       millis_to_timeout(Cproton.pn_reactor_get_timeout(@impl))
@@ -97,7 +97,7 @@ module Qpid::Proton::Reactor
 
     # Sets the timeout period.
     #
-    # @param timeout [Fixnum] The timeout, in seconds.
+    # @param timeout [Integer] The timeout, in seconds.
     #
     def timeout=(timeout)
       Cproton.pn_reactor_set_timeout(@impl, timeout_to_millis(timeout))


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...