licensee 9.2.0 → 9.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78870e247e0c6151853578986d20c1c751367d5d
4
- data.tar.gz: 44bb59c524289c3797c408ddd727fca8e808893d
3
+ metadata.gz: de59dd055155b4db053cd767df32f14eb5b2dc0d
4
+ data.tar.gz: e3897cc9d4d9d5b73909e0779ddd48a027cedf3a
5
5
  SHA512:
6
- metadata.gz: beda36d600d5771bf870f627547800aa561641f2755c2f9a6662b7e7b14dfdb743075ecfd45145bfe6050c8f3aedcf9c3b65f70b10d5f0edab22b1c4a10bf7cb
7
- data.tar.gz: d66f22ef8340ccfb6c9ca11fdbd1c5e403ba26c5f8a21776cd5f88dfa2fc8bf71322b5fc0895412091cd78ccbf39fba099953a5bec51c62e129c99c95c308cf7
6
+ metadata.gz: dd3d44919402f44ec02a3a25cf44a14fe7d905229cda772e0ad9c6425457a7f480ff6bdc981e0324d5fcc8f0ea84827d427d271041624dbccf5b02d76b5c1f79
7
+ data.tar.gz: b653f0f4024450b822e42a4a8bce66ac7c1102ab5629512137cf1eb99ff58b0f27ead76b4ff0a6e09f600855353cae24d1f092070a5b2f7c39e62635bdd785a8
@@ -9,8 +9,12 @@ module Licensee
9
9
  ALT_TITLE_REGEX = {
10
10
  'bsd-2-clause' => /bsd 2-clause( \"simplified\")? license/i,
11
11
  'bsd-3-clause' => /bsd 3-clause( \"new\" or \"revised\")? license/i,
12
- 'bsd-3-clause-clear' => /bsd 3-clause( clear)? license/i
12
+ 'bsd-3-clause-clear' => /(clear bsd|bsd 3-clause( clear)?) license/i
13
13
  }.freeze
14
+ ALL_RIGHTS_RESERVED_REGEX = /\Aall rights reserved\.?$/i
15
+ WHITESPACE_REGEX = /\s+/
16
+ MARKDOWN_HEADING_REGEX = /\A\s*#+/
17
+ VERSION_REGEX = /\Aversion.*$/i
14
18
 
15
19
  # A set of each word in the license, without duplicates
16
20
  def wordset
@@ -75,6 +79,7 @@ module Licensee
75
79
  while string =~ Matchers::Copyright::REGEX
76
80
  string = strip_copyright(string)
77
81
  end
82
+ string = strip_all_rights_reserved(string)
78
83
  string, _partition, _instructions = string.partition(END_OF_TERMS_REGEX)
79
84
  strip_whitespace(string)
80
85
  end
@@ -121,29 +126,37 @@ module Licensee
121
126
  end
122
127
 
123
128
  def strip_title(string)
124
- string.sub(title_regex, '').strip
129
+ strip(string, title_regex)
125
130
  end
126
131
 
127
132
  def strip_version(string)
128
- string.sub(/\Aversion.*$/i, '').strip
133
+ strip(string, VERSION_REGEX)
129
134
  end
130
135
 
131
136
  def strip_copyright(string)
132
- string.gsub(Matchers::Copyright::REGEX, '').strip
137
+ strip(string, Matchers::Copyright::REGEX)
133
138
  end
134
139
 
135
140
  # Strip HRs from MPL
136
141
  def strip_hrs(string)
137
- string.gsub HR_REGEX, ' '
142
+ strip(string, HR_REGEX)
138
143
  end
139
144
 
140
145
  # Strip leading #s from the document
141
146
  def strip_markdown_headings(string)
142
- string.sub(/\A\s*#+/, '').strip
147
+ strip(string, MARKDOWN_HEADING_REGEX)
143
148
  end
144
149
 
145
150
  def strip_whitespace(string)
146
- string.gsub(/\s+/, ' ').squeeze(' ').strip
151
+ strip(string, WHITESPACE_REGEX)
152
+ end
153
+
154
+ def strip_all_rights_reserved(string)
155
+ strip(string, ALL_RIGHTS_RESERVED_REGEX)
156
+ end
157
+
158
+ def strip(string, regex)
159
+ string.gsub(regex, ' ').squeeze(' ').strip
147
160
  end
148
161
  end
149
162
  end
@@ -59,7 +59,7 @@ module Licensee
59
59
 
60
60
  attr_reader :key
61
61
 
62
- # Preserved for backwards compatability
62
+ # Preserved for backwards compatibility
63
63
  YAML_DEFAULTS = Licensee::LicenseMeta.members
64
64
 
65
65
  # Pseudo-license are license placeholders with no content
@@ -113,6 +113,7 @@ module Licensee
113
113
  def creative_commons?
114
114
  key.start_with?('cc-')
115
115
  end
116
+ alias cc? creative_commons?
116
117
 
117
118
  # The license body (e.g., contents - frontmatter)
118
119
  def content
@@ -19,22 +19,27 @@ module Licensee
19
19
  # Regex to match OFL.
20
20
  OFL_REGEX = /ofl/i
21
21
 
22
+ # BSD + PATENTS patent file
23
+ PATENTS_REGEX = /patents/i
24
+
22
25
  # Hash of Regex => score with which to score potential license files
23
26
  FILENAME_REGEXES = {
24
- /\A#{LICENSE_REGEX}\z/ => 1.0, # LICENSE
25
- /\A#{LICENSE_REGEX}#{PREFERRED_EXT_REGEX}\z/ => 0.9, # LICENSE.md
26
- /\A#{COPYING_REGEX}\z/ => 0.8, # COPYING
27
- /\A#{COPYING_REGEX}#{PREFERRED_EXT_REGEX}\z/ => 0.7, # COPYING.md
28
- /\A#{LICENSE_REGEX}#{ANY_EXT_REGEX}\z/ => 0.6, # LICENSE.textile
29
- /\A#{COPYING_REGEX}#{ANY_EXT_REGEX}\z/ => 0.5, # COPYING.textile
30
- /#{LICENSE_REGEX}-/ => 0.4, # LICENSE-MIT
31
- /#{COPYING_REGEX}-/ => 0.35, # COPYING-MIT
32
- /-#{LICENSE_REGEX}/ => 0.3, # MIT-LICENSE-MIT
33
- /-#{COPYING_REGEX}/ => 0.25, # MIT-COPYING
34
- /\A#{OFL_REGEX}#{PREFERRED_EXT_REGEX}/ => 0.2, # OFL.md
35
- /\A#{OFL_REGEX}#{ANY_EXT_REGEX}/ => 0.1, # OFL.textile
36
- /\A#{OFL_REGEX}\z/ => 0.05, # OFL
37
- // => 0.0 # Catch all
27
+ /\A#{LICENSE_REGEX}\z/ => 1.00, # LICENSE
28
+ /\A#{LICENSE_REGEX}#{PREFERRED_EXT_REGEX}\z/ => 0.95, # LICENSE.md
29
+ /\A#{COPYING_REGEX}\z/ => 0.90, # COPYING
30
+ /\A#{COPYING_REGEX}#{PREFERRED_EXT_REGEX}\z/ => 0.85, # COPYING.md
31
+ /\A#{LICENSE_REGEX}#{ANY_EXT_REGEX}\z/ => 0.80, # LICENSE.textile
32
+ /\A#{COPYING_REGEX}#{ANY_EXT_REGEX}\z/ => 0.75, # COPYING.textile
33
+ /#{LICENSE_REGEX}-/ => 0.70, # LICENSE-MIT
34
+ /#{COPYING_REGEX}-/ => 0.65, # COPYING-MIT
35
+ /-#{LICENSE_REGEX}/ => 0.60, # MIT-LICENSE-MIT
36
+ /-#{COPYING_REGEX}/ => 0.55, # MIT-COPYING
37
+ /\A#{OFL_REGEX}#{PREFERRED_EXT_REGEX}/ => 0.50, # OFL.md
38
+ /\A#{OFL_REGEX}#{ANY_EXT_REGEX}/ => 0.45, # OFL.textile
39
+ /\A#{OFL_REGEX}\z/ => 0.40, # OFL
40
+ /\A#{PATENTS_REGEX}\z/ => 0.35, # PATENTS
41
+ /\A#{PATENTS_REGEX}#{ANY_EXT_REGEX}\z/ => 0.30, # PATENTS.txt
42
+ // => 0.00 # Catch all
38
43
  }.freeze
39
44
 
40
45
  # CC-NC and CC-ND are not open source licenses and should not be
@@ -1,3 +1,3 @@
1
1
  module Licensee
2
- VERSION = '9.2.0'.freeze
2
+ VERSION = '9.2.1'.freeze
3
3
  end
@@ -0,0 +1,33 @@
1
+ Additional Grant of Patent Rights Version 2
2
+
3
+ "Software" means the React software distributed by Facebook, Inc.
4
+
5
+ Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
6
+ ("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
7
+ (subject to the termination provision below) license under any Necessary
8
+ Claims, to make, have made, use, sell, offer to sell, import, and otherwise
9
+ transfer the Software. For avoidance of doubt, no license is granted under
10
+ Facebook's rights in any patent claims that are infringed by (i) modifications
11
+ to the Software made by you or any third party or (ii) the Software in
12
+ combination with any software or other technology.
13
+
14
+ The license granted hereunder will terminate, automatically and without notice,
15
+ if you (or any of your subsidiaries, corporate affiliates or agents) initiate
16
+ directly or indirectly, or take a direct financial interest in, any Patent
17
+ Assertion: (i) against Facebook or any of its subsidiaries or corporate
18
+ affiliates, (ii) against any party if such Patent Assertion arises in whole or
19
+ in part from any software, technology, product or service of Facebook or any of
20
+ its subsidiaries or corporate affiliates, or (iii) against any party relating
21
+ to the Software. Notwithstanding the foregoing, if Facebook or any of its
22
+ subsidiaries or corporate affiliates files a lawsuit alleging patent
23
+ infringement against you in the first instance, and you respond by filing a
24
+ patent infringement counterclaim in that lawsuit against that party that is
25
+ unrelated to the Software, the license granted hereunder will not terminate
26
+ under section (i) of this paragraph due to such counterclaim.
27
+
28
+ A "Necessary Claim" is a claim of a patent owned by Facebook that is
29
+ necessarily infringed by the Software standing alone.
30
+
31
+ A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
32
+ or contributory infringement or inducement to infringe any patent, including a
33
+ cross-claim or counterclaim.
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2013-present, Facebook, Inc.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ * Neither the name Facebook nor the names of its contributors may be used to
15
+ endorse or promote products derived from this software without specific
16
+ prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -139,6 +139,15 @@ RSpec.describe 'integration test' do
139
139
  expect(subject.license).to eql(license)
140
140
  end
141
141
  end
142
+
143
+ context 'BSD + PATENTS' do
144
+ let(:license) { Licensee::License.find('other') }
145
+ let(:fixture) { 'bsd-plus-patents' }
146
+
147
+ it 'returns other' do
148
+ expect(subject.license).to eql(license)
149
+ end
150
+ end
142
151
  end
143
152
 
144
153
  context 'with the license file stubbed' do
@@ -16,6 +16,8 @@ RSpec.describe Licensee::ContentHelper do
16
16
  Copyright 2016 Ben Balter
17
17
  *************************
18
18
 
19
+ All rights reserved.
20
+
19
21
  The made
20
22
  * * * *
21
23
  up license.
@@ -110,6 +112,10 @@ EOS
110
112
  expect(normalized_content).to_not match('#')
111
113
  end
112
114
 
115
+ it 'strips all rights reserved' do
116
+ expect(normalized_content).to_not match(/all rights reserved/i)
117
+ end
118
+
113
119
  Licensee::License.all(hidden: true).each do |license|
114
120
  context license.name do
115
121
  let(:stripped_content) { subject.content_without_title_and_version }
@@ -126,6 +132,11 @@ EOS
126
132
  expect(stripped_content).to_not match(/\Aversion/i)
127
133
  end
128
134
 
135
+ it 'strips all rights reserved' do
136
+ regex = /all rights reserved/i
137
+ expect(license.content_normalized).to_not match(regex)
138
+ end
139
+
129
140
  it 'strips the copyright' do
130
141
  expect(license.content_normalized).to_not match(/\Acopyright/i)
131
142
  end
@@ -37,31 +37,31 @@ RSpec.describe Licensee::ProjectFiles::LicenseFile do
37
37
 
38
38
  context 'filename scoring' do
39
39
  {
40
- 'license' => 1.0,
41
- 'LICENCE' => 1.0,
42
- 'unLICENSE' => 1.0,
43
- 'unlicence' => 1.0,
44
- 'license.md' => 0.9,
45
- 'LICENSE.md' => 0.9,
46
- 'license.txt' => 0.9,
47
- 'COPYING' => 0.8,
48
- 'copyRIGHT' => 0.8,
49
- 'COPYRIGHT.txt' => 0.7,
50
- 'copying.txt' => 0.7,
51
- 'LICENSE.php' => 0.6,
52
- 'LICENCE.docs' => 0.6,
53
- 'copying.image' => 0.5,
54
- 'COPYRIGHT.go' => 0.5,
55
- 'LICENSE-MIT' => 0.4,
56
- 'MIT-LICENSE.txt' => 0.3,
57
- 'mit-license-foo.md' => 0.4,
58
- 'COPYING-GPL' => 0.35,
59
- 'COPYRIGHT-BSD' => 0.35,
60
- 'OFL.md' => 0.2,
61
- 'ofl.textile' => 0.1,
62
- 'ofl' => 0.05,
63
- 'not-the-ofl' => 0.0,
64
- 'README.txt' => 0.0
40
+ 'license' => 1.00,
41
+ 'LICENCE' => 1.00,
42
+ 'unLICENSE' => 1.00,
43
+ 'unlicence' => 1.00,
44
+ 'license.md' => 0.95,
45
+ 'LICENSE.md' => 0.95,
46
+ 'license.txt' => 0.95,
47
+ 'COPYING' => 0.90,
48
+ 'copyRIGHT' => 0.90,
49
+ 'COPYRIGHT.txt' => 0.85,
50
+ 'copying.txt' => 0.85,
51
+ 'LICENSE.php' => 0.80,
52
+ 'LICENCE.docs' => 0.80,
53
+ 'copying.image' => 0.75,
54
+ 'COPYRIGHT.go' => 0.75,
55
+ 'LICENSE-MIT' => 0.70,
56
+ 'MIT-LICENSE.txt' => 0.60,
57
+ 'mit-license-foo.md' => 0.70,
58
+ 'COPYING-GPL' => 0.65,
59
+ 'COPYRIGHT-BSD' => 0.65,
60
+ 'OFL.md' => 0.50,
61
+ 'ofl.textile' => 0.45,
62
+ 'ofl' => 0.40,
63
+ 'not-the-ofl' => 0.00,
64
+ 'README.txt' => 0.00
65
65
  }.each do |filename, expected|
66
66
  context "a file named #{filename}" do
67
67
  let(:score) { described_class.name_score(filename) }
@@ -11,6 +11,7 @@
11
11
  before do
12
12
  Dir.chdir path do
13
13
  `git init`
14
+ `git config --local commit.gpgsign false`
14
15
  `git add .`
15
16
  `git commit -m 'initial commit'`
16
17
  end
@@ -54,11 +54,9 @@ end
54
54
  def git_init(path)
55
55
  Dir.chdir path do
56
56
  `git init`
57
- gpgsign = `git config --local commit.gpgsign`
58
57
  `git config --local commit.gpgsign false`
59
58
  `git add .`
60
59
  `git commit -m 'initial commit'`
61
- `git config --local commit.gpgsign #{gpgsign}`
62
60
  end
63
61
  end
64
62
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  - name: spdx-id
9
9
  description: Short identifier specified by http://spdx.org/licenses/
10
- required: required
10
+ required: true
11
11
 
12
12
  - name: source
13
13
  description: The URL to the license source text
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: PostgreSQL License
3
+ spdx-id: PostgreSQL
4
+ source: https://opensource.org/licenses/PostgreSQL
5
+
6
+ description: A very short, BSD-style license, used specifically for PostgreSQL.
7
+
8
+ how: To use it, say that it is The PostgreSQL License, and then substitute the copyright year and name of the copyright holder into the body of the license. Then put the license into a prominent file ("COPYRIGHT", "LICENSE" or "COPYING" are common names for this file) in your software distribution.
9
+
10
+ using:
11
+ - pgBadger: https://github.com/dalibo/pgbadger/blob/master/LICENSE
12
+ - pgAdmin: https://github.com/postgres/pgadmin4/blob/master/LICENSE
13
+ - .NET Access to PostgreSQL: https://github.com/npgsql/npgsql/blob/dev/LICENSE.txt
14
+
15
+ permissions:
16
+ - commercial-use
17
+ - modifications
18
+ - distribution
19
+ - private-use
20
+
21
+ conditions:
22
+ - include-copyright
23
+
24
+ limitations:
25
+ - liability
26
+ - warranty
27
+
28
+ ---
29
+
30
+ PostgreSQL Licence
31
+
32
+ Copyright (c) [year], [fullname]
33
+
34
+ Permission to use, copy, modify, and distribute this software and its
35
+ documentation for any purpose, without fee, and without a written agreement is
36
+ hereby granted, provided that the above copyright notice and this paragraph
37
+ and the following two paragraphs appear in all copies.
38
+
39
+ IN NO EVENT SHALL [fullname] BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
40
+ SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
41
+ OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF [fullname]
42
+ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
+
44
+ [fullname] SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
45
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
46
+ PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
47
+ AND [fullname] HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
48
+ ENHANCEMENTS, OR MODIFICATIONS.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensee
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.2.0
4
+ version: 9.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-07 00:00:00.000000000 Z
11
+ date: 2017-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
@@ -133,6 +133,8 @@ files:
133
133
  - lib/licensee/rule.rb
134
134
  - lib/licensee/version.rb
135
135
  - spec/bin_spec.rb
136
+ - spec/fixtures/bsd-plus-patents/PATENTS
137
+ - spec/fixtures/bsd-plus-patents/license.txt
136
138
  - spec/fixtures/case-sensitive/LiCeNsE.TxT
137
139
  - spec/fixtures/cc-by-nc-sa/LICENSE
138
140
  - spec/fixtures/cc-by-nd/LICENSE
@@ -209,6 +211,7 @@ files:
209
211
  - vendor/choosealicense.com/_licenses/ncsa.txt
210
212
  - vendor/choosealicense.com/_licenses/ofl-1.1.txt
211
213
  - vendor/choosealicense.com/_licenses/osl-3.0.txt
214
+ - vendor/choosealicense.com/_licenses/postgresql.txt
212
215
  - vendor/choosealicense.com/_licenses/unlicense.txt
213
216
  - vendor/choosealicense.com/_licenses/wtfpl.txt
214
217
  - vendor/choosealicense.com/_licenses/zlib.txt