licensee/docs
Mike Linksvayer fc40fd0c86
Merge branch 'master' into manufacture-source
2018-08-06 23:39:54 +00:00
..
CODE_OF_CONDUCT.md Rename CODE_OF_CONDUCT.md to docs/CODE_OF_CONDUCT.md 2017-06-01 14:20:30 -04:00
CONTRIBUTING.md Update docs/CONTRIBUTING.md 2018-03-29 16:35:15 -04:00
README.md Update README.md 2018-04-15 02:30:12 +02:00
SUPPORT.md disambiguate support 2017-07-17 10:38:15 -04:00
_config.yml Remove description from _config.yml 2017-08-11 11:37:42 -04:00
command-line-usage.md document command-line usage 2018-02-06 12:22:05 -05:00
customizing.md update to new default confidence threshold 2018-04-07 19:58:26 -07:00
usage.md update docs 2018-08-06 16:39:22 -07:00
what-we-look-at.md parenthetical to note why project is emphasized 2018-07-16 11:38:52 -07:00

README.md

Licensee

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

Build Status Gem Version Coverage Status PRs Welcome

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

To use the latest released gem from RubyGems:

gem install licensee

To use licensee programmatically in your own Ruby project, add gem 'licensee' to your project's Gemfile.

To run licensee directly from source:

gem install bundler
bundle install --path vendor/bundle
bundle exec bin/licensee

On Windows, the last line needs to include the Ruby interpreter:

bundle exec ruby bin\licensee

In a Docker Debian Stretch container, minimum dependencies are:

apt-get install -y ruby bundler cmake pkg-config git libssl-dev

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'