Brian Palmer
8/1/2006 10:53:00 PM
On Aug 1, 2006, at 4:11 PM, James Edward Gray II wrote:
> Ruby has a function for this though:
>
> $ ri -T Kernel#autoload
> --------------------------------------------------------
> Kernel#autoload
> autoload(module, filename) => nil
> ----------------------------------------------------------------------
> --
> Registers filename to be loaded (using Kernel::require) the first
> time that module (which may be a String or a symbol) is accessed.
>
> autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")
>
> James Edward Gray II
>
Cool, I didn't realize that was already baked in to Kernel.
On Aug 1, 2006, at 4:22 PM, Luke Kanies wrote:
> Puppet supports lots of package types (e.g., dpkg, apt, rpm,
> darwinports, gems) and service types (init, smf, etc.); I specify
> the name when I create the class, and users can select those types
> by name, either in the language or directly in Ruby if they're
> directly accessing the library.
>
> In other words, my problem is not how to hook into the autoload,
> it's the guts behind it.
I misunderstood your question, sorry about that.
-- Brian