I really enjoy crashing into a gem with a markdown-ready README file that includes top badges telling me things like the current available gem version, the fact that is continuously being tested using travis or knowing the developer cares about the gem dependencies being up-to-date!
Achieving all that will take some steps, here is how:
How the badges will look like
Where to sign-up
For the gem version badge just push to rubygems at least 1 time and the badge will be there for you. Also, the “Version Badge” page offers an easy copy and paste builder of the URL that you can use here
For your build status go to Travis-CI.org and follow the link “Sign in with GitHub”
For gem dependencies status Signup at Gemnasium
For code quality stats Signup at Code Climate
For pretty documentation generator read here or simply go to
Getting your code ready to use them
Gem version, code climate and gem dependencies do not require more work on your side besides pushing your updates to github, those services will take care of the rest.
.travis.yml file to your project root, change it depending on the ruby versions you are interested to support:
1 2 3 4 5
Coveralls with SimpleCov
I use SimpleCov for test coverage, coveralls gem take care of your badge,
Add necessary dependencies to your gemspec:
If you use rspec, update your
spec_helper.rb and add this lines to the very beginning:
1 2 3 4 5 6 7 8
Update your README file
Replace strings elgalu with your github user and boolean_class with your github repo name. It’s probably a better idea that you use a templating tool for this like the one I built and use
# TODO: Your gem name [![Gem Version][GV img]][Gem Version] [![Build Status][BS img]][Build Status] [![Dependency Status][DS img]][Dependency Status] [![Code Climate][CC img]][Code Climate] [![Coverage Status][CS img]][Coverage Status] ## Description TODO: Your gem description [Gem Version]: https://rubygems.org/gems/boolean_class [Build Status]: https://travis-ci.org/elgalu/boolean_class [travis pull requests]: https://travis-ci.org/elgalu/boolean_class/pull_requests [Dependency Status]: https://gemnasium.com/elgalu/boolean_class [Code Climate]: https://codeclimate.com/github/elgalu/boolean_class [Coverage Status]: https://coveralls.io/r/elgalu/boolean_class [GV img]: https://badge.fury.io/rb/boolean_class.png [BS img]: https://travis-ci.org/elgalu/boolean_class.png [DS img]: https://gemnasium.com/elgalu/boolean_class.png [CC img]: https://codeclimate.com/github/elgalu/boolean_class.png [CS img]: https://coveralls.io/repos/elgalu/boolean_class/badge.png?branch=master
Don’t forget to let me know if i’m missing new cool badges out there!
I’ve recently added githalytics service in order to have Google Analytics for each of my github repos. Note there is also bitdeli service but haven’t tested it yet, let me know if is better or more free.
To do so:
Go to Google Analytics website and signup to get your Property ID, e.g.
Default URL protocol: https:// Default URL source..: github.com/elgalu/time_ago_in_words
You may also delete
github.comfrom your GA Referral Exclusion List
Go to githalytics and sign up, e.g.
TrackingCode[url]: https://github.com/elgalu/time_ago_in_words TrackingCode[code]: UA-12345-12
Add the fake image badge that will send data for analytics purposes, e.g.
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/3fe2425a26ab0ca00b5bc6acf817af59 "githalytics.com")](http://githalytics.com/elgalu/time_ago_in_words)
That should be it. Remember to check later on Google Analytics site for the collected data, works like a charm!