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

zimba.tm zimba.tm at gmail.com
Thu Feb 16 02:32:34 EST 2006


Applied

This looks like a reasonable patch to start with.

We could also change the "is" method to look in the Glue namespace when a 
symbol is passed.

I don't like that the Glue namespace is used to put anything inside it. We 
should try to part the classes in other namespaces.

On Wednesday 15 February 2006 22: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:5
> >6 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:5
> >3 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

-- 
Cheers,
  zimba.tm

weblog : http://zimba.oree.ch



More information about the Nitro-general mailing list