[holy ruby programmers batman!] Adding a configuration file to Utility Belt

Tim Connor timocratic at gmail.com
Sun Dec 23 14:06:17 EST 2007

On Dec 23, 2007 10:59 AM, Giles Bowkett <gilesb at gmail.com> wrote:
> Yes. I was hoping to use modules exclusively but I really didn't think
> it through. Any time you define methods without specifying an object
> you're hitting Object. You can use Kernel instead, but only because it
> gets mixed into Object. I looked into the mixing into IRB's methods
> thing but I didn't figure it out. It looks pretty cool and would be a
> good way to avoid incompatibilities with method names in other
> libraries.

Even for the cases where you have to mixin directly to Kernel, though,
you are better off doing "Kernel.send :include..." than just reopening
that class, methinks.  It might be a little more verbose, but your
Modules are better organized (and easier to test) then, and you have
cleaner control over the load process (via included, etc).  Even if
you don't need that last part immediately, it is definitely not YAGNI
- trust me ("unless loaded_by_rails?" ;) ).

More information about the Utilitybelt-tinkering mailing list