views:

47

answers:

1

In the documentation for Rails::Plugin (for Rails 3), I'm reading the following:

"... you actually cannot declare a Rails::Engine inside your Plugin, otherwise it would cause the same files to be loaded twice. This means that if you want to ship an Engine as gem it cannot be used as plugin and vice-versa."

Can anyone be more specific about exactly what files get loaded twice? I have declared a plugin/gem as Engine, and it works fine also being put inside vendor/plugins (and I'd like to keep it this way), in spite of the statement above. I simply want some clarity on why (and whether) this is not a good thing to do.

Thank you!

A: 

I don't have an exact answer myself, but this subject is covered in these two resources which I have found helpful:

http://www.themodestrubyist.com/2010/03/01/rails-3-plugins---part-1---the-big-picture/ https://gist.github.com/e139fa787aa882c0aa9c

Keith Schacht