On Wed, Aug 29, 2007 at 06:38:48AM +0100, Brian Candler wrote:
> You just need to reference the class in merb_init.rb to trigger the
> autoload, e.g.
> 
> Merb::Template::Haml
> 
> > So the question is:
> > 
> > * Is this the permanent situation for the future?

On reflection, it doesn't seem to make much sense to set up autoloading, but
then to have to explicitly trigger it. Based on the Merb KISS principle, I
think it would be cleaner to just put

require 'merb/template/haml'

in merb_init.rb, and get rid of the autoload magic (although there's only a
tiny bit of that, in lib/merb/template.rb)

Does anyone else share this opinion?

Perhaps examples/skeleton/conf/merb_init.rb should be changed to say

--------------------------------------------------------------------------
# Uncomment the template handers which your application needs to load
require 'merb/template/erubis'          # .herb .jerb .erb .rhtml .html.erb 
.js.erb
# require 'merb/template/haml'          # .haml
# require 'merb/template/markaby'       # .mab
# require 'merb/template/xml_builder'   # .rxml .xerb .builder
--------------------------------------------------------------------------

and then it doesn't matter whether the autoload stuff is there or not.

Regards,

Brian.
_______________________________________________
Merb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/merb-devel

Reply via email to