summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-03-17 20:06:44 +0000
committerAlan Conway <aconway@apache.org>2011-03-17 20:06:44 +0000
commitfd2247dade5a2c4f0baa889da343de05f9e2a42d (patch)
treef802a4af4c427cd0fa6bac38ba35d2125b1e1047 /cpp
parentd0d0a878ed588084deaf4013d1ca8b04c3d0ab5a (diff)
downloadqpid-python-fd2247dade5a2c4f0baa889da343de05f9e2a42d.tar.gz
QPID-3116: rubygen with ruby 1.9
Fix name mangling for reserved "type" symbol to work on ruby 1.8 and 1.9. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1082670 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/rubygen/amqpgen.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/rubygen/amqpgen.rb b/cpp/rubygen/amqpgen.rb
index 69e65a4056..20aac35194 100755
--- a/cpp/rubygen/amqpgen.rb
+++ b/cpp/rubygen/amqpgen.rb
@@ -61,7 +61,8 @@ end
class Module
# Add trailing _ to avoid conflict with Object methods.
def mangle(sym)
- (Object.method_defined? sym) ? (sym.to_s+"_").intern : sym
+ sym = (sym.to_s+"_").to_sym if (Object.method_defined?(sym) or sym == :type)
+ sym
end
# Add attribute reader for XML attribute.