<%= license %>


#1

what’s meaning of this line code in init_engine?
such as

module <%= engine_class_name %>
end


#2

It looks like you’re examining the generator templates there. The
engine generator will create a module with the same name as your
engine (simply for convenience, you dont need to use or keep it. The
<%= engine_class_name %> part is replaced when ERb processes the
generator templates.

In general, most Rails generators use ERb templates to distribute code
that needs to be created with particular values replaced at the time
of file creation.

james

On 2/20/06, mengjiang liu removed_email_address@domain.invalid wrote:

removed_email_address@domain.invalid
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~

#3

James A. wrote:

It looks like you’re examining the generator templates there. The
engine generator will create a module with the same name as your
engine (simply for convenience, you dont need to use or keep it. The
<%= engine_class_name %> part is replaced when ERb processes the
generator templates.

In general, most Rails generators use ERb templates to distribute code
that needs to be created with particular values replaced at the time
of file creation.

james

On 2/20/06, mengjiang liu removed_email_address@domain.invalid wrote:

removed_email_address@domain.invalid
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~

thanks for your reply, and can you exlpain it more clearly by a example?


#4

On 2/20/06, mengjiang liu removed_email_address@domain.invalid wrote:

thanks for your reply, and can you exlpain it more clearly by a example?

What in particular do you want to understand? If you are curious about
how generators work, the rails mailing list will be the best place to
ask. If you want to know why the engines generator in particular
creates a module with the same name as you gave your engine, it’s
basically to prompt you into keeping your libraries collected under a
single module.

  • J *
    ~