Go to file
Ben Balter 904c5a0f1c Rename CODE_OF_CONDUCT.md to docs/CODE_OF_CONDUCT.md 2017-06-01 14:20:30 -04:00
.github Create stale.yml 2017-04-06 13:25:22 -04:00
bin fix rubocop offenses 2016-09-25 12:35:54 -04:00
docs Rename CODE_OF_CONDUCT.md to docs/CODE_OF_CONDUCT.md 2017-06-01 14:20:30 -04:00
lib Bump to 8.9.0 2017-05-24 10:50:27 -04:00
script add integration tests 2016-09-25 19:41:34 -04:00
spec Address review comments 2017-05-01 09:34:08 -04:00
vendor/choosealicense.com update vendored licenses 2017-05-24 10:44:32 -04:00
.bowerrc initial commit 2014-08-16 12:39:40 -04:00
.coveralls.yml add coveralls 2016-09-25 19:56:53 -04:00
.gitignore expose license rules 2016-11-11 15:02:45 -05:00
.rspec convert tests to rspec 2016-09-25 18:42:36 -04:00
.rubocop.yml anchor cc-by-nd false positive detection to start of line, not start of file 2017-03-30 15:32:31 -04:00
.travis.yml Merge branch 'master' into ncndignore 2017-02-21 12:00:16 -05:00
Gemfile drop active support 2016-12-27 15:09:50 -05:00
LICENSE.md fix license encoding 2016-09-25 18:33:13 -04:00
licensee.gemspec fix rubocop offenses and drop Ruby < 2.1 support 2017-01-22 13:38:41 -05:00

docs/README.md

Licensee

A Ruby Gem to detect under what license a project is distributed.

Build Status Gem Version Coverage Status

The problem

  • You've got an open source project. How do you know what you can and can't do with the software?
  • You've got a bunch of open source projects, how do you know what their licenses are?
  • You've got a project with a license file, but which license is it? Has it been modified?

The solution

Licensee automates the process of reading LICENSE files and compares their contents to known licenses using a several strategies (which we call "Matchers"). It attempts to determine a project's license in the following order:

  • If the license file has an explicit copyright notice, and nothing more (e.g., Copyright (c) 2015 Ben Balter), we'll assume the author intends to retain all rights, and thus the project isn't licensed.
  • If the license is an exact match to a known license. If we strip away whitespace and copyright notice, we might get lucky, and direct string comparison in Ruby is cheap.
  • If we still can't match the license, we use a fancy math thing called the SørensenDice coefficient, which is really good at calculating the similarity between two strings. By calculating the percent changed from the known license to the license file, you can tell, e.g., that a given license is 95% similar to the MIT license, that 5% likely representing legally insignificant changes to the license text.

Special thanks to @vmg for his Git and algorithmic prowess.

Installation

gem install licensee or add gem 'licensee' to your project's Gemfile.

Documentation

See the docs folder for more information. You may be interested in:

Semantic Versioning

This project conforms to semver. As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision. For example:

spec.add_dependency 'licensee', '~> 1.0'

This means your project is compatible with licensee 1.0 up until 2.0. You can also set a higher minimum version:

spec.add_dependency 'licensee', '~> 1.1'