Coder Social home page Coder Social logo

sepatus88 / licensee Goto Github PK

View Code? Open in Web Editor NEW

This project forked from licensee/licensee

0.0 2.0 1.0 1.16 MB

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

Home Page: https://github.com/sepatus/licensee.git

License: Other

Ruby 98.89% Shell 1.11%

licensee's Introduction

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ø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 --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'

licensee's People

Contributors

andrew avatar antn avatar arfon avatar aroben avatar benbalter avatar bkeepers avatar connorshea avatar edwardbetts avatar hroncok avatar hyandell avatar jdmaturen avatar jimhester avatar jonabc avatar jontro avatar juanitofatas avatar justinclift avatar maxbrito avatar mislav avatar mlinksva avatar n7s avatar narendasan avatar pablrod avatar pchaigno avatar pravi avatar sepatus88 avatar sschuberth avatar talisein avatar vmg avatar waldyrious avatar wking avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.