2008-08-14

gen_bridge_metadata

On OS-X to get ruby/python bindings for frameworks, there is a program called 'gen_bridge_metadata' that ships with Leopard. Unfortunately, it is broken. It complains of an undefined local variable or method:

Exception `NameError' at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:187 - undefined local variable or method `trans' for ... :REXML::Document

The fix is to edit the document.rb, located at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb, directly. Here's a patch that should should be applicable for anyone that comes across it.

--- a/document.rb 2008-08-14 16:45:08.000000000 -0400
+++ b/document.rb 2008-08-14 16:45:11.000000000 -0400
@@ -184,7 +184,7 @@
output = Output.new( output, xml_decl.encoding )
end
formatter = if indent > -1
- if trans
+ if transitive
REXML::Formatters::Transitive.new( indent, ie_hack )
else
REXML::Formatters::Pretty.new( indent, ie_hack )