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

rob rob at motionpath.com
Wed Feb 15 16:39:07 EST 2006


People using those include aliases is a good argument for keeping the  
default as it is (including glue into default namespace). I know  
everyone loves syntactic maple-syrup ;)

I would recommend the tests do get changed (since it works in both  
situations with the second example) but examples do not. Possibly the  
whole test should be run with the $GLUE_DONT_INCLUDE global in both  
states now and again to see it's all working correctly?

I would like to see this change in general Glycerin/Nitro as it makes  
it co-exist with other libraries much better (something I can  
remember at least two complaints of - GTK/XML Builder, in addition to  
my own problems). If at this stage it is an issue, imagine what a  
PITA it would be if/when Nitro is more mainstream.

Even though we've been running it in a couple of production projects  
since shortly after I came up with it, I'm still not convinced a  
patch generated with sed commands does't need further testing by  
clever people before it does (hopefully) become part of Nitro...

On 15 Feb 2006, at 21:08, Bryan Soto wrote:

> This patch applies cleanly against current repository.
>
> Tests fail when $GLUE_DONT_INCLUDE = true. Basically, things like
> class User
>   is Orderable
> end
>
> need to be changed to
>
> class User
>   is Glue::Orderable
> end
>
> because 'is' acts like an alias to include.
>
> So, from a user perspective, this won't break anything as it  
> doesn't change the default. If you do need to set the flag, you  
> will either need to specify the full namespace in the is method, or  
> include Glue::Orderable in your namespace.
>
> Again, this doesn't change anything *unless* you set  
> $GLUE_DONT_INCLUDE to true before requiring glue.
>
> Any comments?
>
> Bryan
>
> ---------- Forwarded message ----------
> From: Rob Pitt <rob at motionpath.com>
> Date: Jan 25, 2006 9:04 AM
> Subject: [Nitro] [PATCH] Nitro shouldn't rely on Glue being in  
> Object's name space	(fixes XML Builder name clash problems, etc).
> To: General discussion about Nitro <nitro-general at rubyforge.org >
>
> 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
>
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>
>
> <dont-rely-on-glue.patch.bz2>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060215/00de3a34/attachment.html 


More information about the Nitro-general mailing list