Hashrocket.com / blog

Bg default article large

Using Github Repos in your Gemfile

posted on and written by Paul Elliott in

Image 100x100 paul elliott

There is always that one gem that you need to pull from a github repo. The author has slacked off on cutting a release for that bugfix that had you blocked and now you've got to not only type out the whole repo url but you have this monstrosity mixed into your beautiful Gemfile.

gem 'fabrication'
gem 'decent_exposure'
gem 'none_such', git: 'git://github.com/avdi/none_such.git'
gem 'quantum_leap'

Unfortunately you can't git rid of that ugliness completely, but you can make it a little more pleasant and easier to type by using the github option instead of git.

gem 'fabrication'
gem 'decent_exposure'
gem 'none_such', github: 'avdi/none_such'
gem 'quantum_leap'

The branch option still works like you would expect, so you can safely use the new syntax without losing functionality.

You must be on bundler 1.1 or newer to use this feature.

Posted in Development and tagged with Ruby