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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 619ad8c9ec5567bab5810856457d95baeb3116be
4
- data.tar.gz: d14fdefea813eb729cc4019d761c80b0c66825f2
3
+ metadata.gz: 4a290855e79c9c3a81461b32355903f0d2c01989
4
+ data.tar.gz: ce9fb94bce17bffbe042445c38d7b5b6fabbc2cf
5
5
  SHA512:
6
- metadata.gz: ec4d52f35ceb0a363390cd8a6a9c0bd14d2a871e955ad99c528e7501f2935ef778c5739cbf3fe5fc62d8d2671713ef24f767494c495e14b0d3a2d817b0759e4c
7
- data.tar.gz: 94e0d332a4d78d4a8344045d9db68ea7a3f871331a46c7c55bca084684505118da8e82715e1966be3bf4c3ba2ff8ef3620c0c5246fa9f62f45053aba1d6f7f82
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.name_without_version.downcase.sub('*', 'u')
81
+ regex = ALT_TITLE_REGEX[license.key]
82
+ regex || license.name_without_version.downcase.sub('*', 'u')
77
83
  end
78
84
  end
79
85
 
@@ -1,3 +1,3 @@
1
1
  module Licensee
2
- VERSION = '8.8.2'.freeze
2
+ VERSION = '8.8.3'.freeze
3
3
  end
@@ -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 = /\A#{license.name_without_version}/i
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.2
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-01 00:00:00.000000000 Z
11
+ date: 2017-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged