Reputation: 637
My rails 4 project depends on Comfortable Mexican Sofa (CRM) which is loaded as a gem. I checked out this gem as a submodule of my git repository.
Moving forward, this gem is becoming part of my project: I'm adding features to it that depends on classes of my projects.
I would like to keep this gem as a submodule (to be able to pull changes from the main repository) but still be able to add code that rely on my project.
What's the cleanest way to achieve that ? (should I put the whole gem submodule into my lib folder for instance ? should I keep it referenced as a gem ? etc...)
Upvotes: 3
Views: 198
Reputation: 76774
should I keep it referenced as a gem
Yes, you need to keep it referenced as a gem.
One of the benefits of using external libraries is that they are maintained by a group of very clever people (most of the time). It would be highly unlikely that you're going to be able to keep the submodules you include up to date as much as the gem owners etc.
What you're best doing is either overriding specific parts of the gem (EG like how many people override Devise
functionality with their own controllers), or to see about creating an API for the gem, which you can populate from your app.
Upvotes: 3
Reputation: 3869
For me, in development, separation is always better then binding. I would recommend to leave it as gem and develop in the separate repository.
Upvotes: 2