[Nitro] [PATCH] Nitro shouldn't rely on Glue being in Object's name space (fixes XML Builder name clash problems, etc).

Rob Pitt rob at motionpath.com
Wed Jan 25 12:04:34 EST 2006


I have also come across this problem because Nitro wrongly relies on
Glue existing in Object's name space which was preventing me from using
the ruby breakpoint debugger. I have made a patch that removes Nitro's
reliance on having Glue included in the default name space (I think it
is wrong that Glue does this by default but that's another matter).

This patch is for use at your own risk and I'm sure there are a couple
of minor problems with it but it should be eventually worked into Nitro
IMHO.

You will also need to set:

$GLUE_DONT_INCLUDE = true

Before loading Glue/Nitro.

On Fri, 2006-01-20 at 13:55 -0700, James Britt wrote:
> I'm trying to use Jim Wierich's XML Builder library in Nitro to create 
> atom and rss feeds.  I cannot call "require 'builder'" without errors.
> 
> This is with Nitro 0.27 on winxp with Ruby 1.8.2
> 
> rubygems automagically included by way of RUBYOPTS
> 
> 
> If I run this bare script:
> 
>    require 'builder'
> 
> It runs fine.
> 
> But as soon as I add nitro to the mix, I get assorted errors
> 
> This:
> 
>    require 'builder'
>    require 'nitro'
> 
> 
> Gives this:
> 
> C:\WINDOWS\system32\cmd.exe /c c:/ruby/bin/ruby build.rb
> c:/ruby/lib/ruby/gems/1.8/gems/facets-2005.10.30/lib/mega/basicobject.rb:90:in 
> `bind': singleton method called for a different object (TypeError)
>          from 
> c:/ruby/lib/ruby/gems/1.8/gems/facets-2005.10.30/lib/mega/basicobject.rb:90:in 
> `method_added'
>          from 
> c:/ruby/lib/ruby/gems/1.8/gems/facets-2005.10.30/lib/mega/basicobject.rb:89:in 
> `method_added'
>          from 
> c:/ruby/lib/ruby/gems/1.8/gems/facets-2005.10.30/lib/mega/openobject.rb:56
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
>          from 
> c:/ruby/lib/ruby/gems/1.8/gems/facets-2005.10.30/lib/mega/annotation.rb:53
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
>           ... 6 levels...
>          from c:/ruby/lib/ruby/gems/1.8/gems/nitro-0.27.0/lib/nitro.rb:11
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:25:in `require__'
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:25:in `require'
>          from build.rb:2
> shell returned 1
> 
> 
> 
> And this:
> 
>    require 'nitro'
>    require 'builder
> 
> Gives this:
> 
> C:\WINDOWS\system32\cmd.exe /c c:/ruby/bin/ruby build.rb
> c:/ruby/lib/ruby/gems/1.8/gems/builder-1.2.4/lib/builder/blankslate.rb:11: 
> Builder is not a module (TypeError)
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
>          from 
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
>          from 
> c:/ruby/lib/ruby/gems/1.8/gems/builder-1.2.4/lib/builder/xmlbase.rb:3
> 
> 
> Are there special libraries that cannot be used wth Nitro?
> 
> Is there a trick to including certain libraries?
> 
> 
> 
> Thanks,
> 
> 
> James
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dont-rely-on-glue.patch.bz2
Type: application/x-bzip
Size: 5978 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20060125/54a495d7/attachment.bin 


More information about the Nitro-general mailing list