# Plugins and Engines

**URL:** <https://www.ruby-forum.com/t/plugins-and-engines/98749>\
**Category:** Rails\
**Created:** [July 17, 2006, 11:29pm UTC](https://www.ruby-forum.com/t/plugins-and-engines/98749 "2006-07-17T23:29:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wycats](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/eb9ed0/32.png) [@wycats](https://www.ruby-forum.com/u/wycats)\
**Post date:** [July 17, 2006, 11:29pm UTC](https://www.ruby-forum.com/t/plugins-and-engines/98749/1 "2006-07-17T23:29:30Z")

</div>

I’m trying to work out how to use the functionality from a plugin in an  
engine. It sounds weird, but it’s actually not so strange.

I assume I can’t just add a vendor directory to an Engine, so some  
strategy for getting the plugin in the lib folder is probably necessary  
(and then requiring the plugin, perhaps?).

– Yehuda K.

---

<div class="post-metadata">

**Author:** ![wycats](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/eb9ed0/32.png) [@wycats](https://www.ruby-forum.com/u/wycats)\
**Post date:** [July 18, 2006, 12:28am UTC](https://www.ruby-forum.com/t/plugins-and-engines/98749/2 "2006-07-18T00:28:32Z")

</div>

On 7/17/06, Yehuda K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m trying to work out how to use the functionality from a plugin in an  
> engine. It sounds weird, but it’s actually not so strange.
> 
> I assume I can’t just add a vendor directory to an Engine, so some  
> strategy for getting the plugin in the lib folder is probably necessary  
> (and then requiring the plugin, perhaps?).
> 
> – Yehuda K.

I think your saying you want to have an engine utilize a plugin?

I’m not sure I ever tried that, but I do have plugins and engines  
being utilzed in the same app, it just worked.

I would expect that same to be true of an engine that needs to utilize  
plugin code.

i.e  
install your\_plugin to vendors/plugins/your\_plugin  
install the generic engines plugin to vendors/plugins/engines  
install your\_engine into vendors/plugins/your\_engine

Then when your rails env. fire ups it will run the init.rb from both  
your\_plugin and from the generic engines plugin, that should get the  
basic environment for both accessible, but your engine will not yet  
have been initialized.

Then invoke Engines.start :your\_engine from environment.rb.

Where does the problem come in?

## Greg

Greg F.  
The Norcross Group  
Forensics for the 21st Century

---

<div class="post-metadata">

**Author:** ![wycats](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/eb9ed0/32.png) [@wycats](https://www.ruby-forum.com/u/wycats)\
**Post date:** [July 18, 2006, 12:31am UTC](https://www.ruby-forum.com/t/plugins-and-engines/98749/3 "2006-07-18T00:31:59Z")

</div>

I’d have preferred if I could get the plugins in the Engine, so people  
wouldn’t need to get a bunch of plugins to make my Engine work. That  
said, I could just say that certain features of the Engine require  
certain plugins.

Greg F. wrote:

> I think your saying you want to have an engine utilize a plugin?
> 
> I’m not sure I ever tried that, but I do have plugins and engines  
> being utilzed in the same app, it just worked.
> 
> I would expect that same to be true of an engine that needs to utilize  
> plugin code.
> 
> i.e  
> install your\_plugin to vendors/plugins/your\_plugin  
> install the generic engines plugin to vendors/plugins/engines  
> install your\_engine into vendors/plugins/your\_engine
> 
> Then when your rails env. fire ups it will run the init.rb from both  
> your\_plugin and from the generic engines plugin, that should get the  
> basic environment for both accessible, but your engine will not yet  
> have been initialized.
> 
> Then invoke Engines.start :your\_engine from environment.rb.
> 
> Where does the problem come in?
> 
> ## Greg
> 
> Greg F.  
> The Norcross Group  
> Forensics for the 21st Century

---

<div class="post-metadata">

**Author:** ![wycats](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/eb9ed0/32.png) [@wycats](https://www.ruby-forum.com/u/wycats)\
**Post date:** [July 18, 2006, 12:38am UTC](https://www.ruby-forum.com/t/plugins-and-engines/98749/4 "2006-07-18T00:38:48Z")

</div>

There are engines users and dev lists.

If you want to pursue this, I would post on them.

On 7/17/06, Yehuda K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > basic environment for both accessible, but your engine will not yet  
> > Forensics for the 21st Century
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Greg F.  
The Norcross Group  
Forensics for the 21st Century
