You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mc...@apache.org on 2013/07/31 23:03:35 UTC

svn commit: r1509029 - in /qpid/proton/trunk/proton-c/bindings/ruby: ChangeLog lib/qpid_proton/mapping.rb

Author: mcpierce
Date: Wed Jul 31 21:03:35 2013
New Revision: 1509029

URL: http://svn.apache.org/r1509029
Log:
PROTON-381: Fixed encoding a Ruby symbol into a Data object.

The symbol is converted to a String before being added the Data
instance.

Modified:
    qpid/proton/trunk/proton-c/bindings/ruby/ChangeLog
    qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb

Modified: qpid/proton/trunk/proton-c/bindings/ruby/ChangeLog
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/ruby/ChangeLog?rev=1509029&r1=1509028&r2=1509029&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/ruby/ChangeLog (original)
+++ qpid/proton/trunk/proton-c/bindings/ruby/ChangeLog Wed Jul 31 21:03:35 2013
@@ -9,6 +9,7 @@ version 0.5:
 	* Hashes are now automatically encoded into Data objects.
 	* Fixed encoding Time objects.
 	* Added instructions field to Qpid::Proton::Message.
+	* Fixed encoding Symbol objects.
 
 version 0.4:
 	* No language-specific features developed in this release.

Modified: qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb?rev=1509029&r1=1509028&r2=1509029&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb (original)
+++ qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/mapping.rb Wed Jul 31 21:03:35 2013
@@ -106,7 +106,14 @@ module Qpid # :nodoc:
     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])
+    STRING     = Mapping.new(Cproton::PN_STRING, "string", [String, Symbol])
+
+    class << STRING
+      def put(data, value)
+        data.string = value.to_s
+      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")



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