Forum: Rails Engines <%= license %>

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
mengjiang L. (Guest)
on 2006-02-20 16:12
what's meaning of this line code in init_engine?
such as

module <%= engine_class_name %>
end
James A. (Guest)
on 2006-02-20 16:17
(Received via mailing list)
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...
>


--
* J *
  ~
mengjiang L. (Guest)
on 2006-02-20 17:07
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...
>>
>
>
> --
> * J *
>   ~


thanks for your reply, and can you exlpain it more clearly by a example?
James A. (Guest)
on 2006-02-20 17:15
(Received via mailing list)
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 *
  ~
This topic is locked and can not be replied to.