开发者

Versioning Ruby gems in a git repository

What are best practices for storing your gems in one git repository? Should they be kept in one repository? Should each gem be versioned on its own? I'm mostly concerned with gems that are shared on a per project basis - even though that defeats the purpose of a gem, which can be reused and shared in other projects. I wanted an easy way to keep all开发者_StackOverflow of my gems versioned, preferably without having to worry about 50 git repos.. and push them to a gem server whenever they're ready to be pushed.


I agree with Maarons that bundler and/or rvm gemsets are best practice, but if you want to keep your gem code versioned as part of your applications repo, then I think the solution you're looking for is to vendor your gems and then add them as submodules to your application's git repo.

You can vendor your current gems by running the rake task: rake gems:build

Any new gems you want to install can be installed as a plugin by running ruby script/plugin install your_plugin . That should clone the git repo of the plugin you're interested in. See appropriate plugin docs for more options (like to grab a specific release).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜