harled / monocle

Esteemed insight for pundit exceptions.
MIT License
6 stars 0 forks source link

Turn Monocle into an engine #13

Closed jonathanloos closed 2 years ago

jonathanloos commented 2 years ago

Monocle is going to feature Active Record migrations, controllers and views eventually and to allow for full Rails mounting we'll need to convert Monocle into an engine. This ticket focuses solely on the restructuring of Monocle to follow the scaffolded Rails Engine layout with the current view components preserved.

A good example of an engine we use: https://github.com/ankane/notable

Getting started with engines: https://guides.rubyonrails.org/engines.html Gem vs Engine: https://devblast.com/b/gems-vs-engines-know-the-difference

alexmcdermid commented 2 years ago

I'm not sure if this is what you meant by turning the gem into an engine. I created an engine then moved the missing engine files into the gem. https://github.com/harled/monocle/pull/15

alexmcdermid commented 2 years ago

The --mountable option tells the generator that you want to create a "mountable" and namespace-isolated engine. This generator will provide the same skeleton structure as would the --full option. The --full option tells the generator that you want to create an engine, including a skeleton structure that provides:

I think maybe the pros of full is that it auto generates some extra skeleton structure... which could also be a con depending on the use case. I think something about the 'isolated' nature of the mounted variant is probably not what we want for this monocle conversion, making it a con.