Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bogdanrada/ruby-gem-downloads-badge
Clean and simple gem downloads count badge, courtesy of http://shields.io/. You can checkout the application directly at the following URL:
https://github.com/bogdanrada/ruby-gem-downloads-badge
badge color downloads-count flat gem icon image json-format label logo metrics plastic png ruby shield social square svg total version
Last synced: 3 months ago
JSON representation
Clean and simple gem downloads count badge, courtesy of http://shields.io/. You can checkout the application directly at the following URL:
- Host: GitHub
- URL: https://github.com/bogdanrada/ruby-gem-downloads-badge
- Owner: bogdanRada
- License: mit
- Created: 2014-07-03T16:39:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T19:27:12.000Z (almost 2 years ago)
- Last Synced: 2024-11-02T01:50:23.074Z (3 months ago)
- Topics: badge, color, downloads-count, flat, gem, icon, image, json-format, label, logo, metrics, plastic, png, ruby, shield, social, square, svg, total, version
- Language: Ruby
- Homepage: http://ruby-gem-downloads-badge.herokuapp.com/
- Size: 591 KB
- Stars: 31
- Watchers: 1
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
https://ruby-gem-downloads-badge.herokuapp.com/ - gem downloads shields
======================================================================[![Inline docs](http://inch-ci.org/github/bogdanRada/ruby-gem-downloads-badge.svg?branch=master)](http://inch-ci.org/github/bogdanRada/ruby-gem-downloads-badge) [![Code Climate](https://codeclimate.com/github/bogdanRada/ruby-gem-downloads-badge/badges/gpa.svg)](https://codeclimate.com/github/bogdanRada/ruby-gem-downloads-badge)
Clean and simple gem download badge, [courtesy of shields.io](https://github.com/badges/shields), 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:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails)
```![](https://ruby-gem-downloads-badge.herokuapp.com/rails)
Or you can use any extension you like like this (e.g. **PNG**, **JSON**\):
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails?extension=png)
```![](https://ruby-gem-downloads-badge.herokuapp.com/rails?extension=png)
You can also specify the version of the gem, for example:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails/4.1.0)
```![](https://ruby-gem-downloads-badge.herokuapp.com/rails/4.1.0)
You can also specify to display the total downloads count like this:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails?type=total)
```![](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:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails/4.1.0?type=total)
```![](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:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails?type=total&total_label=total-awesome)
```![](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.
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails?metric=true)
```![](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 | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=brightgreen&style=flat) |
| green | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=green&style=flat) |
| yellowgreen | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=yellowgreen&style=flat) |
| yellow | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=yellow&style=flat) |
| orange | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=orange&style=flat) |
| red | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=red&style=flat) |
| lightgray | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=lightgray&style=flat) |
| blue | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=blue&style=flat) |
| ff69b4 | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?color=ff69b4&style=flat) |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 | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?style=flat) |
| plastic | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?style=plastic) |
| flat-square | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?style=flat-square) |
| social | ![](https://ruby-gem-downloads-badge.herokuapp.com/rails?style=social) |For social badges you can also use links for both sides of the badge like this:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails?style=social&link=https://google.com&link=https://yahoo.com)
```![](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:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails?label=something-else)
```![](https://ruby-gem-downloads-badge.herokuapp.com/rails?label=something-else)
You can change the logo width by using this:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails?logoWidth=80)
```![](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:
```sh
![](https://ruby-gem-downloads-badge.herokuapp.com/rails/4.1.dsad)
```![](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](https://github.com/badges/shields) - go check them out! Having a problem? [Open an issue.](https://github.com/bogdanRada/gem-downloads-badge/issues)**