A Ruby Gem to detect under what license a project is distributed.
A Ruby Gem to detect under what license a project is distributed.
A Ruby Gem to detect under what license a project is distributed.
Licensee automates the process of reading LICENSE files and compares their contents to known licenses using several strategies (which we call "Matchers"). It attempts to determine a project's license in the following order:
Copyright (c) 2015 Ben Balter), we'll assume the author intends to retain all rights, and thus the project isn't licensed.Special thanks to @vmg for his Git and algorithmic prowess.
To use the latest released gem from RubyGems:
gem install licenseeTo 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
bundle exec bin/licenseeOn Windows, the last line needs to include the Ruby interpreter:
bundle exec ruby bin\licenseeBy default, licensee scans projects using the filesystem. If you want to scan bare Git repositories or repositories without a working tree (e.g., on a Git server), install the rugged gem, which provides Ruby bindings for libgit2:
gem install ruggedOr add it to your Gemfile alongside licensee:
gem 'rugged'When rugged is available, Licensee.project will use it automatically. If rugged is not installed, licensee falls back to filesystem-based scanning transparently.
Note that rugged is a native extension and requires cmake and openssl to build. On most systems these are available via a package manager (e.g., apt install cmake libssl-dev or brew install cmake openssl).
Licensee also comes with a Dockerfile if you prefer to run Licensee within a Docker container:
git clone https://github.com/licensee/licensee && cd licenseedocker build . --tag licenseedocker run licensee [COMMAND] (see command line usage)See the docs folder for more information. You may be interested in:
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'No open issues yet, or sync has not completed.