summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-03-21 18:13:28 +0000
committerAlan Conway <aconway@apache.org>2011-03-21 18:13:28 +0000
commitb90e6509861bce61699a5ad35b922c6b5f826e4b (patch)
treee45f29eb6e1ecfda9e9b394f677b7d359b6cfbb5
parent887024d83d4fbfa6461ea8d605d100dacc8b3158 (diff)
downloadqpid-python-b90e6509861bce61699a5ad35b922c6b5f826e4b.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/branches/0.10@1083889 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xqpid/cpp/rubygen/amqpgen.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/qpid/cpp/rubygen/amqpgen.rb b/qpid/cpp/rubygen/amqpgen.rb
index 69e65a4056..20aac35194 100755
--- a/qpid/cpp/rubygen/amqpgen.rb
+++ b/qpid/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.