[Nitro] Part.require expected behaviour

Trans transfire at gmail.com
Wed Nov 28 07:10:44 EST 2007



On Nov 27, 11:58 pm, Arne Brasseur <a... at arnebrasseur.net> wrote:
> Hi devs,
>
> Part.require("part_name") currently does a
> Kernel.require("./part/part_name"). The consequence is that only parts
> in the actual application directory can be loaded with Part.require. If
> they're somewhere else in the load path you have to (Kernel.)require
> them yourself.
>
> This also means Part.require "admin" doesn't work, and neither will it
> work for parts in gems etc.
>
> I changed this for myself to do Kernel.require("part/part_name") and I
> was going to send a patch but I just wanted to check if this is perhaps
> deliberate. What's the expected behaviour of Part.require?

That this patch works is a side effect of the current dev branch
though -- "part" is acting a separate project. But this is probably
not the best course of action --it's a temporary measure really. B/c
if not it means:

  gem install part

I don't think we want a project named "part" that's just for Nitro
plugins. The thing is, other people can distribute parts and parts
collection too. Those projects should have their own names to
distinguish them from others. So how do you require those? You have to
require them like any other lib. So I think Part.require is
unnecessary.

And actually after looking it over I get the feeling all of part.rb
may be unnecessary. It depends of course, but is install/uninstall
being used? Can't setup be done at require time, and finalize with
END{} clause? Are we really tracking active parts? If so can't the
part just issue some sort of "nitro_register" method? -- That kind of
thing.

T.


More information about the Nitro-general mailing list