Merge branch 'master' into master

This commit is contained in:
Mike Linksvayer 2018-07-16 18:32:41 +00:00 committed by GitHub
commit d811a940f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 251 additions and 72 deletions

28
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
---
### Describe the bug
A clear and concise description of what the bug is.
### Steps to reproduce the behavior
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
### Expected behavior
A clear and concise description of what you expected to happen.
### Screenshots
If applicable, add screenshots to help explain your problem.
### Additional context
Add any other context about the problem here.

View File

@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest an idea for this project
---
### Is your feature request related to a problem? Please describe the problem you're trying to solve.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
Add any other context or screenshots about the feature request here.

5
.github/config.yml vendored
View File

@ -1,6 +1,6 @@
# Behaviorbot config. See https://github.com/behaviorbot/ for more information. # Behaviorbot config. See https://github.com/behaviorbot/ for more information.
# Note: Please Don't edit this file directly. # Note: Please Don't edit this file directly.
# Edit https://github.com/benbalter/behaviorbot-config instead. # Edit https://github.com/benbalter/shared-community-files instead.
# Configuration for update-docs - https://github.com/behaviorbot/update-docs # Configuration for update-docs - https://github.com/behaviorbot/update-docs
updateDocsComment: "Thanks for the pull request! If you are making any changes to the user-facing functionality, please be sure to update the documentation in the `README` or `docs/` folder alongside your change. :heart:" updateDocsComment: "Thanks for the pull request! If you are making any changes to the user-facing functionality, please be sure to update the documentation in the `README` or `docs/` folder alongside your change. :heart:"
@ -18,3 +18,6 @@ newPRWelcomeComment: Welcome! Congrats on your first pull request to Licensee. I
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
firstPRMergeComment: "Congrats on getting your first pull request to Licensee merged! Without amazing humans like you submitting pull requests, we couldnt run this project. You rock! :tada:<br /><br />If you're interested in tackling another bug or feature, take a look at [the open issues](https://github.com/benbalter/licensee/issues), especially those [labeled `help wanted`](https://github.com/benbalter/licensee/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)." firstPRMergeComment: "Congrats on getting your first pull request to Licensee merged! Without amazing humans like you submitting pull requests, we couldnt run this project. You rock! :tada:<br /><br />If you're interested in tackling another bug or feature, take a look at [the open issues](https://github.com/benbalter/licensee/issues), especially those [labeled `help wanted`](https://github.com/benbalter/licensee/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)."
# Bug workaround
contact_links: []

View File

@ -1,4 +1,6 @@
# Configuration for probot-no-response - https://github.com/probot/no-response # Configuration for probot-no-response - https://github.com/probot/no-response
# Note: Please Don't edit this file directly.
# Edit https://github.com/benbalter/shared-community-files instead.
# Number of days of inactivity before an Issue is closed for lack of response # Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14 daysUntilClose: 14

4
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,4 @@
template: |
## What's Changed
$CHANGES

View File

@ -1,4 +1,6 @@
# Repository settings set via https://github.com/probot/settings # Repository settings set via https://github.com/probot/settings
# Note: Please Don't edit this file directly.
# Edit https://github.com/benbalter/shared-community-files instead.
repository: repository:
has_issues: true has_issues: true

2
.github/stale.yml vendored
View File

@ -1,4 +1,6 @@
# Configuration for probot-stale - https://github.com/probot/stale # Configuration for probot-stale - https://github.com/probot/stale
# Note: Please Don't edit this file directly.
# Edit https://github.com/benbalter/shared-community-files instead.
# Number of days of inactivity before an Issue or Pull Request becomes stale # Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60 daysUntilStale: 60

View File

@ -17,7 +17,7 @@ Metrics/BlockLength:
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false
Lint/EndAlignment: Layout/EndAlignment:
EnforcedStyleAlignWith: variable EnforcedStyleAlignWith: variable
AutoCorrect: true AutoCorrect: true
@ -36,6 +36,9 @@ Metrics/AbcSize:
Layout/IndentHeredoc: Layout/IndentHeredoc:
Enabled: false Enabled: false
Layout/ClosingHeredocIndentation:
Enabled: false
Style/StructInheritance: Style/StructInheritance:
Enabled: false Enabled: false

View File

@ -1,10 +1,8 @@
language: ruby language: ruby
rvm: rvm:
- 2.1 - 2.3
- 2.2 - 2.4
- 2.3.3 - 2.5
- 2.4.0
- 2.5.0
script: "script/cibuild" script: "script/cibuild"
sudo: false sudo: false
cache: bundler cache: bundler

View File

@ -31,7 +31,7 @@ class LicenseeCLI < Thor
end end
end end
commands_dir = File.expand_path 'lib/licensee/commands/' commands_dir = File.expand_path '../lib/licensee/commands/', __dir__
Dir["#{commands_dir}/*.rb"].each { |c| require(c) } Dir["#{commands_dir}/*.rb"].each { |c| require(c) }
LicenseeCLI.start(ARGV) LicenseeCLI.start(ARGV)

View File

@ -46,7 +46,6 @@ To check if Licensee itself can properly detect a license, please:
1. Clone the repository locally `git clone https://github.com/benbalter/licensee` 1. Clone the repository locally `git clone https://github.com/benbalter/licensee`
2. `script/bootstrap` 2. `script/bootstrap`
3. `script/git-repo [URL to your repository]` 3. `script/git-repo [URL to your repository]`
4. Alternate to (3) if you know the license you expect, you can ask Licensee to show you how the license file in your repository differs, e.g., if you expected Licensee to be under the ISC License: `bundle exec bin/licensee detect https://github.com/benbalter/licensee --remote --license=isc`
If Licensee cannot detect the license locally, [open an issue](https://github.com/benbalter/licensee/issues/new) and include the output of `script/git-repo`. If Licensee cannot detect the license locally, [open an issue](https://github.com/benbalter/licensee/issues/new) and include the output of `script/git-repo`.

View File

@ -39,6 +39,12 @@ On Windows, the last line needs to include the Ruby interpreter:
bundle exec ruby bin\licensee 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 ## Documentation
See [the docs folder](/docs) for more information. You may be interested in: See [the docs folder](/docs) for more information. You may be interested in:

View File

@ -2,11 +2,11 @@
### Adjusting the confidence threshold ### Adjusting the confidence threshold
If you'd like, you can make Licensee less stringent in its comparison, but risk getting false positives as a result. The confidence threshold is an integer between 1 and 100, with the default being 95, meaning that License is at least 95% confident that the file represents the matched license. If you'd like, you can make Licensee less stringent in its comparison, but risk getting false positives as a result. The confidence threshold is an integer between 1 and 100, with the default being 98, meaning that License is at least 98% confident that the file represents the matched license.
```ruby ```ruby
LICENSEE.confidence_threshold LICENSEE.confidence_threshold
=> 95 => 98
LICENSEE.confidence_threshold = 90 LICENSEE.confidence_threshold = 90
=> 90 => 90

View File

@ -1,7 +1,6 @@
require_relative 'licensee/version' require_relative 'licensee/version'
require 'forwardable' require 'forwardable'
require 'pathname' require 'pathname'
require 'rugged'
require 'yaml' require 'yaml'
module Licensee module Licensee

View File

@ -21,12 +21,12 @@ class LicenseeCLI < Thor
rows = [] rows = []
rows << if project.license rows << if project.license
['License:', project.license.name] ['License:', project.license.spdx_id]
elsif !project.licenses.empty? elsif !project.licenses.empty?
['Licenses:', project.licenses.map(&:name)] ['Licenses:', project.licenses.map(&:spdx_id)]
else else
['License:', set_color('None', :red)] ['License:', set_color('None', :red)]
end end
unless project.matched_files.empty? unless project.matched_files.empty?
rows << ['Matched files:', project.matched_files.map(&:filename).join(', ')] rows << ['Matched files:', project.matched_files.map(&:filename).join(', ')]
@ -51,7 +51,7 @@ class LicenseeCLI < Thor
licenses = licenses_by_similiarity(matched_file) licenses = licenses_by_similiarity(matched_file)
next if licenses.empty? next if licenses.empty?
say ' Closest licenses:' say ' Closest non-matching licenses:'
rows = licenses[0...3].map do |license, similarity| rows = licenses[0...3].map do |license, similarity|
spdx_id = license.meta['spdx-id'] spdx_id = license.meta['spdx-id']
percent = Licensee::ContentHelper.format_percent(similarity) percent = Licensee::ContentHelper.format_percent(similarity)
@ -77,7 +77,7 @@ class LicenseeCLI < Thor
def humanize(value, type = nil) def humanize(value, type = nil)
case type case type
when :license when :license
value.name value.spdx_id
when :matcher when :matcher
value.class value.class
when :confidence when :confidence

View File

@ -82,6 +82,7 @@ module Licensee
string, _partition, _instructions = string.partition(END_OF_TERMS_REGEX) string, _partition, _instructions = string.partition(END_OF_TERMS_REGEX)
string = strip_markup(string) string = strip_markup(string)
string = normalize_quotes(string) string = normalize_quotes(string)
string = normalize_https(string)
strip_whitespace(string) strip_whitespace(string)
end end
@ -178,5 +179,9 @@ module Licensee
def normalize_quotes(string) def normalize_quotes(string)
string.gsub(/\s'([\w -]*?\w)'/, ' "\1"') string.gsub(/\s'([\w -]*?\w)'/, ' "\1"')
end end
def normalize_https(string)
string.gsub(/http:/, 'https:')
end
end end
end end

View File

@ -117,9 +117,15 @@ module Licensee
@meta ||= LicenseMeta.from_yaml(yaml) @meta ||= LicenseMeta.from_yaml(yaml)
end end
def spdx_id
return meta.spdx_id if meta.spdx_id
return 'NOASSERTION' if key == 'other'
return 'NONE' if key == 'no-license'
end
# Returns the human-readable license name # Returns the human-readable license name
def name def name
title ? title : key.capitalize title || spdx_id
end end
def name_without_version def name_without_version

View File

@ -5,7 +5,7 @@ module Licensee
# rubocop:disable Metrics/LineLength # rubocop:disable Metrics/LineLength
COPYRIGHT_SYMBOLS = Regexp.union([/copyright/i, /\(c\)/i, "\u00A9", "\xC2\xA9"]) COPYRIGHT_SYMBOLS = Regexp.union([/copyright/i, /\(c\)/i, "\u00A9", "\xC2\xA9"])
REGEX = /\A\s*#{COPYRIGHT_SYMBOLS}.*$/i REGEX = /\A(\s*#{COPYRIGHT_SYMBOLS}.*$)+/i
# rubocop:enable Metrics/LineLength # rubocop:enable Metrics/LineLength
def match def match

View File

@ -54,6 +54,7 @@ module Licensee
def attribution def attribution
@attribution ||= begin @attribution ||= begin
return unless copyright? || license.content =~ /\[fullname\]/
matches = Matchers::Copyright::REGEX matches = Matchers::Copyright::REGEX
.match(content_without_title_and_version) .match(content_without_title_and_version)
matches[0] if matches matches[0] if matches

View File

@ -67,7 +67,7 @@ module Licensee
alias path filename alias path filename
def matched_license def matched_license
license.key if license license.spdx_id if license
end end
# Is this file a COPYRIGHT file with only a copyright statement? # Is this file a COPYRIGHT file with only a copyright statement?

View File

@ -5,6 +5,9 @@
# Project files for this project type will contain the following keys: # Project files for this project type will contain the following keys:
# :name - the file's path relative to the repo root # :name - the file's path relative to the repo root
# :oid - the file's OID # :oid - the file's OID
autoload :Rugged, 'rugged'
module Licensee module Licensee
module Projects module Projects
class GitProject < Licensee::Projects::Project class GitProject < Licensee::Projects::Project

View File

@ -5,7 +5,7 @@
# Only the root directory of a repository will be scanned because every # Only the root directory of a repository will be scanned because every
# `#load_file(..)` call incurs a separate API request. # `#load_file(..)` call incurs a separate API request.
require 'octokit' autoload :Octokit, 'octokit'
module Licensee module Licensee
module Projects module Projects

View File

@ -1,3 +1,3 @@
module Licensee module Licensee
VERSION = '9.9.0.beta.2'.freeze VERSION = '9.9.1'.freeze
end end

View File

@ -31,7 +31,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency('rubocop', '~> 0.49') gem.add_development_dependency('rubocop', '~> 0.49')
gem.add_development_dependency('webmock', '~> 3.1') gem.add_development_dependency('webmock', '~> 3.1')
gem.required_ruby_version = '>= 2.1' gem.required_ruby_version = '> 2.2'
# ensure the gem is built out of versioned files # ensure the gem is built out of versioned files
gem.files = Dir[ gem.files = Dir[

View File

@ -94,18 +94,18 @@
"name": "exact", "name": "exact",
"confidence": 100 "confidence": 100
}, },
"matched_license": "mit" "matched_license": "MIT"
}, },
{ {
"filename": "licensee.gemspec", "filename": "licensee.gemspec",
"content": "require File.expand_path('lib/licensee/version', __dir__)\n\nGem::Specification.new do |gem|\n gem.name = 'licensee'\n gem.version = Licensee::VERSION\n\n gem.summary = 'A Ruby Gem to detect open source project licenses'\n gem.description = <<-DESC\n Licensee automates the process of reading LICENSE files and\n compares their contents to known licenses using a fancy maths.\n DESC\n\n gem.authors = ['Ben Balter']\n gem.email = 'ben.balter@github.com'\n gem.homepage = 'https://github.com/benbalter/licensee'\n gem.license = 'MIT'\n\n gem.bindir = 'bin'\n gem.executables << 'licensee'\n\n gem.add_dependency('dotenv', '~> 2.0')\n gem.add_dependency('octokit', '~> 4.8.0')\n gem.add_dependency('rugged', '~> 0.24')\n gem.add_dependency('thor', '~> 0.19')\n\n gem.add_development_dependency('coveralls', '~> 0.8')\n gem.add_development_dependency('mustache', '>= 0.9', '< 2.0')\n gem.add_development_dependency('pry', '~> 0.9')\n gem.add_development_dependency('rake', '~> 10.3')\n gem.add_development_dependency('rspec', '~> 3.5')\n gem.add_development_dependency('rubocop', '~> 0.49')\n gem.add_development_dependency('webmock', '~> 3.1')\n\n gem.required_ruby_version = '>= 2.1'\n\n # ensure the gem is built out of versioned files\n gem.files = Dir[\n 'Rakefile',\n '{bin,lib,man,test,vendor,spec}/**/*',\n 'README*', 'LICENSE*'\n ] & `git ls-files -z`.split(\"\\0\")\nend\n", "content": "require File.expand_path('lib/licensee/version', __dir__)\n\nGem::Specification.new do |gem|\n gem.name = 'licensee'\n gem.version = Licensee::VERSION\n\n gem.summary = 'A Ruby Gem to detect open source project licenses'\n gem.description = <<-DESC\n Licensee automates the process of reading LICENSE files and\n compares their contents to known licenses using a fancy maths.\n DESC\n\n gem.authors = ['Ben Balter']\n gem.email = 'ben.balter@github.com'\n gem.homepage = 'https://github.com/benbalter/licensee'\n gem.license = 'MIT'\n\n gem.bindir = 'bin'\n gem.executables << 'licensee'\n\n gem.add_dependency('dotenv', '~> 2.0')\n gem.add_dependency('octokit', '~> 4.8.0')\n gem.add_dependency('rugged', '~> 0.24')\n gem.add_dependency('thor', '~> 0.19')\n\n gem.add_development_dependency('coveralls', '~> 0.8')\n gem.add_development_dependency('mustache', '>= 0.9', '< 2.0')\n gem.add_development_dependency('pry', '~> 0.9')\n gem.add_development_dependency('rake', '~> 10.3')\n gem.add_development_dependency('rspec', '~> 3.5')\n gem.add_development_dependency('rubocop', '~> 0.49')\n gem.add_development_dependency('webmock', '~> 3.1')\n\n gem.required_ruby_version = '> 2.2'\n\n # ensure the gem is built out of versioned files\n gem.files = Dir[\n 'Rakefile',\n '{bin,lib,man,test,vendor,spec}/**/*',\n 'README*', 'LICENSE*'\n ] & `git ls-files -z`.split(\"\\0\")\nend\n",
"content_hash": null, "content_hash": null,
"content_normalized": null, "content_normalized": null,
"matcher": { "matcher": {
"name": "gemspec", "name": "gemspec",
"confidence": 90 "confidence": 90
}, },
"matched_license": "mit" "matched_license": "MIT"
} }
] ]
} }

View File

@ -13,19 +13,19 @@ RSpec.describe 'detect command' do
let(:hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' } let(:hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' }
let(:expected) do let(:expected) do
{ {
'License' => 'MIT License', 'License' => 'MIT',
'Matched files' => 'LICENSE.md, licensee.gemspec', 'Matched files' => 'LICENSE.md, licensee.gemspec',
'LICENSE.md' => { 'LICENSE.md' => {
'Content hash' => hash, 'Content hash' => hash,
'Attribution' => 'Copyright (c) 2014-2017 Ben Balter', 'Attribution' => 'Copyright (c) 2014-2017 Ben Balter',
'Confidence' => '100.00%', 'Confidence' => '100.00%',
'Matcher' => 'Licensee::Matchers::Exact', 'Matcher' => 'Licensee::Matchers::Exact',
'License' => 'MIT License' 'License' => 'MIT'
}, },
'licensee.gemspec' => { 'licensee.gemspec' => {
'Confidence' => '90.00%', 'Confidence' => '90.00%',
'Matcher' => 'Licensee::Matchers::Gemspec', 'Matcher' => 'Licensee::Matchers::Gemspec',
'License' => 'MIT License' 'License' => 'MIT'
} }
} }
end end

View File

@ -25,7 +25,7 @@ RSpec.describe Licensee::ContentHelper do
This license provided 'as is'. Please respect the contributors' wishes when This license provided 'as is'. Please respect the contributors' wishes when
implementing the license's "software". implementing the license's "software".
----------- -----------
LICENSE LICENSE
end end
subject { ContentHelperTestHelper.new(content) } subject { ContentHelperTestHelper.new(content) }
let(:mit) { Licensee::License.find('mit') } let(:mit) { Licensee::License.find('mit') }
@ -103,6 +103,12 @@ LICENSE
expect(license.content_normalized).to_not include('* *') expect(license.content_normalized).to_not include('* *')
end end
it 'normalizes http: to https:' do
license = Licensee::License.find('mpl-2.0')
expect(license.content).to include('http:')
expect(license.content_normalized).to_not include('http:')
end
it 'wraps' do it 'wraps' do
lines = mit.content_normalized(wrap: 40).split("\n") lines = mit.content_normalized(wrap: 40).split("\n")
expect(lines.first.length).to be <= 40 expect(lines.first.length).to be <= 40

View File

@ -1,6 +1,6 @@
RSpec.describe Licensee::License do RSpec.describe Licensee::License do
let(:license_count) { 35 } let(:license_count) { 36 }
let(:hidden_license_count) { 23 } let(:hidden_license_count) { 24 }
let(:featured_license_count) { 3 } let(:featured_license_count) { 3 }
let(:pseudo_license_count) { 2 } let(:pseudo_license_count) { 2 }
let(:non_featured_license_count) do let(:non_featured_license_count) do
@ -11,6 +11,7 @@ RSpec.describe Licensee::License do
let(:cc_by) { described_class.find('cc-by-4.0') } let(:cc_by) { described_class.find('cc-by-4.0') }
let(:unlicense) { described_class.find('unlicense') } let(:unlicense) { described_class.find('unlicense') }
let(:other) { described_class.find('other') } let(:other) { described_class.find('other') }
let(:no_license) { described_class.find('no-license') }
let(:gpl) { described_class.find('gpl-3.0') } let(:gpl) { described_class.find('gpl-3.0') }
let(:lgpl) { described_class.find('lgpl-3.0') } let(:lgpl) { described_class.find('lgpl-3.0') }
let(:content_hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' } let(:content_hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' }
@ -168,6 +169,11 @@ RSpec.describe Licensee::License do
expect(gpl.spdx_id).to eql('GPL-3.0') expect(gpl.spdx_id).to eql('GPL-3.0')
end end
it 'exposes special SPDX ID for pseudo licenses' do
expect(other.spdx_id).to eql('NOASSERTION')
expect(no_license.spdx_id).to eql('NONE')
end
context '#other?' do context '#other?' do
it 'knows MIT is not other' do it 'knows MIT is not other' do
expect(gpl).to_not be_other expect(gpl).to_not be_other
@ -195,7 +201,7 @@ RSpec.describe Licensee::License do
end end
it 'uses the default name when none exists' do it 'uses the default name when none exists' do
expect(other.name).to eql('Other') expect(other.name).to eql('NOASSERTION')
end end
it 'expoeses the nickname' do it 'expoeses the nickname' do

View File

@ -26,7 +26,8 @@ RSpec.describe Licensee::Matchers::Copyright do
'Comma-separated date' => 'Copyright (c) 2003, 2004 Ben Balter', 'Comma-separated date' => 'Copyright (c) 2003, 2004 Ben Balter',
'Hyphen-separated date' => 'Copyright (c) 2003-2004 Ben Balter', 'Hyphen-separated date' => 'Copyright (c) 2003-2004 Ben Balter',
'ASCII-8BIT encoded' => "Copyright \xC2\xA92015 Ben Balter`", 'ASCII-8BIT encoded' => "Copyright \xC2\xA92015 Ben Balter`",
'No year' => 'Copyright Ben Balter' 'No year' => 'Copyright Ben Balter',
'Multiline' => "Copyright Ben Balter\nCopyright Another Entity"
.force_encoding('ASCII-8BIT') .force_encoding('ASCII-8BIT')
}.each do |description, notice| }.each do |description, notice|
context "with a #{description} notice" do context "with a #{description} notice" do

View File

@ -1,5 +1,6 @@
RSpec.describe Licensee::ProjectFiles::LicenseFile do RSpec.describe Licensee::ProjectFiles::LicenseFile do
let(:filename) { 'LICENSE.txt' } let(:filename) { 'LICENSE.txt' }
let(:gpl) { Licensee::License.find('gpl-3.0') }
let(:mit) { Licensee::License.find('mit') } let(:mit) { Licensee::License.find('mit') }
let(:content) { sub_copyright_info(mit) } let(:content) { sub_copyright_info(mit) }
let(:content_hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' } let(:content_hash) { '46cdc03462b9af57968df67b450cc4372ac41f53' }
@ -26,6 +27,23 @@ RSpec.describe Licensee::ProjectFiles::LicenseFile do
end end
end end
context 'with a non-templated license' do
let(:content) { sub_copyright_info(gpl) }
it "doesn't match" do
expect(subject.attribution).to be_nil
end
end
context 'with a copyright file' do
let(:filename) { 'COPYRIGHT' }
let(:content) { 'Copyright (C) 2015 Ben Balter' }
it "doesn't match" do
expect(subject.attribution).to eql(content)
end
end
it 'creates the wordset' do it 'creates the wordset' do
expect(subject.wordset.count).to eql(91) expect(subject.wordset.count).to eql(91)
expect(subject.wordset.first).to eql('permission') expect(subject.wordset.first).to eql('permission')
@ -215,7 +233,6 @@ Creative Commons Attribution-NonCommercial 4.0
end end
context 'GPL' do context 'GPL' do
let(:gpl) { Licensee::License.find('gpl-3.0') }
let(:content) { sub_copyright_info(gpl) } let(:content) { sub_copyright_info(gpl) }
it 'knows its GPL' do it 'knows its GPL' do

View File

@ -56,7 +56,7 @@ RSpec.describe Licensee::ProjectFiles::ProjectFile do
name: :exact, name: :exact,
confidence: 100 confidence: 100
}, },
matched_license: 'mit' matched_license: 'MIT'
} }
end end

View File

@ -2,7 +2,7 @@ RSpec.describe Licensee do
let(:project_path) { fixture_path('mit') } let(:project_path) { fixture_path('mit') }
let(:license_path) { fixture_path('mit/LICENSE.txt') } let(:license_path) { fixture_path('mit/LICENSE.txt') }
let(:mit_license) { Licensee::License.find('mit') } let(:mit_license) { Licensee::License.find('mit') }
let(:hidden_license_count) { 35 } let(:hidden_license_count) { 36 }
it 'exposes licenses' do it 'exposes licenses' do
expect(described_class.licenses).to be_an(Array) expect(described_class.licenses).to be_an(Array)

View File

@ -2,11 +2,11 @@
# The available fields are: # The available fields are:
- name: title - name: title
description: The license full name specified by http://spdx.org/licenses/ description: The license full name specified by https://spdx.org/licenses/
required: true required: true
- name: spdx-id - name: spdx-id
description: Short identifier specified by http://spdx.org/licenses/ description: Short identifier specified by https://spdx.org/licenses/
required: true required: true
- name: source - name: source
@ -44,7 +44,7 @@
required: false required: false
- name: hidden - name: hidden
description: Whether the license is neither [popular](https://opensource.org/licenses) nor fills out the [spectrum of licenses](http://choosealicense.com/licenses/) from strongly conditional to unconditional (defaults to true) description: Whether the license is neither [popular](https://opensource.org/licenses) nor fills out the [spectrum of licenses](https://choosealicense.com/licenses/) from strongly conditional to unconditional (defaults to true)
required: false required: false
- name: nickname - name: nickname

View File

@ -13,8 +13,8 @@ how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of
note: The Apache Foundation recommends taking the additional step of adding a boilerplate notice to the header of each source file. You can find the notice at the very end of the license in the appendix. note: The Apache Foundation recommends taking the additional step of adding a boilerplate notice to the header of each source file. You can find the notice at the very end of the license in the appendix.
using: using:
- Elasticsearch: https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt
- Kubernetes: https://github.com/kubernetes/kubernetes/blob/master/LICENSE - Kubernetes: https://github.com/kubernetes/kubernetes/blob/master/LICENSE
- PDF.js: https://github.com/mozilla/pdf.js/blob/master/LICENSE
- Swift: https://github.com/apple/swift/blob/master/LICENSE.txt - Swift: https://github.com/apple/swift/blob/master/LICENSE.txt
permissions: permissions:

View File

@ -2,7 +2,7 @@
title: Artistic License 2.0 title: Artistic License 2.0
spdx-id: Artistic-2.0 spdx-id: Artistic-2.0
redirect_from: /licenses/artistic/ redirect_from: /licenses/artistic/
source: http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt source: https://spdx.org/licenses/Artistic-2.0.html
description: Heavily favored by the Perl community, the Artistic license requires that modified versions of the software do not prevent users from running the standard version. description: Heavily favored by the Perl community, the Artistic license requires that modified versions of the software do not prevent users from running the standard version.

View File

@ -7,7 +7,7 @@ description: A simple permissive license only requiring preservation of copyrigh
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file.
note: Boost recommends taking the additional step of adding a boilerplate notice to the top of each file. The boilerplate can be found at the [Boost Software License FAQ](http://www.boost.org/users/license.html#FAQ). note: Boost recommends taking the additional step of adding a boilerplate notice to the top of each file. The boilerplate can be found at the [Boost Software License FAQ](https://www.boost.org/users/license.html#FAQ).
using: using:

View File

@ -1,5 +1,5 @@
--- ---
title: Creative Commons Attribution 4.0 title: Creative Commons Attribution 4.0 International
spdx-id: CC-BY-4.0 spdx-id: CC-BY-4.0
source: https://creativecommons.org/licenses/by/4.0/legalcode.txt source: https://creativecommons.org/licenses/by/4.0/legalcode.txt

View File

@ -1,5 +1,5 @@
--- ---
title: Creative Commons Attribution Share Alike 4.0 title: Creative Commons Attribution Share Alike 4.0 International
spdx-id: CC-BY-SA-4.0 spdx-id: CC-BY-SA-4.0
source: https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt source: https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt

View File

@ -1,7 +1,7 @@
--- ---
title: European Union Public License 1.2 title: European Union Public License 1.2
spdx-id: EUPL-1.2 spdx-id: EUPL-1.2
source: http://eur-lex.europa.eu/legal-content/TXT/?uri=CELEX%3A32017D0863 source: https://eur-lex.europa.eu/legal-content/TXT/?uri=CELEX%3A32017D0863
description: The European Union Public Licence (EUPL) is a copyleft free/open source software license created on the initiative of and approved by the European Commission in 22 official languages of the European Union. description: The European Union Public Licence (EUPL) is a copyleft free/open source software license created on the initiative of and approved by the European Commission in 22 official languages of the European Union.
@ -127,7 +127,7 @@ limitations thereto.
The grant of the rights mentioned above is subject to some restrictions and The grant of the rights mentioned above is subject to some restrictions and
obligations imposed on the Licensee. Those obligations are the following: obligations imposed on the Licensee. Those obligations are the following:
Attribution right: The Licensee shall keep intact all copyright, patent or Attribution right: The Licensee shall keep intact all copyright, patent or
trademarks notices and all notices that refer to the Licence and to the trademarks notices and all notices that refer to the Licence and to the
disclaimer of warranties. The Licensee must include a copy of such notices and disclaimer of warranties. The Licensee must include a copy of such notices and

View File

@ -8,7 +8,7 @@ description: The University of Illinois/NCSA Open Source License, or UIUC licens
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders. Replace [project] with the project organization, if any, that sponsors this work. how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders. Replace [project] with the project organization, if any, that sponsors this work.
using: using:
- LLDB: https://github.com/llvm-mirror/lldb/blob/master/LICENSE.TXT - LLDB: https://github.com/llvm-mirror/lldb/blob/master/LICENSE.TXT
- ROCR-Runtime: https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/master/LICENSE.txt - ROCR-Runtime: https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/master/LICENSE.txt
- RLTK: https://github.com/chriswailes/RLTK/blob/master/LICENSE - RLTK: https://github.com/chriswailes/RLTK/blob/master/LICENSE
@ -28,37 +28,37 @@ limitations:
--- ---
University of Illinois/NCSA Open Source License University of Illinois/NCSA Open Source License
Copyright (c) [year] [fullname]. All rights reserved. Copyright (c) [year] [fullname]. All rights reserved.
Developed by: [project] Developed by: [project]
[fullname] [fullname]
[projecturl] [projecturl]
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files obtaining a copy of this software and associated documentation files
(the "Software"), to deal with the Software without restriction, (the "Software"), to deal with the Software without restriction,
including without limitation the rights to use, copy, modify, merge, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: subject to the following conditions:
* Redistributions of source code must retain the above copyright notice, * Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers. this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimers in the notice, this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
* Neither the names of [fullname], [project] nor the names of its * Neither the names of [fullname], [project] nor the names of its
contributors may be used to endorse or promote products derived from contributors may be used to endorse or promote products derived from
this Software without specific prior written permission. this Software without specific prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
THE SOFTWARE. THE SOFTWARE.

View File

@ -7,7 +7,7 @@ description: OSL 3.0 is a copyleft license that does not require reciprocal lice
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Files licensed under OSL 3.0 must also include the notice "Licensed under the Open Software License version 3.0" adjacent to the copyright notice. how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Files licensed under OSL 3.0 must also include the notice "Licensed under the Open Software License version 3.0" adjacent to the copyright notice.
note: OSL 3.0's author has <a href="http://rosenlaw.com/OSL3.0-explained.htm">provided an explanation</a> behind the creation of the license. note: OSL 3.0's author has <a href="https://rosenlaw.com/OSL3.0-explained.htm">provided an explanation</a> behind the creation of the license.
using: using:
- appserver.io: https://github.com/appserver-io/appserver/blob/master/LICENSE.txt - appserver.io: https://github.com/appserver-io/appserver/blob/master/LICENSE.txt

67
vendor/choosealicense.com/_licenses/upl-1.0.txt generated vendored Normal file
View File

@ -0,0 +1,67 @@
---
title: Universal Permissive License v1.0
spdx-id: UPL-1.0
source: https://oss.oracle.com/licenses/upl/
description: A permissive, OSI and FSF approved, GPL compatible license, expressly allowing attribution with just a copyright notice and a short form link rather than the full text of the license. Includes an express grant of patent rights. Licensed works and modifications may be distributed under different terms and without source code, and the patent grant may also optionally be expanded to larger works to permit use as a contributor license agreement.
how: Insert the license or a link to it along with a copyright notice into your source file(s), and/or create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license and your copyright notice into the file.
note: It is recommended to add a link to the license and copyright notice at the top of each source file, example text can be found at https://oss.oracle.com/licenses/upl/.
using:
- WebLogic Kubernetes Operator: https://github.com/oracle/weblogic-kubernetes-operator/blob/master/LICENSE
- Oracle Product Images for Docker: https://github.com/oracle/docker-images/blob/master/LICENSE
- Oracle Product Boxes for Vagrant: https://github.com/oracle/vagrant-boxes/blob/master/LICENSE
permissions:
- commercial-use
- modifications
- distribution
- patent-use
- private-use
conditions:
- include-copyright
limitations:
- liability
- warranty
---
Copyright (c) [year] [fullname]
The Universal Permissive License (UPL), Version 1.0
Subject to the condition set forth below, permission is hereby granted to any
person obtaining a copy of this software, associate documentation and/or data
(collectively the "Software"), free of charge and under any and all copyright
rights in the Software, and any and all patent rights owned or freely
licensable by each licensor hereunder covering either (i) the unmodified
Software as contributed to or provided by such licensor, or (ii) the Larger
Works (as defined below), to deal in both
(a) the Software, and
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
one is included with the Software (each a “Larger Work” to which the Software
is contributed by such licensors),
without restriction, including without limitation the rights to copy, create
derivative works of, display, perform, and distribute the Software and make,
use, sell, offer for sale, import, export, have made, and have sold the
Software and the Larger Work(s), and to sublicense the foregoing rights on
either these or other terms.
This license is subject to the following condition:
The above copyright notice and either this complete permission notice or at
a minimum a reference to the UPL must be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.