Gem-Licenses
Gem-licenses is an attempt to collect license information from a project's gems. Similar to 3licenses.
Motivation
The overwhelming majority of third-party licenses require the application that uses them to reproduce the license verbatim in an artifact that is installed with the application itself. For instance, the BSD license states the following.
“Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.”
Are you currently copying individual license.txt files "by hand" or are you including license text in your documentation with copy/paste? This project aims at improving this situation.
Usage
Include gem-licenses in your project's Gemfile.
group :development, :test do
gem 'gem-licenses'
endRails applications load the Rake tasks automatically. In other projects, load them in your Rakefile. This makes the tasks available each time Rake runs and doesn't copy any files into your project.
require 'rake'
require 'gem-licenses'
Gem::GemLicenses.install_tasksTo list licenses try the following Rake task.
rake gem:licensesTo write a CSV file of gems and licenses.
rake gem:licenses:csv['licenses.csv']To write a CSV file of gems, licenses, and the copyright lines found in each gem's license, notice, and readme files.
rake gem:licenses:copyrights:csv['copyrights.csv']Command Line
The gem-licenses command reports on a project's bundle without changing its Rakefile. Run it under bundle exec when gem-licenses is in the Gemfile, or install the gem and point it at a project.
bundle exec gem-licenses
gem-licenses --gemfile path/to/Gemfile
gem-licenses --csv licenses.csvWithout --gemfile, it reads the bundle that BUNDLE_GEMFILE or the Gemfile in the current directory describes, whose gems must be installed. Pass --strict to exit with status 1 when a gem has no guessable license, for example in CI. Run gem-licenses --help for all options.
Contributing
See CONTRIBUTING, CHANGELOG, and RELEASING.
License
This project is licensed under the MIT license, see LICENSE for details.
Copyright
Copyright (c) Daniel Doubrovkine, 2011-2016, Artsy, Inc.