This post is intended to initiate a discussion about extended the default behavior of rails plugin new to support nested engines as discussed in the presentation Rails Engines Patterns by Andy Maleh.
Currently the only way to implement a nested rails engine pattern within a set of gems, is to do so manually. A great example is RefineryCMS.
Refinery’s architecture
"Refinery comprises of several Rails Engines. Each extension acts like a mini Rails application with its own routes and views. Refinery is architected like this so that it keeps out of the way of any custom development you will do in the /app directory." While inheriting common domain from the RefineryCMS core.
Refinery ships with a dependency engine generator, which is exactly the type of functionality that rails plugin new should have
rails generate refinery:engine singular_model_name attribute:type [attribute:type ...]
A use case would be create a core engine (MyEngine) which allows the nested dependency engines (MyEngine::Blog, MyEngine::Pages) to share common domain, like CRUD, Taggable, Searchable, etc, while keeping the engine code DRY and isolated from the main app (MyApp).
Proposed implementation A:
rails plugin new MyEngine-Blog --engine
Proposed implementation B:
rails engine new MyEngine-Blog --mountable
rails engine new MyEngine-Blog --gem #Which would gemify the engine
Thoughts?
Any word?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-co...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.