[Nitro] "magic" mapping of controllers possible?

Bryan Soto bryan.a.soto at gmail.com
Mon Jun 26 20:24:07 EDT 2006


> > module Kernel
> >   def aquire *dirs
> >     dirs.each do |dir|
> >       Dir["#{dir}/*.rb"].each do |file|
> >         require file
> >       end
> >     end
> >   end
> > end
> >
> > aquire :helpers, :controllers, :models
> >
>
> I like it!  Till now, I've been doing
>
> Dir.glob('app/*.rb').each { |r| require r }
>
> to get my controllers and extra files loaded.
>

Trans like it too. :)

require 'facet/kernel/require_all

require_all 'app/*.rb'


More information about the Nitro-general mailing list