Nesting Ruby gems inside a Rails project -


how create gem project nested inside current rails project?

i've got rails project several parts gems. extract these parts gems not leave current rails project. creating new source control repos gems add additional complexity project or organization not ready or able handle. these complexities overcome @ point , ready.

so far can think of these items.

  1. relocate code single directory root. i'm guessing in vendor path
  2. create <something>.gemspec
  3. link gem in gemfile of rails app

    gem 'my_lib_code', path: 'vendor/my_lib_code' 

what else need do? i'm sure i'm missing important.


if c project create shared library make process spits out. or if c# project make .dll. java would...

i'm sure ruby can same other languages. half way step between extracted gem , code siting in lib path.

this fine approach component-based architecture.

you have single repository, single test suite, , single deployment process, while @ same time "forced" think of clean interfaces , separation of concerns.

of course if planning on sharing functionality other projects, externally hosted (but not public) gem serve better.

implementation wise, can nifty ideas stephan hagemann's talk @ year's railsconf: "get started component-based rails applications!"


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -