ReadmeScore
Gives a complexity score for a README.
Check scores of any repo in your browser: http://clayallsopp.github.io/readme-score
There's an HTTP API too!
Example score:
Installation
Add this line to your application's Gemfile:
gem 'readme-score'
And then execute:
$ bundle
Or install it yourself as:
$ gem install readme-score
Usage
Pass in a URL:
url = "https://raw.githubusercontent.com/AFNetworking/AFNetworking/master/README.md"
score = ReadmeScore.for(url)
score.total_score
# => 95
Pass in a Github Repo:
score = ReadmeScore.for("afnetworking/afnetworking")
score.total_score
# => 95
Pass in HTML:
html = "AFNetworking is a delightful networking library for iOS and Mac OS X...."
score = ReadmeScore.for(html)
score.total_score
# => 95
Configuration
Settings
-
ReadmeScore.use_github_api = <boolean>
- whether or not to use the Github API when loading a Github repo's readme. Iffalse
, will attempt to find the correct readme URL without the API (which could fail unexpectedly). Defaults totrue
-
ReadmeScore.github_api_token = <token>
- a token to use with the Github API. Supercedes the ENV variable.
Environment Variables
ENV | Description |
---|---|
READMESCORE_GITHUB_TOKEN | If scoring a Github repo, ReadmeScore will try to grab the canonical representation via the Github API. By default, unauthenticated requests are limited to 60/hour. Set this env variable to increase that limited to 5k/hour. |