licensee 9.15.3 → 9.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/licensee +4 -0
- data/lib/licensee/content_helper.rb +6 -5
- data/lib/licensee/license.rb +10 -2
- data/lib/licensee/version.rb +1 -1
- data/licensee.gemspec +1 -1
- data/spec/fixture_spec.rb +1 -1
- data/spec/fixtures/agpl-3.0_markdown/LICENSE.md +651 -0
- data/spec/fixtures/apache-2.0_markdown/LICENSE.md +195 -0
- data/spec/fixtures/{markdown-artistic → artistic-2.0_markdown}/LICENSE.md +0 -0
- data/spec/fixtures/bsd-2-author/LICENSE +22 -0
- data/spec/fixtures/bsd-3-clause_markdown/LICENSE.md +28 -0
- data/spec/fixtures/cc-by-4.0_markdown/LICENSE.md +157 -0
- data/spec/fixtures/cc-by-sa-4.0_markdown/LICENSE.md +171 -0
- data/spec/fixtures/cc0-1.0_markdown/LICENSE.md +41 -0
- data/spec/fixtures/detect.json +1 -1
- data/spec/fixtures/epl-1.0_markdown/LICENSE.md +76 -0
- data/spec/fixtures/fixtures.yml +105 -41
- data/spec/fixtures/gfdl-1.3_markdown/LICENSE.md +450 -0
- data/spec/fixtures/gpl-2.0_markdown/LICENSE.md +336 -0
- data/spec/fixtures/{markdown-gpl → gpl-2.0_markdown_headings}/LICENSE.md +0 -0
- data/spec/fixtures/gpl-3.0_markdown/LICENSE.md +595 -0
- data/spec/fixtures/lgpl-2.1_markdown/LICENSE.md +494 -0
- data/spec/fixtures/lgpl-3.0_markdown/LICENSE.md +163 -0
- data/spec/fixtures/license-hashes.json +6 -6
- data/spec/fixtures/mit_markdown/LICENSE.md +26 -0
- data/spec/fixtures/mpl-2.0_markdown/LICENSE.md +357 -0
- data/spec/fixtures/unlicense_markdown/LICENSE.md +27 -0
- data/spec/integration_spec.rb +11 -2
- data/spec/licensee/commands/detect_spec.rb +16 -0
- data/spec/licensee/content_helper_spec.rb +16 -0
- data/spec/licensee/matchers/reference_matcher_spec.rb +17 -0
- data/vendor/choosealicense.com/_licenses/bsd-3-clause.txt +1 -0
- data/vendor/license-list-XML/src/Artistic-2.0.xml +5 -3
- data/vendor/license-list-XML/src/BSD-3-Clause-Clear.xml +3 -1
- metadata +22 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a971ca02733f55d37c599851a056742f8c40d758744c252c778c245082db6b3c
|
|
4
|
+
data.tar.gz: 5cd7c9da75de50b045a68510cb9ab9442029f4a5ce3ae7011438686161de1c03
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be105dd2fee2e5e81d340be6692deb0119d3fa478732f0802b70a36f1e93994922c2c3b2567dee6518b53be75af4f7bc520addd472c791786337332bed386cd9
|
|
7
|
+
data.tar.gz: f53af3d80fd536f46767ae2316df97411b4aa4483dd3bf80f5bb3ee3ba39f5334e4c9b5276338b9d00f378347ba503ea8f804102573a32b73699ac98a1c5ec8f
|
data/bin/licensee
CHANGED
|
@@ -32,11 +32,12 @@ module Licensee
|
|
|
32
32
|
mit_optional: /\(including the next paragraph\)/i
|
|
33
33
|
}.freeze
|
|
34
34
|
NORMALIZATIONS = {
|
|
35
|
-
lists: { from: /^\s*(?:\d
|
|
35
|
+
lists: { from: /^\s*(?:\d\.|[*-])(?: [*_]{0,2}\(?[\da-z]\)[*_]{0,2})?\s+([^\n])/, to: '- \1' },
|
|
36
36
|
https: { from: /http:/, to: 'https:' },
|
|
37
37
|
ampersands: { from: '&', to: 'and' },
|
|
38
38
|
dashes: { from: /(?<!^)([—–-]+)(?!$)/, to: '-' },
|
|
39
|
-
quote: { from: /[`'"‘“’”]/, to: "'" }
|
|
39
|
+
quote: { from: /[`'"‘“’”]/, to: "'" },
|
|
40
|
+
hyphenated: { from: /(\w+)-\s*\n\s*(\w+)/, to: '\1-\2' }
|
|
40
41
|
}.freeze
|
|
41
42
|
|
|
42
43
|
# Legally equivalent words that schould be ignored for comparison
|
|
@@ -82,8 +83,8 @@ module Licensee
|
|
|
82
83
|
'whilst' => 'while',
|
|
83
84
|
'wilful' => 'wilfull',
|
|
84
85
|
'non-commercial' => 'noncommercial',
|
|
85
|
-
'cent'
|
|
86
|
-
'owner'
|
|
86
|
+
'per cent' => 'percent',
|
|
87
|
+
'copyright owner' => 'copyright holder'
|
|
87
88
|
}.freeze
|
|
88
89
|
STRIP_METHODS = %i[
|
|
89
90
|
bom
|
|
@@ -341,7 +342,7 @@ module Licensee
|
|
|
341
342
|
# Use that if it's present, otherwise, just return the simple delta.
|
|
342
343
|
return delta unless respond_to?(:spdx_alt_segments, true)
|
|
343
344
|
|
|
344
|
-
adjusted_delta = delta - ([fields_normalized.size, spdx_alt_segments].max *
|
|
345
|
+
adjusted_delta = delta - ([fields_normalized.size, spdx_alt_segments].max * 5)
|
|
345
346
|
adjusted_delta.positive? ? adjusted_delta : 0
|
|
346
347
|
end
|
|
347
348
|
end
|
data/lib/licensee/license.rb
CHANGED
|
@@ -74,7 +74,7 @@ module Licensee
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def keys_licenses(options = {})
|
|
77
|
-
@keys_licenses[options] ||= all(options).
|
|
77
|
+
@keys_licenses[options] ||= all(options).to_h { |l| [l.key, l] }
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
|
|
@@ -151,7 +151,15 @@ module Licensee
|
|
|
151
151
|
string.sub!(/v(\d+\.\d+)/, '\1')
|
|
152
152
|
string = Regexp.escape(string)
|
|
153
153
|
string = string.sub(/\\ licen[sc]e/i, '(?:\ licen[sc]e)?')
|
|
154
|
-
|
|
154
|
+
version_match = string.match(/\d+\\.(\d+)/)
|
|
155
|
+
if version_match
|
|
156
|
+
vsub = if version_match[1] == '0'
|
|
157
|
+
',?\s+(?:version\ |v(?:\. )?)?\1(\2)?'
|
|
158
|
+
else
|
|
159
|
+
',?\s+(?:version\ |v(?:\. )?)?\1\2'
|
|
160
|
+
end
|
|
161
|
+
string = string.sub(/\\ (\d+)(\\.\d+)/, vsub)
|
|
162
|
+
end
|
|
155
163
|
string = string.sub(/\bgnu\\ /, '(?:GNU )?')
|
|
156
164
|
title_regex = Regexp.new string, 'i'
|
|
157
165
|
|
data/lib/licensee/version.rb
CHANGED
data/licensee.gemspec
CHANGED
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |gem|
|
|
|
37
37
|
gem.add_development_dependency('simplecov', '~> 0.16')
|
|
38
38
|
gem.add_development_dependency('webmock', '~> 3.1')
|
|
39
39
|
|
|
40
|
-
gem.required_ruby_version = '>= 2.
|
|
40
|
+
gem.required_ruby_version = '>= 2.6'
|
|
41
41
|
|
|
42
42
|
# ensure the gem is built out of versioned files
|
|
43
43
|
gem.files = Dir[
|
data/spec/fixture_spec.rb
CHANGED