# \<%= license %\>

**URL:** <https://www.ruby-forum.com/t/license/70865>\
**Category:** Engines\
**Created:** [February 20, 2006, 3:12pm UTC](https://www.ruby-forum.com/t/license/70865 "2006-02-20T15:12:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![limux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@limux](https://www.ruby-forum.com/u/limux)\
**Post date:** [February 20, 2006, 3:12pm UTC](https://www.ruby-forum.com/t/license/70865/1 "2006-02-20T15:12:57Z")

</div>

what’s meaning of this line code in init\_engine?  
such as

module \<%= engine\_class\_name %\>  
end

---

<div class="post-metadata">

**Author:** ![limux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@limux](https://www.ruby-forum.com/u/limux)\
**Post date:** [February 20, 2006, 3:17pm UTC](https://www.ruby-forum.com/t/license/70865/2 "2006-02-20T15:17:25Z")

</div>

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](mailto:removed_email_address@domain.invalid) wrote:

> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

–

- J \*  
~

---

<div class="post-metadata">

**Author:** ![limux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@limux](https://www.ruby-forum.com/u/limux)\
**Post date:** [February 20, 2006, 4:07pm UTC](https://www.ruby-forum.com/t/license/70865/3 "2006-02-20T16:07:34Z")

</div>

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](mailto:removed_email_address@domain.invalid) wrote:
> 
> > removed\_email\_address@domain.invalid  
> > [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](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?

---

<div class="post-metadata">

**Author:** ![limux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@limux](https://www.ruby-forum.com/u/limux)\
**Post date:** [February 20, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/license/70865/4 "2006-02-20T16:15:02Z")

</div>

On 2/20/06, mengjiang liu [removed\_email\_address@domain.invalid](mailto: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 \*  
~
