spdx 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -1
- data/lib/spdx.rb +13 -1
- data/lib/spdx/version.rb +1 -1
- data/spdx.gemspec +2 -2
- data/spec/spdx_spec.rb +4 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5e3d2a512cc5d500d673afcbe56d3931b16eea1b1c2f838cd1cf0aa57cc2a2a7
|
4
|
+
data.tar.gz: 99e92b8ab7af4d29cb19b7224fef6d5a3f8d1a6c2f41ddba40cd9778011de5e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b69f7078ad07df492666272deb8a761249ff2860f0449ae3ba673f628c158b2041df7626d0e1a068a885c25880b0d2a6304c20d6c7ab11d5c4c64d0e7cea1bd0
|
7
|
+
data.tar.gz: 35a5fcb97c23e08aa87a23a0a62ef83e07d27fb16200e8c61b21f78d4d49a06dfa8958248084051c3c35cc7d655aa4f78ff06cfdd616aa618ce6817f29a037b4
|
data/.travis.yml
CHANGED
data/lib/spdx.rb
CHANGED
@@ -4,7 +4,19 @@ require "fuzzy_match"
|
|
4
4
|
|
5
5
|
module Spdx
|
6
6
|
def self.find(name)
|
7
|
-
|
7
|
+
name.strip!
|
8
|
+
return nil if commercial?(name)
|
9
|
+
search(name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.search(name)
|
13
|
+
lookup(name) ||
|
14
|
+
find_by_special_case(name) ||
|
15
|
+
closest(name)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.commercial?(name)
|
19
|
+
name.downcase == 'commercial'
|
8
20
|
end
|
9
21
|
|
10
22
|
def self.lookup(name)
|
data/lib/spdx/version.rb
CHANGED
data/spdx.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_dependency "spdx-licenses", "~> 1.0"
|
21
21
|
spec.add_dependency "fuzzy_match", "~> 2.1"
|
22
|
-
spec.add_development_dependency "bundler", "~> 1.
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
23
23
|
spec.add_development_dependency "rake", "~> 12"
|
24
|
-
spec.add_development_dependency "rspec", "~> 3.
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.7"
|
25
25
|
end
|
data/spec/spdx_spec.rb
CHANGED
@@ -15,6 +15,10 @@ describe Spdx do
|
|
15
15
|
expect(Spdx.find('Apache License 2.0').name).to eq("Apache License 2.0")
|
16
16
|
end
|
17
17
|
|
18
|
+
it "should return nil for commercial" do
|
19
|
+
expect(Spdx.find('Commercial')).to be_nil
|
20
|
+
end
|
21
|
+
|
18
22
|
it "should return nil for garbage" do
|
19
23
|
expect(Spdx.find('foo bar baz')).to be_nil
|
20
24
|
expect(Spdx.find('Copyright Zendesk. All Rights Reserved.')).to be_nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spdx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spdx-licenses
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.16'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.16'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.
|
75
|
+
version: '3.7'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.
|
82
|
+
version: '3.7'
|
83
83
|
description:
|
84
84
|
email:
|
85
85
|
- andrewnez@gmail.com
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.7.3
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: A SPDX license normalizer
|