A Ruby gem to cache and verify the licenses of dependencies
Перейти к файлу
Jon Ruskin 3ed3081c1b update manifest source
- simplifies local dependency class as a Licensee Project
- better license matching on source comments!
2019-01-03 14:10:59 -07:00
docker separate docker layer for pulling rubyc 2018-06-21 11:27:20 -07:00
docs set bundler source type as bundler 2018-12-31 12:18:13 -07:00
exe v1.0.0 2018-02-20 08:20:41 -07:00
lib update manifest source 2019-01-03 14:10:59 -07:00
script don't fail setup if go help mod fails 2018-12-27 12:45:20 -07:00
test update manifest source 2019-01-03 14:10:59 -07:00
.gitignore add go modules test fixture 2018-12-27 09:41:46 -07:00
.rubocop.yml exclude test fixtures and local gems 2018-04-05 10:17:31 -07:00
.ruby-version v1.0.0 2018-02-20 08:20:41 -07:00
.travis.yml add go 1.11.1 to travis CI 2018-12-27 10:31:15 -07:00
CHANGELOG.md prepare release 2018-12-27 13:01:10 -07:00
CODE_OF_CONDUCT.md v1.0.0 2018-02-20 08:20:41 -07:00
CONTRIBUTING.md docs 2018-06-20 18:00:52 -07:00
Gemfile v1.0.0 2018-02-20 08:20:41 -07:00
LICENSE v1.0.0 2018-02-20 08:20:41 -07:00
README.md set bundler source type as bundler 2018-12-31 12:18:13 -07:00
Rakefile move sources tests 2018-10-28 17:23:56 -07:00
licensed.gemspec remove remote fetching 2018-07-10 14:15:30 -07:00

README.md

Licensed

Licensed caches the licenses of dependencies and checks their status.

Licensed is available as a Ruby gem for Ruby environments, and as a self-contained executable for non-Ruby environments.

Licensed is not a complete open source license compliance solution. Please understand the important disclaimer below to make appropriate use of Licensed.

Current Status

Build Status

Licensed is in active development and currently used at GitHub. See the open issues for a list of potential work.

Installation

With a Gemfile

Add this line to your application's Gemfile:

gem 'licensed', :group => 'development'

And then execute:

$ bundle

As an executable

Download a package from GitHub and extract the executable. Executable packages are available for each release starting with version 1.2.0.

$ curl -sSL https://github.com/github/licensed/releases/download/<version>/licensed-<version>-<os>-x64.tar.gz > licensed.tar.gz
$ tar -xzf licensed.tar.gz
$ rm -f licensed.tar.gz
$ ./licensed list

For system wide usage, install licensed to a location on $PATH, e.g. /usr/local/bin.

Dependencies

Licensed uses the the libgit2 bindings for Ruby provided by rugged. rugged has its own dependencies - cmake and pkg-config - which you may need to install before you can install Licensed.

For example, on macOS with Homebrew: brew install cmake pkg-config and on Ubuntu: apt-get install cmake pkg-config.

Usage

  • licensed list: Output enumerated dependencies only.

  • licensed cache: Cache licenses and metadata.

  • licensed status: Check status of dependencies' cached licenses. For example:

$ bundle exec licensed status
Checking licenses for 3 dependencies

Warnings:

.licenses/bundler/bundler.txt:
  - license needs reviewed: mit.

.licenses/bundler/licensee.txt:
  - cached license data missing

.licenses/bower/jquery.txt:
  - license needs reviewed: mit.
  - cached license data out of date

3 dependencies checked, 3 warnings found.
  • licensed version: Show current installed version of Licensed. Aliases: -v|--version

Configuration

All commands, except version, accept a -c|--config option to specify a path to a configuration file or directory.

If a directory is specified, licensed will look in that directory for a file named (in order of preference):

  1. .licensed.yml
  2. .licensed.yaml
  3. .licensed.json

If the option is not specified, the value will be set to the current directory.

See the configuration file documentation for more details on the configuration format.

Sources

Dependencies will be automatically detected for all of the following sources by default.

  1. Bower (bower)
  2. Bundler
  3. Cabal (cabal)
  4. Go (go)
  5. Go Dep (dep)
  6. Manifest lists (manifests)
  7. NPM (npm)
  8. Pip (pip)
  9. Git Submodules (git_submodule)

You can disable any of them in the configuration file:

sources:
  bundler: false
  npm: false
  bower: false
  cabal: false

Development

To get started after checking out the repo, run

  1. script/bootstrap to install dependencies
  2. script/setup to setup test fixtures.
  • script/setup -f will force a clean test fixture environment
  1. script/cibuild to run the tests.

You can also run script/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Adding sources

When adding new dependency sources, ensure that script/bootstrap scripting and tests are only run if the required tooling is available on the development machine.

  • See script/bootstrap for examples of gating scripting based on whether tooling executables are found.
  • Use Licensed::Shell.tool_available? when writing test files to gate running a test suite when tooling executables aren't available.
if Licensed::Shell.tool_available?('bundle')
  describe Licensed::Source::Bundler do
    ...
  end
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/github/licensed. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct. See CONTRIBUTING for more details.

Disclaimer

Licensed is not a complete open source license compliance solution. Like any bug, licensing issues are far cheaper to fix if found early. Licensed is intended to provide automation around documenting the licenses of dependencies and whether they are configured to be allowed by a user of licensed, in other words, to surface the most obvious licensing issues early.

Licensed is not a substitute for human review of each dependency for licensing or any other issues. It is not the goal of Licensed or GitHub, Inc. to provide legal advice about licensing or any other issues. If you have any questions regarding licensing compliance for your code or any other legal issues relating to it, its up to you to do further research or consult with a professional.

License

The gem is available as open source under the terms of the MIT License.