Foreman Rails::Engine plugins not properly separated

I couldn't for the life of me figure out why my new plugin wouldn't
coexist properly with the foreman_radiator plugin and I think I found
why:

Pull requests here:

https://github.com/isratrade/foreman_radiator/pull/2

Issue seems simple - the engines were never properly separated because
the plugin templates do "require 'engine'" - where it should say
"require 'my_engine/engine' and the lib/engine.rb move into
lib/my_engine/engine.rb.

Now all engine plugins load and I get all routes whereas before - I
only got one plugin properly loaded - foreman_radiator.

After the fix - bundle exec rake routes now include routes from both plugins:

dashboard /radiator(.:format)
{:action=>"radiator",
:controller=>"foreman_radiator/dashboard"}

/epel-release/:version/:arch(.:format)
{:action=>"latest", :controller=>"foreman_epel_release/epel"}

Makes sense, right?

Mikael

> I couldn't for the life of me figure out why my new plugin wouldn't
> coexist properly with the foreman_radiator plugin and I think I found
> why:
>
> Pull requests here:
> https://github.com/frimik/foreman_epel_release/pull/1
> https://github.com/isratrade/foreman_radiator/pull/2
>
> Issue seems simple - the engines were never properly separated because
> the plugin templates do "require 'engine'" - where it should say
> "require 'my_engine/engine' and the lib/engine.rb move into
> lib/my_engine/engine.rb.
>
> Now all engine plugins load and I get all routes whereas before - I
> only got one plugin properly loaded - foreman_radiator.
>
> After the fix - bundle exec rake routes now include routes from both
> plugins:
> …
> dashboard /radiator(.:format)
> {:action=>"radiator",
> :controller=>"foreman_radiator/dashboard"}
>
> /epel-release/:version/:arch(.:format)
> {:action=>"latest", :controller=>"foreman_epel_release/epel"}
>
>
> Makes sense, right?
>
+1

··· On Thu, Jan 3, 2013 at 12:15 PM, Mikael Fridh wrote:

Mikael