summaryrefslogtreecommitdiff
path: root/cpp/rubygen/amqpgen.rb
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/rubygen/amqpgen.rb')
-rwxr-xr-xcpp/rubygen/amqpgen.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/cpp/rubygen/amqpgen.rb b/cpp/rubygen/amqpgen.rb
index 0b7cfac5ea..5cad9d6336 100755
--- a/cpp/rubygen/amqpgen.rb
+++ b/cpp/rubygen/amqpgen.rb
@@ -76,7 +76,7 @@ end
class AmqpMethod < AmqpElement
def initialize(xml, amqp) super; end
- def index attr["index"]; end
+ def index() attributes["index"]; end
def fields()
@cache_fields ||= elements.collect("field") { |f| AmqpField.new(f,self); }
@@ -101,7 +101,7 @@ end
# AMQP class element.
class AmqpClass < AmqpElement
def initialize(xml,amqp) super; end
- def index attr["index"]; end
+ def index() attributes["index"]; end
def methods()
@cache_methods ||= elements.collect("method") { |el|
AmqpMethod.new(el,self)
@@ -173,16 +173,12 @@ class Generator
end
# Create a new file, set @out.
- def file(file, &block)
+ def file(file)
puts file
if (@outdir != "-")
path=Pathname.new "#{@outdir}/#{file}"
path.parent.mkpath
- if &block
path.open('w') { |@out| yield }
- else
- path.open('w')
- end
end
end