简体   繁体   中英

workflow for building rails engines as gems

We are looking into building a very large rails application and considering using engines for better separation of "modules" out of the main app.

we have started this process by creating a small engine using the gem motorhead (the idea of its active_if component is wanted). That engine was then removed from the main app and given a git init, then pushed to github.

the main app then was able to pull the gem in within the Gemfile.

During this proof of concept, it works, but not very efficient, and also updating the new engine/gem is a bit awkward in this way as it is kinda a submodule in a way. What is the proper workflow for building and maintaining engines/gems when building a modular app like this?

Thanks in advance

The most akward part about deploying Gems or Engines as modules is the constant need to update. We had a lot of success with using:

bundle config local.my_gem ~/projects/my_gem/

It'll point to the Gem/Engine version on disk without modifying the Gemfile and Gemfile.lock.

To remove the local override run:

bundle config --delete local.my_gem ~/projects/my_gem/

With this you should be able to restrict the times the Gemfile.lock has to be updated to deployment time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM