Part.require expected behaviour

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?

(ab)


Arne B.
http://www.arnebrasseur.net
http://www.zhongwiki.com
http://www.bankske.org
[email protected]

Please send the patch!

-g.

On Nov 27, 11:58 pm, Arne B. [email protected] wrote:

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.

Trans schreef:

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.

Well the admin part uses setup to mount controllers, my part does this
as well. For what it currently does I agree that Part.require might as
well not be there. Maybe the concept has to be rethought. For the moment
it doesn’t do much more than encourage people to make little chunks of
Nitro apps, but maybe it can be more than that. How about automated
install/uninstall? Or should people just use rubygems?

(ab)


Arne B.
http://www.arnebrasseur.net
http://www.zhongwiki.com
http://www.bankske.org
[email protected]