Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

licensee

> 编程语言
Open source

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

903 stars0 likes1 views
WebsiteGitHub

About

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

Licensee

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

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 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ørensen–Dice 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
bundle exec bin/licensee

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

bundle exec ruby bin\licensee

Git repository scanning (optional)

By 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 rugged

Or add it to your Gemfile alongside licensee:

ruby
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).

Docker

Licensee also comes with a Dockerfile if you prefer to run Licensee within a Docker container:

  1. git clone https://github.com/licensee/licensee && cd licensee
  2. docker build . --tag licensee
  3. docker run licensee [COMMAND] (see command line usage)

Documentation

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

  • Instructions for using Licensee
  • Customizing Licensee's behavior
  • Contributing to Licensee (and development instructions)
  • More information about what Licensee looks at (or doesn't, and why)

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:

ruby
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:

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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rubylawlegallicensingopen-source

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言