Skip to content

Clean and simple gem downloads count badge, courtesy of http://shields.io/. You can checkout the application directly at the following URL:

License

Notifications You must be signed in to change notification settings

bogdanRada/ruby-gem-downloads-badge

Repository files navigation

Inline docs Code Climate

Clean and simple gem download badge, courtesy of shields.io, that displays the downloads number of your gem. By default will display the downloads count of the latest version of the gem provided.

Currently this service supports only SVG, PNG, JPG (or JPEG) and JSON format

The JSON format though will not display a badge but the data received from rubygems.org in JSON format

##Use

In your README.md, just add an image with the base URL (https://ruby-gem-downloads-badge.herokuapp.com/) followed by the gem name and the version, for example :

You will then get a nice and pretty SVG with the downloads count of the gem provided:

  ![](https://ruby-gem-downloads-badge.herokuapp.com/rails)

Or you can use any extension you like like this (e.g. PNG, JSON):

  ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?extension=png)

You can also specify the version of the gem, for example:

  ![](https://ruby-gem-downloads-badge.herokuapp.com/rails/4.1.0)

You can also specify to display the total downloads count like this:

  ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?type=total)

You can also specify to display the total downloads count for a version like this:

  ![](https://ruby-gem-downloads-badge.herokuapp.com/rails/4.1.0?type=total)

You can also customize the message displayed when using type=total params by using this:

  ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?type=total&total_label=total-awesome)

If you want the downloads count to use metrics,, you can add &metric=true at the end of the url.

![](https://ruby-gem-downloads-badge.herokuapp.com/rails?metric=true)

That's it!

###Further Customization

If you want to change the color of your badge, just append &color=COLOR_NAME to the image URL. By default, the badge is blue.

Available colors are (gem is rails):

Color Badge
brightgreen
green
yellowgreen
yellow
orange
red
lightgray
blue
ff69b4

If you want to style of the badge just append &style=STYLE_NAME.to the image URL. By default, the badge is flat

Available styles are:

Style Name Badge
flat
plastic
flat-square
social

For social badges you can also use links for both sides of the badge like this:

![](https://ruby-gem-downloads-badge.herokuapp.com/rails?style=social&link=https://google.com&link=https://yahoo.com)

If you want something else written on the badge you can use:

![](https://ruby-gem-downloads-badge.herokuapp.com/rails?label=something-else)

You can change the logo width by using this:

![](https://ruby-gem-downloads-badge.herokuapp.com/rails?logoWidth=80)

If you specify a version that is not valid like this, you will see a invalid image:

![](https://ruby-gem-downloads-badge.herokuapp.com/rails/4.1.dsad)


This repository was created by bogdanRada - but is completely built off of shields.io - go check them out! Having a problem? Open an issue.