licensee 8.8.2 → 8.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/licensee/content_helper.rb +7 -1
- data/lib/licensee/version.rb +1 -1
- data/spec/licensee/content_helper_spec.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a290855e79c9c3a81461b32355903f0d2c01989
|
4
|
+
data.tar.gz: ce9fb94bce17bffbe042445c38d7b5b6fabbc2cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b5694fc6c9368c60336ad3fad4f7b7e19f194069e5fc14815a0c3c76ec8d075b2322864b4f0dd2764ba2550749a11531af800866d2891f88905ad1025953cab
|
7
|
+
data.tar.gz: a46abce4a9b95ca23c617b55d1ed32cf20d4acd6855b385840d201be42241652fc5f31d426d9da39d975802f1e108d674341da80637f9ee505f5f2c6cb18d6bc
|
@@ -5,6 +5,11 @@ module Licensee
|
|
5
5
|
module ContentHelper
|
6
6
|
DIGEST = Digest::SHA1
|
7
7
|
END_OF_TERMS_REGEX = /^\s*end of terms and conditions\s*$/i
|
8
|
+
ALT_TITLE_REGEX = {
|
9
|
+
'bsd-2-clause' => /bsd 2-clause( \"simplified\")? license/i,
|
10
|
+
'bsd-3-clause' => /bsd 3-clause( \"new\" or \"revised\")? license/i,
|
11
|
+
'bsd-3-clause-clear' => /bsd 3-clause( clear)? license/i
|
12
|
+
}.freeze
|
8
13
|
|
9
14
|
# A set of each word in the license, without duplicates
|
10
15
|
def wordset
|
@@ -73,7 +78,8 @@ module Licensee
|
|
73
78
|
|
74
79
|
def license_names
|
75
80
|
@license_titles ||= License.all(hidden: true).map do |license|
|
76
|
-
license.
|
81
|
+
regex = ALT_TITLE_REGEX[license.key]
|
82
|
+
regex || license.name_without_version.downcase.sub('*', 'u')
|
77
83
|
end
|
78
84
|
end
|
79
85
|
|
data/lib/licensee/version.rb
CHANGED
@@ -78,7 +78,8 @@ EOS
|
|
78
78
|
let(:stripped_content) { subject.content_without_title_and_version }
|
79
79
|
|
80
80
|
it 'strips the title' do
|
81
|
-
regex =
|
81
|
+
regex = Licensee::ContentHelper::ALT_TITLE_REGEX[license.key]
|
82
|
+
regex ||= /\A#{license.name_without_version}/i
|
82
83
|
expect(license.content_normalized).to_not match(regex)
|
83
84
|
expect(stripped_content).to_not match(regex)
|
84
85
|
end
|
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: 8.8.
|
4
|
+
version: 8.8.3
|
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-03-
|
11
|
+
date: 2017-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|