Author: aconway
Date: Thu Aug 9 10:26:59 2007
New Revision: 564286
URL: http://svn.apache.org/viewvc?view=rev&rev=564286
Log:
* rubygen/amqpgen.rb: workaround XML namespace problem with ruby 1.8.6.
* src/Makefile.am: fixed so error in rubygen causes build to fail.
Modified:
incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb
incubator/qpid/trunk/qpid/cpp/src/Makefile.am
Modified: incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb?view=diff&rev=564286&r1=564285&r2=564286
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb (original)
+++ incubator/qpid/trunk/qpid/cpp/rubygen/amqpgen.rb Thu Aug 9 10:26:59 2007
@@ -115,22 +115,35 @@
# chassis should be "client" or "server"
def amqp_methods_on(chassis)
@cache_amqp_methods_on ||= { }
- @cache_amqp_methods_on[chassis] ||= elements.collect("method/[EMAIL
PROTECTED]'#{chassis}']/..") { |m|
+
+ els = elements.collect("method/[EMAIL PROTECTED]'#{chassis}']/..") { |m|
AmqpMethod.new(m,self)
}.sort_by_name
- end
+ @cache_amqp_methods_on[chassis] ||= els
+end
end
# AMQP root element.
class AmqpRoot < AmqpElement
+ # FIXME aconway - something namespace-related in ruby 1.8.6
+ # breaks all the xpath expressions with [EMAIL PROTECTED] tests.
+ # Not clear if this is a ruby bug or error in my xpath,
+ # current workaround is to simply delete the namespace node.
+ def newDoc(xmlFile)
+ root=Document.new(File.new(xmlFile)).root
+ root.delete_namespace
+ throw "Internal error, FIXME comment in aqmpgen.rb." unless
(root.namespaces.empty?)
+ root
+ end
+
# Initialize with output directory and spec files from ARGV.
def initialize(*specs)
specs.size or raise "No XML spec files."
specs.each { |f| File.exists?(f) or raise "Invalid XML file: #{f}"}
- super Document.new(File.new(specs.shift)).root, nil
+ super newDoc(specs.shift), nil
specs.each { |s| # Merge in additional specs
- root=Document.new(File.new(s)).root
+ root=newDoc s
merge(self,root)
}
end
Modified: incubator/qpid/trunk/qpid/cpp/src/Makefile.am
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/Makefile.am?view=diff&rev=564286&r1=564285&r2=564286
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/Makefile.am Thu Aug 9 10:26:59 2007
@@ -56,8 +56,9 @@
rubygen.mk $(rgen_srcs): rubygen.timestamp
rubygen.timestamp: $(rgen_generator) $(specs) $(rgen_templates)
- { echo -n "rgen_srcs= "; \
- for f in `$(rgen_cmd) . $(specs) $(rgen_templates) `; do echo "\\";
echo -n " $$f "; done; \
+ srcs=`$(rgen_cmd) . $(specs) $(rgen_templates) ` && { \
+ echo -n "rgen_srcs= "; \
+ for f in $$srcs; do echo "\\"; echo -n " $$f "; done; \
echo; } > rubygen.mk
touch $@
else # !GENERATE