I work with a team of developers that is transitioning to Ruby on Rails for some web development projects. We expect that in the development process we will develop shared code. I understand that Gems are one method to share code, but in some cases a Module may be a better approach for us from a development standpoint.
My question is if Programmer A develops a module that Programmer B would like to use in his/her project, what is the best way(s) to do it when the module is in a Git repository? For example, Programmer A might maintain the module, and Programmer B may want to take advantage of new features in the module, so Programmer B simply copying the module file into his/her application isn’t an option.
Assume that a SharedModules repository exists which holds various modules (e.g., module1.rb, module2.rb, etc) in a Modules folder. Programmer B can clone the SharedModules repository, but may be interested in just using one module (module1.rb) in his/her application. How can Programmer B accomplish this and still ensure that pulling the SharedModules repository will update module1.rb in his/her application? Is there some kind of symlink-based approach?
You could setup a repo for each module and then use git Submodules: http://git-scm.com/book/en/Git-Tools-Submodules