[Nitro] "magic" mapping of controllers possible?

Dimitri Aivaliotis aglarond at gmail.com
Fri Jun 23 03:30:10 EDT 2006

On 6/23/06, Michael Fellinger <manveru at weez-int.com> wrote:
> one thing still disturbing me is
> if ! Nitro.const_defined?( controller )
> could we make it into a pretty
> unless Nitro.const_defined? controller
> it just seems !good to me to use ! unless it's needed

Ah, much better.

> (task for today: discover the wordplay in the last sentence)

> and also, auto_map= implies that one can retrieve the map later by calling
> Nitro::Server.auto_map, which is not the case, but should be easy to
> provide
> an alias to Nitro::Server.map - right? :)

Sounds good to me.

> I think we should decide on a (very simple) default nitro-dir-structure
> and
> integrate that piece of code to make life easier...
> Maybe adding some Global variables for the default-locations?

Or by using the Configuration system.  That's something I've been wanting
for awhile - so that I can more easily change the defaults. :)

Right now, all we have is Glue::Template.root=

> also, how about this snippet, since we are just at improving run.rb...
> 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.

- Dimitri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060623/e74c242a/attachment.html 

More information about the Nitro-general mailing list