http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton.rb 
b/proton-c/bindings/ruby/lib/qpid_proton.rb
index 88f8acd..e8fab77 100644
--- a/proton-c/bindings/ruby/lib/qpid_proton.rb
+++ b/proton-c/bindings/ruby/lib/qpid_proton.rb
@@ -24,19 +24,30 @@ if RUBY_VERSION < "1.9"
 require "kconv"
 end
 
-require "qpid_proton/version"
-require "qpid_proton/described"
-require "qpid_proton/strings"
-require "qpid_proton/mapping"
-require "qpid_proton/array"
-require "qpid_proton/hash"
-require "qpid_proton/exceptions"
-require "qpid_proton/exception_handling"
-require "qpid_proton/filters"
-require "qpid_proton/data"
-require "qpid_proton/message"
-require "qpid_proton/subscription"
-require "qpid_proton/tracker_status"
-require "qpid_proton/tracker"
-require "qpid_proton/selectable"
-require "qpid_proton/messenger"
+# Exception classes
+require "core/exceptions"
+
+# Utility classes
+require "util/version"
+require "util/error_handler"
+
+# Types
+require "types/strings"
+require "types/hash"
+require "types/array"
+require "types/described"
+
+# Codec classes
+require "codec/mapping"
+require "codec/data"
+
+# Main Proton classes
+require "core/message"
+
+# Messenger API classes
+require "messenger/filters"
+require "messenger/subscription"
+require "messenger/tracker_status"
+require "messenger/tracker"
+require "messenger/selectable"
+require "messenger/messenger"

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/array.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/array.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/array.rb
deleted file mode 100644
index a4294a3..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/array.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-#--
-# Patch the Array class to provide methods for adding its contents
-# to a Qpid::Proton::Data instance.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    # Holds the information for an AMQP Array compound type.
-    #
-    # It holds the type for the array and the descriptor if the
-    # array is described.
-    #
-    class ArrayHeader
-      attr_reader :type
-      attr_reader :descriptor
-
-      def initialize(type, descriptor = nil)
-        @type = type
-        @descriptor = descriptor
-      end
-
-      # Returns true if the array is described.
-      def described?
-        !@descriptor.nil?
-      end
-
-      def ==(that)
-        ((@type == that.type) && (@descriptor == that.descriptor))
-      end
-    end
-
-  end
-
-end
-
-class Array # :nodoc:
-
-  # Used to declare an array as an AMQP array.
-  #
-  # The value, if defined, is an instance of Qpid::Proton::ArrayHeader
-  attr_accessor :proton_array_header
-
-  # Returns true if the array is the a Proton described type.
-  def proton_described?
-    !@proton_array_header.nil? && @proton_array_header.described?
-  end
-
-  # Puts the elements of the array into the specified Qpid::Proton::Data 
object.
-  def proton_put(data)
-    raise TypeError, "data object cannot be nil" if data.nil?
-
-    if @proton_array_header.nil?
-      proton_put_list(data)
-    else
-      proton_put_array(data)
-    end
-  end
-
-  private
-
-  def proton_put_list(data)
-    # create a list, then enter it and add each element
-    data.put_list
-    data.enter
-    each do |element|
-      # get the proton type for the element
-      mapping = Qpid::Proton::Mapping.for_class(element.class)
-      # add the element
-      mapping.put(data, element)
-    end
-    # exit the list
-    data.exit
-  end
-
-  def proton_put_array(data)
-    data.put_array(@proton_array_header.described?, @proton_array_header.type)
-    data.enter
-    if @proton_array_header.described?
-      data.symbol = @proton_array_header.descriptor
-    end
-
-    each do |element|
-      @proton_array_header.type.put(data, element)
-    end
-
-    data.exit
-  end
-
-  class << self
-
-    # Gets the elements of an array or list out of the specified
-    # Qpid::Proton::Data object.
-    def proton_get(data)
-      raise TypeError, "can't convert nil into Qpid::Proton::Data" if data.nil?
-
-      type = data.type
-
-      if type == Qpid::Proton::LIST
-        result = proton_get_list(data)
-      elsif type == Qpid::Proton::ARRAY
-        result = proton_get_array(data)
-      else
-        raise TypeError, "element is not a list and not an array"
-      end
-    end
-
-    private
-
-    def proton_get_list(data)
-      size = data.list
-      raise TypeError, "not a list" unless data.enter
-      elements = []
-      (0...size).each do
-        data.next
-        type = data.type
-        raise TypeError, "missing next element in list" unless type
-        elements << type.get(data)
-      end
-      data.exit
-      return elements
-    end
-
-    def proton_get_array(data)
-      count, described, type = data.array
-
-      raise TypeError, "not an array" unless data.enter
-      elements = []
-
-      descriptor = nil
-
-      if described
-        data.next
-        descriptor = data.symbol
-      end
-
-      elements.proton_array_header = Qpid::Proton::ArrayHeader.new(type, 
descriptor)
-      (0...count).each do |which|
-        if data.next
-          etype = data.type
-          raise TypeError, "missing next element in array" unless etype
-          raise TypeError, "invalid array element: #{etype}" unless etype == 
type
-          elements << type.get(data)
-        end
-      end
-      data.exit
-      return elements
-    end
-
-  end
-
-end
-

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/data.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/data.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/data.rb
deleted file mode 100644
index b6b3002..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/data.rb
+++ /dev/null
@@ -1,788 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    # +DataError+ is raised when an error occurs while encoding
-    # or decoding data.
-    class DataError < Exception; end
-
-    # The +Data+ class provides an interface for decoding, extracting,
-    # creating, and encoding arbitrary AMQP data. A +Data+ object
-    # contains a tree of AMQP values. Leaf nodes in this tree correspond
-    # to scalars in the AMQP type system such as INT or STRING. Interior
-    # nodes in this tree correspond to compound values in the AMQP type
-    # system such as *LIST*,*MAP*, *ARRAY*, or *DESCRIBED*. The root node
-    # of the tree is the +Data+ object itself and can have an arbitrary
-    # number of children.
-    #
-    # A +Data+ object maintains the notion of the current sibling node
-    # and a current parent node. Siblings are ordered within their parent.
-    # Values are accessed and/or added by using the #next, #prev,
-    # #enter, and #exit methods to navigate to the desired location in
-    # the tree and using the supplied variety of mutator and accessor
-    # methods to access or add a value of the desired type.
-    #
-    # The mutator methods will always add a value _after_ the current node
-    # in the tree. If the current node has a next sibling the mutator method
-    # will overwrite the value on this node. If there is no current node
-    # or the current node has no next sibling then one will be added. The
-    # accessor methods always set the added/modified node to the current
-    # node. The accessor methods read the value of the current node and do
-    # not change which node is current.
-    #
-    # The following types of scalar values are supported:
-    #
-    # * *NULL*
-    # * *BOOL*
-    # * *UBYTE*
-    # * *BYTE*
-    # * *USHORT*
-    # * *SHORT*
-    # * *UINT*
-    # * *INT*
-    # * *CHAR*
-    # * *ULONG*
-    # * *LONG*
-    # * *TIMESTAMP*
-    # * *FLOAT*
-    # * *DOUBLE*
-    # * *DECIMAL32*
-    # * *DECIMAL64*
-    # * *DECIMAL128*
-    # * *UUID*
-    # * *BINARY*
-    # * *STRING*
-    # * *SYMBOL*
-    #
-    # The following types of compound values are supported:
-    #
-    # * *DESCRIBED*
-    # * *ARRAY*
-    # * *LIST*
-    # * *MAP*
-    #
-    class Data
-
-      # Creates a new instance with the specified capacity.
-      #
-      # ==== Options
-      #
-      # * capacity - the capacity
-      #
-      def initialize(capacity = 16)
-        if (!capacity.nil?) &&
-            (capacity.is_a?(Fixnum) ||
-             capacity.is_a?(Bignum))
-          @data = Cproton.pn_data(capacity)
-          @free = true
-        else
-          @data = capacity
-          @free = false
-        end
-
-        # destructor
-        ObjectSpace.define_finalizer(self, self.class.finalize!(@data))
-      end
-
-      def self.finalize!(data) # :nodoc:
-        proc {
-          Cproton.pn_data_free(data) if @free
-        }
-      end
-
-      def to_s
-        tmp = Cproton.pn_string("")
-        Cproton.pn_inspect(@data, tmp)
-        result = Cproton.pn_string_get(tmp)
-        Cproton.pn_free(tmp)
-        return result
-      end
-
-      # Clears the object.
-      def clear
-        Cproton.pn_data_clear(@data)
-      end
-
-      # Clears the current node and sets the parent to the root node.
-      #
-      # Clearing the current node sets it _before_ the first node, calling
-      # #next will advance to the first node.
-      def rewind
-        Cproton.pn_data_rewind(@data)
-      end
-
-      # Advances the current node to its next sibling and returns its types.
-      #
-      # If there is no next sibling the current node remains unchanged
-      # and nil is returned.
-      def next(print = false)
-        Cproton.pn_data_next(@data)
-      end
-
-      # Advances the current node to its previous sibling and returns its type.
-      #
-      # If there is no previous sibling then the current node remains unchanged
-      # and nil is return.
-      def prev
-        return Cproton.pn_data_prev(@data) ? type : nil
-      end
-
-      # Sets the parent node to the current node and clears the current node.
-      #
-      # Clearing the current node sets it _before_ the first child.
-      def enter
-        Cproton.pn_data_enter(@data)
-      end
-
-      # Sets the current node to the parent node and the parent node to its own
-      # parent.
-      def exit
-        Cproton.pn_data_exit(@data)
-      end
-
-      # Returns the numeric type code of the current node.
-      def type_code
-        dtype = Cproton.pn_data_type(@data)
-        return (dtype == -1) ? nil : dtype
-      end
-
-      # Return the Type object for the current node
-      def type
-        Mapping.for_code(type_code)
-      end
-
-      # Returns a representation of the data encoded in AMQP format.
-      def encode
-        buffer = "\0"*1024
-        loop do
-          cd = Cproton.pn_data_encode(@data, buffer, buffer.length)
-          if cd == Cproton::PN_OVERFLOW
-            buffer *= 2
-          elsif cd >= 0
-            return buffer[0...cd]
-          else
-            check(cd)
-          end
-        end
-      end
-
-      # Decodes the first value from supplied AMQP data and returns the number
-      # of bytes consumed.
-      #
-      # ==== Options
-      #
-      # * encoded - the encoded data
-      #
-      def decode(encoded)
-        check(Cproton.pn_data_decode(@data, encoded, encoded.length))
-      end
-
-      # Puts a list value.
-      #
-      # Elements may be filled by entering the list node and putting element
-      # values.
-      #
-      # ==== Examples
-      #
-      #   data = Qpid::Proton::Data.new
-      #   data.put_list
-      #   data.enter
-      #   data.int = 1
-      #   data.int = 2
-      #   data.int = 3
-      #   data.exit
-      #
-      def put_list
-        check(Cproton.pn_data_put_list(@data))
-      end
-
-      # If the current node is a list, this returns the number of elements.
-      # Otherwise, it returns zero.
-      #
-      # List elements can be accessed by entering the list.
-      #
-      # ==== Examples
-      #
-      #   count = @data.list
-      #   @data.enter
-      #   (0...count).each
-      #     type = @data.next
-      #     puts "Value: #{@data.string}" if type == STRING
-      #     # ... process other node types
-      #   end
-      def list
-        Cproton.pn_data_get_list(@data)
-      end
-
-      # Puts a map value.
-      #
-      # Elements may be filled by entering the map node and putting alternating
-      # key/value pairs.
-      #
-      # ==== Examples
-      #
-      #   data = Qpid::Proton::Data.new
-      #   data.put_map
-      #   data.enter
-      #   data.string = "key"
-      #   data.string = "value"
-      #   data.exit
-      #
-      def put_map
-        check(Cproton.pn_data_put_map(@data))
-      end
-
-      # If the  current node is a map, this returns the number of child
-      # elements. Otherwise, it returns zero.
-      #
-      # Key/value pairs can be accessed by entering the map.
-      #
-      # ==== Examples
-      #
-      #   count = @data.map
-      #   @data.enter
-      #   (0...count).each do
-      #     type = @data.next
-      #     puts "Key=#{@data.string}" if type == STRING
-      #     # ... process other key types
-      #     type = @data.next
-      #     puts "Value=#{@data.string}" if type == STRING
-      #     # ... process other value types
-      #   end
-      #   @data.exit
-      def map
-        Cproton.pn_data_get_map(@data)
-      end
-
-      def get_map # :nodoc:
-        ::Hash.proton_data_get(self)
-      end
-
-      # Puts an array value.
-      #
-      # Elements may be filled by entering the array node and putting the
-      # element values. The values must all be of the specified array element
-      # type.
-      #
-      # If an array is *described* then the first child value of the array
-      # is the descriptor and may be of any type.
-      #
-      # ==== Options
-      #
-      # * described - specifies whether the array is described
-      # * element_type - the type of the array elements
-      #
-      # ==== Examples
-      #
-      #   # create an array of integer values
-      #   data = Qpid::Proton::Data.new
-      #   data.put_array(false, INT)
-      #   data.enter
-      #   data.int = 1
-      #   data.int = 2
-      #   data.int = 3
-      #   data.exit
-      #
-      #   # create an array of double values
-      #   data.put_array(true, DOUBLE)
-      #   data.enter
-      #   data.symbol = "array-descriptor"
-      #   data.double = 1.1
-      #   data.double = 1.2
-      #   data.double = 1.3
-      #   data.exit
-      #
-      def put_array(described, element_type)
-        check(Cproton.pn_data_put_array(@data, described, element_type.code))
-      end
-
-      # If the current node is an array, returns a tuple of the element count, 
a
-      # boolean indicating whether the array is described, and the type of each
-      # element. Otherwise it returns +(0, false, nil).
-      #
-      # Array data can be accessed by entering the array.
-      #
-      # ==== Examples
-      #
-      #   # get the details of thecurrent array
-      #   count, described, array_type = @data.array
-      #
-      #   # enter the node
-      #   data.enter
-      #
-      #   # get the next node
-      #   data.next
-      #   puts "Descriptor: #{data.symbol}" if described
-      #   (0...count).each do
-      #     @data.next
-      #     puts "Element: #{@data.string}"
-      #   end
-      def array
-        count = Cproton.pn_data_get_array(@data)
-        described = Cproton.pn_data_is_array_described(@data)
-        array_type = Cproton.pn_data_get_array_type(@data)
-        return nil if array_type == -1
-        [count, described, Mapping.for_code(array_type) ]
-      end
-
-      def get_array # :nodoc:
-        ::Array.proton_get(self)
-      end
-
-      # Puts a described value.
-      #
-      # A described node has two children, the descriptor and the value.
-      # These are specified by entering the node and putting the
-      # desired values.
-      #
-      # ==== Examples
-      #
-      #   data = Qpid::Proton::Data.new
-      #   data.put_described
-      #   data.enter
-      #   data.symbol = "value-descriptor"
-      #   data.string = "the value"
-      #   data.exit
-      #
-      def put_described
-        check(Cproton.pn_data_put_described(@data))
-      end
-
-      def get_described # :nodoc:
-        raise TypeError, "not a described type" unless self.described?
-        self.enter
-        self.next
-        type = self.type
-        descriptor = type.get(self)
-        self.next
-        type = self.type
-        value = type.get(self)
-        self.exit
-        Described.new(descriptor, value)
-      end
-
-      # Checks if the current node is a described value.
-      #
-      # The described and value may be accessed by entering the described 
value.
-      #
-      # ==== Examples
-      #
-      #   if @data.described?
-      #     @data.enter
-      #     puts "The symbol is #{@data.symbol}"
-      #     puts "The value is #{@data.string}"
-      #   end
-      def described?
-        Cproton.pn_data_is_described(@data)
-      end
-
-      # Puts a null value.
-      def null
-        check(Cproton.pn_data_put_null(@data))
-      end
-
-      # Utility method for Qpid::Proton::Mapping
-      def null=(value) # :nodoc:
-        null
-      end
-
-      # Checks if the current node is null.
-      def null?
-        Cproton.pn_data_is_null(@data)
-      end
-
-      # Puts a boolean value.
-      #
-      # ==== Options
-      #
-      # * value - the boolean value
-      def bool=(value)
-        check(Cproton.pn_data_put_bool(@data, value))
-      end
-
-      # If the current node is a boolean, then it returns the value. Otherwise,
-      # it returns false.
-      def bool
-        Cproton.pn_data_get_bool(@data)
-      end
-
-      # Puts an unsigned byte value.
-      #
-      # ==== Options
-      #
-      # * value - the unsigned byte value
-      def ubyte=(value)
-        check(Cproton.pn_data_put_ubyte(@data, value))
-      end
-
-      # If the current node is an unsigned byte, returns its value. Otherwise,
-      # it reutrns 0.
-      def ubyte
-        Cproton.pn_data_get_ubyte(@data)
-      end
-
-      # Puts a byte value.
-      #
-      # ==== Options
-      #
-      # * value - the byte value
-      def byte=(value)
-        check(Cproton.pn_data_put_byte(@data, value))
-      end
-
-      # If the current node is an byte, returns its value. Otherwise,
-      # it returns 0.
-      def byte
-        Cproton.pn_data_get_byte(@data)
-      end
-
-      # Puts an unsigned short value.
-      #
-      # ==== Options
-      #
-      # * value - the unsigned short value
-      def ushort=(value)
-        check(Cproton.pn_data_put_ushort(@data, value))
-      end
-
-      # If the current node is an unsigned short, returns its value. Otherwise,
-      # it returns 0.
-      def ushort
-        Cproton.pn_data_get_ushort(@data)
-      end
-
-      # Puts a short value.
-      #
-      # ==== Options
-      #
-      # * value - the short value
-      def short=(value)
-        check(Cproton.pn_data_put_short(@data, value))
-      end
-
-      # If the current node is a short, returns its value. Otherwise,
-      # returns a 0.
-      def short
-        Cproton.pn_data_get_short(@data)
-      end
-
-      # Puts an unsigned integer value.
-      #
-      # ==== Options
-      #
-      # * value - the unsigned integer value
-      def uint=(value)
-        raise TypeError if value.nil?
-        raise RangeError, "invalid uint: #{value}" if value < 0
-        check(Cproton.pn_data_put_uint(@data, value))
-      end
-
-      # If the current node is an unsigned int, returns its value. Otherwise,
-      # returns 0.
-      def uint
-        Cproton.pn_data_get_uint(@data)
-      end
-
-      # Puts an integer value.
-      #
-      # ==== Options
-      #
-      # * value - the integer value
-      def int=(value)
-        check(Cproton.pn_data_put_int(@data, value))
-      end
-
-      # If the current node is an integer, returns its value. Otherwise,
-      # returns 0.
-      def int
-        Cproton.pn_data_get_int(@data)
-      end
-
-      # Puts a character value.
-      #
-      # ==== Options
-      #
-      # * value - the character value
-      def char=(value)
-        check(Cproton.pn_data_put_char(@data, value))
-      end
-
-      # If the current node is a character, returns its value. Otherwise,
-      # returns 0.
-      def char
-        Cproton.pn_data_get_char(@data)
-      end
-
-      # Puts an unsigned long value.
-      #
-      # ==== Options
-      #
-      # * value - the unsigned long value
-      def ulong=(value)
-        raise TypeError if value.nil?
-        raise RangeError, "invalid ulong: #{value}" if value < 0
-        check(Cproton.pn_data_put_ulong(@data, value))
-      end
-
-      # If the current node is an unsigned long, returns its value. Otherwise,
-      # returns 0.
-      def ulong
-        Cproton.pn_data_get_ulong(@data)
-      end
-
-      # Puts a long value.
-      #
-      # ==== Options
-      #
-      # * value - the long value
-      def long=(value)
-        check(Cproton.pn_data_put_long(@data, value))
-      end
-
-      # If the current node is a long, returns its value. Otherwise, returns 0.
-      def long
-        Cproton.pn_data_get_long(@data)
-      end
-
-      # Puts a timestamp value.
-      #
-      # ==== Options
-      #
-      # * value - the timestamp value
-      def timestamp=(value)
-        value = value.to_i if (!value.nil? && value.is_a?(Time))
-        check(Cproton.pn_data_put_timestamp(@data, value))
-      end
-
-      # If the current node is a timestamp, returns its value. Otherwise,
-      # returns 0.
-      def timestamp
-        Cproton.pn_data_get_timestamp(@data)
-      end
-
-      # Puts a float value.
-      #
-      # ==== Options
-      #
-      # * value - the float value
-      def float=(value)
-        check(Cproton.pn_data_put_float(@data, value))
-      end
-
-      # If the current node is a float, returns its value. Otherwise,
-      # returns 0.
-      def float
-        Cproton.pn_data_get_float(@data)
-      end
-
-      # Puts a double value.
-      #
-      # ==== Options
-      #
-      # * value - the double value
-      def double=(value)
-        check(Cproton.pn_data_put_double(@data, value))
-      end
-
-      # If the current node is a double, returns its value. Otherwise,
-      # returns 0.
-      def double
-        Cproton.pn_data_get_double(@data)
-      end
-
-      # Puts a decimal32 value.
-      #
-      # ==== Options
-      #
-      # * value - the decimal32 value
-      def decimal32=(value)
-        check(Cproton.pn_data_put_decimal32(@data, value))
-      end
-
-      # If the current node is a decimal32, returns its value. Otherwise,
-      # returns 0.
-      def decimal32
-        Cproton.pn_data_get_decimal32(@data)
-      end
-
-      # Puts a decimal64 value.
-      #
-      # ==== Options
-      #
-      # * value - the decimal64 value
-      def decimal64=(value)
-        check(Cproton.pn_data_put_decimal64(@data, value))
-      end
-
-      # If the current node is a decimal64, returns its value. Otherwise,
-      # it returns 0.
-      def decimal64
-        Cproton.pn_data_get_decimal64(@data)
-      end
-
-      # Puts a decimal128 value.
-      #
-      # ==== Options
-      #
-      # * value - the decimal128 value
-      def decimal128=(value)
-        raise TypeError, "invalid decimal128 value: #{value}" if value.nil?
-        value = value.to_s(16).rjust(32, "0")
-        bytes = []
-        value.scan(/(..)/) {|v| bytes << v[0].to_i(16)}
-        check(Cproton.pn_data_put_decimal128(@data, bytes))
-      end
-
-      # If the current node is a decimal128, returns its value. Otherwise,
-      # returns 0.
-      def decimal128
-        value = ""
-        Cproton.pn_data_get_decimal128(@data).each{|val| value += ("%02x" % 
val)}
-        value.to_i(16)
-      end
-
-      # Puts a +UUID+ value.
-      #
-      # The UUID is expected to be in the format of a string or else a 128-bit
-      # integer value.
-      #
-      # ==== Options
-      #
-      # * value - the +UUID+
-      #
-      # ==== Examples
-      #
-      #   # set a uuid value from a string value
-      #   require 'securerandom'
-      #   @data.uuid = SecureRandom.uuid
-      #
-      #   # or
-      #   @data.uuid = "fd0289a5-8eec-4a08-9283-81d02c9d2fff"
-      #
-      #   # set a uuid value from a 128-bit value
-      #   @data.uuid = 0 # sets to 00000000-0000-0000-0000-000000000000
-      #
-      def uuid=(value)
-        raise ArgumentError, "invalid uuid: #{value}" if value.nil?
-
-        # if the uuid that was submitted was numeric value, then translated
-        # it into a hex string, otherwise assume it was a string represtation
-        # and attempt to decode it
-        if value.is_a? Numeric
-          value = "%032x" % value
-        else
-          raise ArgumentError, "invalid uuid: #{value}" if !valid_uuid?(value)
-
-          value = (value[0, 8]  +
-                   value[9, 4]  +
-                   value[14, 4] +
-                   value[19, 4] +
-                   value[24, 12])
-        end
-        bytes = []
-        value.scan(/(..)/) {|v| bytes << v[0].to_i(16)}
-        check(Cproton.pn_data_put_uuid(@data, bytes))
-      end
-
-      # If the current value is a +UUID+, returns its value. Otherwise,
-      # it returns nil.
-      def uuid
-        value = ""
-        Cproton.pn_data_get_uuid(@data).each{|val| value += ("%02x" % val)}
-        value.insert(8, "-").insert(13, "-").insert(18, "-").insert(23, "-")
-      end
-
-      # Puts a binary value.
-      #
-      # ==== Options
-      #
-      # * value - the binary value
-      def binary=(value)
-        check(Cproton.pn_data_put_binary(@data, value))
-      end
-
-      # If the current node is binary, returns its value. Otherwise, it returns
-      # an empty string ("").
-      def binary
-        Qpid::Proton::BinaryString.new(Cproton.pn_data_get_binary(@data))
-      end
-
-      # Puts a unicode string value.
-      #
-      # *NOTE:* A nil value is stored as an empty string rather than as a nil.
-      #
-      # ==== Options
-      #
-      # * value - the unicode string value
-      def string=(value)
-        check(Cproton.pn_data_put_string(@data, value))
-      end
-
-      # If the current node is a string, returns its value. Otherwise, it
-      # returns an empty string ("").
-      def string
-        Qpid::Proton::UTFString.new(Cproton.pn_data_get_string(@data))
-      end
-
-      # Puts a symbolic value.
-      #
-      # ==== Options
-      #
-      # * value - the symbol name
-      def symbol=(value)
-        check(Cproton.pn_data_put_symbol(@data, value))
-      end
-
-      # If the current node is a symbol, returns its value. Otherwise, it
-      # returns an empty string ("").
-      def symbol
-        Cproton.pn_data_get_symbol(@data)
-      end
-
-      # Get the current value as a single object.
-      def get
-        type.get(self);
-      end
-
-      # Put value as an object of type type_
-      def put(value, type_);
-        type_.put(self, value);
-      end
-
-      private
-
-      def valid_uuid?(value)
-        # ensure that the UUID is in the right format
-        # xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
-        value =~ 
/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
-      end
-
-      def check(err) # :nodoc:
-        if err < 0
-          raise DataError, "[#{err}]: #{Cproton.pn_data_error(@data)}"
-        else
-          return err
-        end
-      end
-    end
-  end
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/described.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/described.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/described.rb
deleted file mode 100644
index 98679c2..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/described.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    class Described
-
-      attr_reader :descriptor
-      attr_reader :value
-
-      def initialize(descriptor, value)
-        @descriptor = descriptor
-        @value = value
-      end
-
-      # Puts the description into the Data object.
-      #
-      # ==== Arguments
-      #
-      # * data - the Qpid::Proton::Data instance
-      #
-      # ==== Examples
-      #
-      #   described = Qpid::Proton::Described.new("my-descriptor", "the value")
-      #   data = Qpid::Proton::Data.new
-      #   ...
-      #   described.put(data)
-      #
-      def put(data)
-        data.symbol = @descriptor
-        data.string = @value
-      end
-
-      def ==(that) # :nodoc:
-        (that.is_a?(Qpid::Proton::Described) &&
-         (self.descriptor == that.descriptor) &&
-         (self.value == that.value))
-      end
-
-      def to_s # :nodoc:
-        "descriptor=#{descriptor} value=#{value}"
-      end
-
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/exception_handling.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/exception_handling.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/exception_handling.rb
deleted file mode 100644
index b3707c3..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/exception_handling.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    # Provides mixin functionality for dealing with exception conditions.
-    #
-    module ExceptionHandling
-
-      def self.included(base)
-        base.extend(self)
-
-        unless defined? base.to_be_wrapped
-          class << base
-            @@to_be_wrapped = []
-          end
-        end
-
-        define_method :method_added do |name|
-          if (!@@to_be_wrapped.nil?) && (@@to_be_wrapped.include? name)
-            @@to_be_wrapped.delete name
-            create_exception_handler_wrapper(name)
-          end
-        end
-      end
-
-      def can_raise_exception(method_names)
-        # coerce the names to be an array
-        Array(method_names).each do |method_name|
-          # if the method doesn't already exist then queue this aliasing
-          unless self.method_defined? method_name
-            @@to_be_wrapped ||= []
-            @@to_be_wrapped << method_name
-          else
-            create_exception_handler_wrapper(method_name)
-          end
-        end
-      end
-
-      def create_exception_handler_wrapper(method_name)
-        original_method_name = method_name.to_s
-        wrapped_method_name = "_excwrap_#{original_method_name}"
-        alias_method wrapped_method_name, original_method_name
-        define_method original_method_name do |*args, &block|
-          # need to get a reference to the method object itself since
-          # calls to Class.send interfere with Messenger.send
-          method = self.method(wrapped_method_name.to_sym)
-          rc = method.call(*args, &block)
-          check_for_error(rc)
-        end
-      end
-
-      # Raises an Proton-specific error if a return code is non-zero.
-      #
-      # Expects the class to provide an +error+ method.
-      def check_for_error(code)
-
-        raise ::ArgumentError.new("Invalid error code: #{code}") if code.nil?
-
-        return code if code > 0
-
-        case(code)
-
-        when Qpid::Proton::Error::NONE
-          return
-
-        when Qpid::Proton::Error::EOS
-          raise Qpid::Proton::EOSError.new(self.error)
-
-        when Qpid::Proton::Error::ERROR
-          raise Qpid::Proton::ProtonError.new(self.error)
-
-        when Qpid::Proton::Error::OVERFLOW
-          raise Qpid::Proton::OverflowError.new(self.error)
-
-        when Qpid::Proton::Error::UNDERFLOW
-          raise Qpid::Proton::UnderflowError.new(self.error)
-
-        when Qpid::Proton::Error::ARGUMENT
-          raise Qpid::Proton::ArgumentError.new(self.error)
-
-        when Qpid::Proton::Error::STATE
-          raise Qpid::Proton::StateError.new(self.error)
-
-        when Qpid::Proton::Error::TIMEOUT
-          raise Qpid::Proton::TimeoutError.new(self.error)
-
-        when Qpid::Proton::Error::INPROGRESS
-          return
-
-        when Qpid::Proton::Error::INTERRUPTED
-          raise Qpid::Proton::InterruptedError.new(self.error)
-
-        when Qpid::Proton::Error::INPROGRESS
-          raise Qpid::Proton::InProgressError.new(self.error)
-
-        else
-
-          raise ::ArgumentError.new("Unknown error code: #{code}")
-
-        end
-
-      end
-
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/exceptions.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/exceptions.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/exceptions.rb
deleted file mode 100644
index 189f574..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/exceptions.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    module Error
-
-      NONE = 0
-      EOS = Cproton::PN_EOS
-      ERROR = Cproton::PN_ERR
-      OVERFLOW = Cproton::PN_OVERFLOW
-      UNDERFLOW = Cproton::PN_UNDERFLOW
-      STATE = Cproton::PN_STATE_ERR
-      ARGUMENT = Cproton::PN_ARG_ERR
-      TIMEOUT = Cproton::PN_TIMEOUT
-      INTERRUPTED = Cproton::PN_INTR
-      INPROGRESS = Cproton::PN_INPROGRESS
-
-    end
-
-    # Represents a generic error at the messaging level.
-    #
-    class ProtonError < RuntimeError
-    end
-
-    # Represents an end-of-stream error while messaging.
-    #
-    class EOSError < ProtonError
-    end
-
-    # Represents a data overflow exception while messaging.
-    #
-    class OverflowError < ProtonError
-    end
-
-    # Represents a data underflow exception while messaging.
-    #
-    class UnderflowError < ProtonError
-    end
-
-    # Represents an invalid, missing or illegal argument while messaging.
-    #
-    class ArgumentError < ProtonError
-    end
-
-    # Represents that the client has got into an unexpected state during
-    # messaging.
-    #
-    class StateError < ProtonError
-    end
-
-    # Represents a timeout during messaging.
-    #
-    class TimeoutError < ProtonError
-    end
-
-    # Represents an interrupting during a blocking I/O operation.
-    #
-    class InterruptedError < ProtonError
-    end
-
-    class InProgressError < ProtonError
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/filters.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/filters.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/filters.rb
deleted file mode 100644
index 370d017..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/filters.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    module Filters
-
-      def self.included(base)
-        base.class_eval do
-          extend ClassMethods
-        end
-      end
-
-      module ClassMethods
-
-        def method_added(method_name)
-          @@hooked_methods ||= []
-          return if @@hooked_methods.include?(method_name)
-          @@hooked_methods << method_name
-          hooks = @@before_hooks[method_name]
-          return if hooks.nil?
-          orig_method = instance_method(method_name)
-          define_method(method_name) do |*args, &block|
-            hooks = @@before_hooks[method_name]
-            hooks.each do |hook|
-              method(hook).call
-            end
-
-            orig_method.bind(self).call(*args, &block)
-          end
-        end
-
-        def call_before(before_method, *methods)
-          @@before_hooks ||= {}
-          methods.each do |method|
-            hooks = @@before_hooks[method] || []
-            raise "Repeat filter: #{before_method}" if hooks.include? 
before_method
-            hooks << before_method
-            @@before_hooks[method] = hooks
-          end
-        end
-
-      end
-
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/hash.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/hash.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/hash.rb
deleted file mode 100644
index 1e19da1..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/hash.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-#--
-# Patch the Hash class to provide methods for adding its contents
-# to a Qpid::Proton::Data instance.
-#++
-
-class Hash # :nodoc:
-
-  # Places the contents of the hash into the specified data object.
-  #
-  # ==== Arguments
-  #
-  # * data - the Qpid::Proton::Data instance
-  #
-  # ==== Examples
-  #
-  #   data = Qpid::Proton::Data.new
-  #   values = {:foo => :bar}
-  #   values.proton_data_put(data)
-  #
-  def proton_data_put(data)
-    raise TypeError, "data object cannot be nil" if data.nil?
-
-    data.put_map
-    data.enter
-
-    each_pair do |key, value|
-      type = Qpid::Proton::Mapping.for_class(key.class)
-      type.put(data, key)
-      type = Qpid::Proton::Mapping.for_class(value.class)
-      type.put(data, value)
-    end
-
-    data.exit
-  end
-
-  class << self
-
-    def proton_data_get(data)
-      raise TypeError, "data object cannot be nil" if data.nil?
-
-      type = data.type
-
-      raise TypeError, "element is not a map" unless type == Qpid::Proton::MAP
-
-      count = data.map
-      result = {}
-
-      data.enter
-
-      (0...(count/2)).each do
-        data.next
-        type = data.type
-        key = type.get(data)
-        data.next
-        type = data.type
-        value = type.get(data)
-        result[key] = value
-      end
-
-      data.exit
-
-      return result
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb
deleted file mode 100644
index 9189cbc..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb
+++ /dev/null
@@ -1,170 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    # Maps between Proton types and their Ruby native language counterparts.
-    #
-    class Mapping
-
-      attr_reader :code
-      attr_reader :put_method
-      attr_reader :get_method
-
-      # Creates a new mapping.
-      #
-      # ==== Arguments
-      #
-      # * code    - the AMQP code for this type
-      # * name    - the AMQP name for this type
-      # * klasses - the Ruby classes for this type
-      # * getter  - overrides the get method for the type
-      def initialize(code, name, klasses = nil, getter = nil)
-
-        @debug = (name == "bool")
-
-        @code = code
-        @name = name
-
-        @@by_preferred ||= {}
-        @@by_code ||= {}
-        @@by_code["#{code}"] = self
-        @@by_name ||= {}
-        @@by_name[name] = self
-        @@by_class ||= {}
-
-        unless klasses.nil?
-          klasses.each do |klass|
-            raise "entry exists for #{klass}" if @@by_class.keys.include? klass
-            @@by_class[klass] = self unless klass.nil?
-          end
-        end
-
-        @put_method = (name + "=").intern
-
-        if getter.nil?
-          @get_method = name.intern
-        else
-          @get_method = getter.intern
-        end
-      end
-
-      def to_s; @name; end
-
-      def put(data, value)
-        data.__send__(@put_method, value)
-      end
-
-      def get(data)
-        data.__send__(@get_method)
-      end
-
-      def self.for_class(klass) # :nodoc:
-        @@by_class[klass]
-      end
-
-      def self.for_code(code)
-        @@by_code["#{code}"]
-      end
-
-    end
-
-    NULL       = Mapping.new(Cproton::PN_NULL, "null", [NilClass], "nil?")
-    BOOL       = Mapping.new(Cproton::PN_BOOL, "bool", [TrueClass, 
FalseClass], "bool")
-    UBYTE      = Mapping.new(Cproton::PN_UBYTE, "ubyte")
-    BYTE       = Mapping.new(Cproton::PN_BYTE, "byte")
-    USHORT     = Mapping.new(Cproton::PN_USHORT, "ushort")
-    SHORT      = Mapping.new(Cproton::PN_SHORT, "short")
-    UINT       = Mapping.new(Cproton::PN_UINT, "uint")
-    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", [Fixnum, Bignum])
-    TIMESTAMP  = Mapping.new(Cproton::PN_TIMESTAMP, "timestamp", [Date, Time])
-    FLOAT      = Mapping.new(Cproton::PN_FLOAT, "float")
-    DOUBLE     = Mapping.new(Cproton::PN_DOUBLE, "double", [Float])
-    DECIMAL32  = Mapping.new(Cproton::PN_DECIMAL32, "decimal32")
-    DECIMAL64  = Mapping.new(Cproton::PN_DECIMAL64, "decimal64")
-    DECIMAL128 = Mapping.new(Cproton::PN_DECIMAL128, "decimal128")
-    UUID       = Mapping.new(Cproton::PN_UUID, "uuid")
-    BINARY     = Mapping.new(Cproton::PN_BINARY, "binary")
-    STRING     = Mapping.new(Cproton::PN_STRING, "string", [String, Symbol,
-                                                           UTFString,
-                                                           BinaryString])
-
-    class << STRING # :nodoc:
-      def put(data, value)
-        # if we have a symbol then convert it to a string
-        value = value.to_s if value.is_a?(Symbol)
-
-        isutf = false
-
-        if value.is_a?(Qpid::Proton::UTFString)
-          isutf = true
-        else
-          # For Ruby 1.8 we will just treat all strings as binary.
-          # For Ruby 1.9+ we can check the encoding first to see what it is
-          if RUBY_VERSION >= "1.9"
-            # If the string is ASCII-8BIT then treat is as binary. Otherwise,
-            # try to convert it to UTF-8 and, if successful, send as that.
-            if value.encoding != Encoding::ASCII_8BIT &&
-                value.encode(Encoding::UTF_8).valid_encoding?
-              isutf = true
-            end
-          end
-        end
-
-        data.string = value if isutf
-        data.binary = value if !isutf
-
-      end
-    end
-
-    SYMBOL     = Mapping.new(Cproton::PN_SYMBOL, "symbol")
-    DESCRIBED  = Mapping.new(Cproton::PN_DESCRIBED, "described", 
[Qpid::Proton::Described], "get_described")
-    ARRAY      = Mapping.new(Cproton::PN_ARRAY, "array", nil, "get_array")
-    LIST       = Mapping.new(Cproton::PN_LIST, "list", [::Array], "get_array")
-    MAP        = Mapping.new(Cproton::PN_MAP, "map", [::Hash], "get_map")
-
-    class << MAP # :nodoc:
-      def put(data, map, options = {})
-        data.put_map
-        data.enter
-        map.each_pair do |key, value|
-          if options[:keys] == :SYMBOL
-            SYMBOL.put(data, key)
-          else
-            Mapping.for_class(key.class).put(data, key)
-          end
-
-          if value.nil?
-            data.null
-          else
-            Mapping.for_class(value.class).put(data, value)
-          end
-        end
-        data.exit
-      end
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/81a5449d/proton-c/bindings/ruby/lib/qpid_proton/message.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/message.rb 
b/proton-c/bindings/ruby/lib/qpid_proton/message.rb
deleted file mode 100644
index 144990b..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton/message.rb
+++ /dev/null
@@ -1,621 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid # :nodoc:
-
-  module Proton # :nodoc:
-
-    # A Message represents an addressable quantity of data.
-    #
-    # ==== Message Body
-    #
-    # The message body can be set using the #body= method. The message will
-    # then attempt to determine how exactly to encode the content.
-    #
-    # ==== Examples
-    #
-    # To create a message for sending:
-    #
-    #   # send a simple text message
-    #   msg = Qpid::Proton::Message.new
-    #   msg.body = "STATE: update"
-    #
-    #   # send a binary chunk of data
-    #   data = File.binread("/home/qpid/binfile.tar.gz")
-    #   msg = Qpid::Proton::Message.new
-    #   msg.body = Qpid::Proton::BinaryString.new(data)
-    #
-    class Message
-
-      # Decodes a message from supplied AMQP data and returns the number
-      # of bytes consumed.
-      #
-      # ==== Options
-      #
-      # * encoded - the encoded data
-      #
-      def decode(encoded)
-        check(Cproton.pn_message_decode(@impl, encoded, encoded.length))
-
-        post_decode
-      end
-
-      def post_decode # :nodoc:
-        # decode elements from the message
-        @properties = {}
-        props = Qpid::Proton::Data.new(Cproton::pn_message_properties(@impl))
-        if props.next
-          @properties = props.type.get(props)
-        end
-        @instructions = nil
-        insts = Qpid::Proton::Data.new(Cproton::pn_message_instructions(@impl))
-        if insts.next
-          @instructions = insts.type.get(insts)
-        end
-        @annotations = nil
-        annts = Qpid::Proton::Data.new(Cproton::pn_message_annotations(@impl))
-        if annts.next
-          @annotations = annts.type.get(annts)
-        end
-        @body = nil
-        body = Qpid::Proton::Data.new(Cproton::pn_message_body(@impl))
-        if body.next
-          @body = body.type.get(body)
-        end
-      end
-
-      # Encodes the message.
-      def encode
-        pre_encode
-        size = 16
-        loop do
-          error, data = Cproton::pn_message_encode(@impl, size)
-          if error == Qpid::Proton::Error::OVERFLOW
-            size *= 2
-          else
-            check(error)
-            return data
-          end
-        end
-      end
-
-      def pre_encode # :nodoc:
-        # encode elements from the message
-        props = Qpid::Proton::Data.new(Cproton::pn_message_properties(@impl))
-        props.clear
-        Qpid::Proton::Mapping.for_class(@properties.class).put(props, 
@properties) unless @properties.empty?
-        insts = Qpid::Proton::Data.new(Cproton::pn_message_instructions(@impl))
-        insts.clear
-        if !@instructions.nil?
-          mapping = Qpid::Proton::Mapping.for_class(@instructions.class)
-          mapping.put(insts, @instructions)
-        end
-        annts = Qpid::Proton::Data.new(Cproton::pn_message_annotations(@impl))
-        annts.clear
-        if !@annotations.nil?
-          mapping = Qpid::Proton::Mapping.for_class(@annotations.class)
-          mapping.put(annts, @annotations, :keys => :SYMBOL)
-        end
-        body = Qpid::Proton::Data.new(Cproton::pn_message_body(@impl))
-        body.clear
-        if !@body.nil?
-          mapping = Qpid::Proton::Mapping.for_class(@body.class)
-          mapping.put(body, @body)
-        end
-      end
-
-      # Creates a new +Message+ instance.
-      def initialize
-        @impl = Cproton.pn_message
-        ObjectSpace.define_finalizer(self, self.class.finalize!(@impl))
-        @properties = {}
-        @instructions = {}
-        @annotations = {}
-        @body = nil
-      end
-
-      def to_s
-        tmp = Cproton.pn_string("")
-        Cproton.pn_inspect(@impl, tmp)
-        result = Cproton.pn_string_get(tmp)
-        Cproton.pn_free(tmp)
-        return result
-      end
-
-      # Invoked by garbage collection to clean up resources used
-      # by the underlying message implementation.
-      def self.finalize!(impl) # :nodoc:
-        proc {
-          Cproton.pn_message_free(impl)
-        }
-      end
-
-      # Returns the underlying message implementation.
-      def impl # :nodoc:
-        @impl
-      end
-
-      # Clears the state of the +Message+. This allows a single instance of
-      # +Message+ to be reused.
-      #
-      def clear
-        Cproton.pn_message_clear(@impl)
-        @properties.clear unless @properties.nil?
-        @instructions.clear unless @instructions.nil?
-        @annotations.clear unless @annotations.nil?
-        @body = nil
-      end
-
-      # Returns the most recent error number.
-      #
-      def errno
-        Cproton.pn_message_errno(@impl)
-      end
-
-      # Returns the most recent error message.
-      #
-      def error
-        Cproton.pn_error_text(Cproton.pn_message_error(@impl))
-      end
-
-      # Returns whether there is currently an error reported.
-      #
-      def error?
-        !Cproton.pn_message_errno(@impl).zero?
-      end
-
-      # Sets the durable flag.
-      #
-      # See ::durable for more details on message durability.
-      #
-      # ==== Options
-      #
-      # * state - the durable state
-      #
-      def durable=(state)
-        raise TypeError.new("state cannot be nil") if state.nil?
-        Cproton.pn_message_set_durable(@impl, state)
-      end
-
-      # Returns the durable property.
-      #
-      # The durable property indicates that the emessage should be held durably
-      # by any intermediaries taking responsibility for the message.
-      #
-      # ==== Examples
-      #
-      #  msg = Qpid::Proton::Message.new
-      #  msg.durable = true
-      #
-      def durable
-        Cproton.pn_message_is_durable(@impl)
-      end
-
-      # Sets the priority.
-      #
-      # +NOTE:+ Priority values are limited to the range [0,255].
-      #
-      # ==== Options
-      #
-      # * priority - the priority value
-      #
-      def priority=(priority)
-        raise TypeError.new("invalid priority: #{priority}") if priority.nil? 
|| !([Float, Fixnum].include?(priority.class))
-        raise RangeError.new("priority out of range: #{priority}") if 
((priority > 255) || (priority < 0))
-        Cproton.pn_message_set_priority(@impl, priority.floor)
-      end
-
-      # Returns the priority.
-      #
-      def priority
-        Cproton.pn_message_get_priority(@impl)
-      end
-
-      # Sets the time-to-live for the message.
-      #
-      # ==== Options
-      #
-      # * 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))
-        Cproton.pn_message_set_ttl(@impl, time.floor)
-      end
-
-      # Returns the time-to-live, in milliseconds.
-      #
-      def ttl
-        Cproton.pn_message_get_ttl(@impl)
-      end
-
-      # Sets whether this is the first time the message was acquired.
-      #
-      # See ::first_acquirer? for more details.
-      #
-      # ==== Options
-      #
-      # * state - true if claiming the message
-      #
-      def first_acquirer=(state)
-        raise TypeError.new("invalid state: #{state}") if state.nil? || 
!([TrueClass, FalseClass].include?(state.class))
-        Cproton.pn_message_set_first_acquirer(@impl, state)
-      end
-
-      # Sets the delivery count for the message.
-      #
-      # See ::delivery_count for more details.
-      #
-      # ==== Options
-      #
-      # * count - the delivery count
-      #
-      def delivery_count=(count)
-        raise ArgumentError.new("invalid count: #{count}") if count.nil? || 
!([Float, Fixnum].include?(count.class))
-        raise RangeError.new("count out of range: #{count}") if count < 0
-
-        Cproton.pn_message_set_delivery_count(@impl, count.floor)
-      end
-
-      # Returns the delivery count for the message.
-      #
-      # This is the number of delivery attempts for the given message.
-      #
-      def delivery_count
-        Cproton.pn_message_get_delivery_count(@impl)
-      end
-
-      # Returns whether this is the first acquirer.
-      #
-      #
-      def first_acquirer?
-        Cproton.pn_message_is_first_acquirer(@impl)
-      end
-
-      # Sets the message id.
-      #
-      # ==== Options
-      #
-      # * id = the id
-      #
-      def id=(id)
-        Cproton.pn_message_set_id(@impl, id)
-      end
-
-      # Returns the message id.
-      #
-      def id
-        Cproton.pn_message_get_id(@impl)
-      end
-
-      # Sets the user id.
-      #
-      # ==== Options
-      #
-      # * id - the user id
-      #
-      def user_id=(id)
-        Cproton.pn_message_set_user_id(@impl, id)
-      end
-
-      # Returns the user id.
-      #
-      def user_id
-        Cproton.pn_message_get_user_id(@impl)
-      end
-
-      # Sets the destination address.
-      #
-      # ==== Options
-      #
-      # * address - the address
-      #
-      def address=(address)
-        Cproton.pn_message_set_address(@impl, address)
-      end
-
-      # Returns the destination address.
-      #
-      def address
-        Cproton.pn_message_get_address(@impl)
-      end
-
-      # Sets the subject.
-      #
-      # ==== Options
-      #
-      # * subject - the subject
-      #
-      def subject=(subject)
-        Cproton.pn_message_set_subject(@impl, subject)
-      end
-
-      # Returns the subject
-      #
-      def subject
-        Cproton.pn_message_get_subject(@impl)
-      end
-
-      # Sets the reply-to address.
-      #
-      # ==== Options
-      #
-      # * address - the reply-to address
-      #
-      def reply_to=(address)
-        Cproton.pn_message_set_reply_to(@impl, address)
-      end
-
-      # Returns the reply-to address
-      #
-      def reply_to
-        Cproton.pn_message_get_reply_to(@impl)
-      end
-
-      # Sets the correlation id.
-      #
-      # ==== Options
-      #
-      # * id - the correlation id
-      #
-      def correlation_id=(id)
-        Cproton.pn_message_set_correlation_id(@impl, id)
-      end
-
-      # Returns the correlation id.
-      #
-      def correlation_id
-        Cproton.pn_message_get_correlation_id(@impl)
-      end
-
-      # Sets the message format.
-      #
-      # See MessageFormat for more details on formats.
-      #
-      # *Warning:* This method has been deprecated.
-      #
-      # ==== Options
-      #
-      # * format - the format
-      #
-      def format=(format)
-        raise TypeError.new("invalid message format: #{format}") if 
(format.nil? || !format.kind_of?(Qpid::Proton::MessageFormat))
-        Cproton.pn_message_set_format(@impl, format.value)
-      end
-
-      # Returns the message format
-      #
-      # *Warning:* This method has been deprecated.
-      #
-      # ==== Note
-      #
-      # This method is now deprecated.
-      #
-      def format
-        
Qpid::Proton::MessageFormat.by_value(Cproton.pn_message_get_format(@impl))
-      end
-
-      # Sets the content type.
-      #
-      # ==== Options
-      #
-      # * content_type - the content type
-      #
-      def content_type=(content_type)
-        Cproton.pn_message_set_content_type(@impl, content_type)
-      end
-
-      # Returns the content type
-      #
-      def content_type
-        Cproton.pn_message_get_content_type(@impl)
-      end
-
-      # Sets the content encoding type.
-      #
-      # ==== Options
-      #
-      # * encoding - the content encoding
-      #
-      def content_encoding=(encoding)
-        Cproton.pn_message_set_content_encoding(@impl, encoding)
-      end
-
-      # Returns the content encoding type.
-      #
-      def content_encoding
-        Cproton.pn_message_get_content_encoding(@impl)
-      end
-
-      # Sets the expiration time.
-      #
-      # ==== Options
-      #
-      # * time - the expiry time
-      #
-      def expires=(time)
-        raise TypeError.new("invalid expiry time: #{time}") if time.nil?
-        raise ArgumentError.new("expiry time cannot be negative: #{time}") if 
time < 0
-        Cproton.pn_message_set_expiry_time(@impl, time)
-      end
-
-      # Returns the expiration time.
-      #
-      def expires
-        Cproton.pn_message_get_expiry_time(@impl)
-      end
-
-      # Sets the creation time.
-      #
-      # ==== Options
-      #
-      # * time - the creation time
-      #
-      def creation_time=(time)
-        raise TypeError.new("invalid time: #{time}") if time.nil?
-        raise ArgumentError.new("time cannot be negative") if time < 0
-        Cproton.pn_message_set_creation_time(@impl, time)
-      end
-
-      # Returns the creation time.
-      #
-      def creation_time
-        Cproton.pn_message_get_creation_time(@impl)
-      end
-
-      # Sets the group id.
-      #
-      # ==== Options
-      #
-      # * id - the group id
-      #
-      def group_id=(id)
-        Cproton.pn_message_set_group_id(@impl, id)
-      end
-
-      # Returns the group id.
-      #
-      def group_id
-        Cproton.pn_message_get_group_id(@impl)
-      end
-
-      # Sets the group sequence number.
-      #
-      # ==== Options
-      #
-      # * seq - the sequence number
-      #
-      def group_sequence=(seq)
-        raise TypeError.new("invalid seq: #{seq}") if seq.nil?
-        Cproton.pn_message_set_group_sequence(@impl, seq)
-      end
-
-      # Returns the group sequence number.
-      #
-      def group_sequence
-        Cproton.pn_message_get_group_sequence(@impl)
-      end
-
-      # Sets the reply-to group id.
-      #
-      # ==== Options
-      #
-      # * id - the id
-      #
-      def reply_to_group_id=(id)
-        Cproton.pn_message_set_reply_to_group_id(@impl, id)
-      end
-
-      # Returns the reply-to group id.
-      #
-      def reply_to_group_id
-        Cproton.pn_message_get_reply_to_group_id(@impl)
-      end
-
-      # Returns the list of property names for associated with this message.
-      #
-      # ==== Examples
-      #
-      #   msg.properties.each do |name|
-      #   end
-      #
-      def properties
-        @properties
-      end
-
-      # Replaces the entire set of properties with the specified hash.
-      #
-      def properties=(properties)
-        @properties = properties
-      end
-
-      # Assigns the value given to the named property.
-      #
-      # ==== Arguments
-      #
-      # * name - the property name
-      # * value - the property value
-      #
-      def []=(name, value)
-        @properties[name] = value
-      end
-
-      # Retrieves the value for the specified property name. If not found, then
-      # it returns nil.
-      #
-      def [](name)
-        @properties[name]
-      end
-
-      # Deletes the named property.
-      #
-      def delete_property(name)
-        @properties.delete(name)
-      end
-
-      # Returns the instructions for this message.
-      #
-      def instructions
-        @instructions
-      end
-
-      # Assigns instructions to this message.
-      #
-      def instructions=(instr)
-        @instructions = instr
-      end
-
-      # Returns the annotations for this message.
-      #
-      def annotations
-        @annotations
-      end
-
-      # Assigns annotations to this message.
-      #
-      def annotations=(annotations)
-        @annotations = annotations
-      end
-
-      # Returns the body property of the message.
-      #
-      def body
-        @body
-      end
-
-      # Assigns a new value to the body of the message.
-      #
-      def body=(body)
-        @body = body
-      end
-
-      private
-
-      def check(err) # :nodoc:
-        if err < 0
-          raise DataError, "[#{err}]: #{Cproton.pn_message_error(@impl)}"
-        else
-          return err
-        end
-      end
-    end
-
-  end
-
-end


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to