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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f5e9db777ba544a7b8d7b860f1b4dfd888aff7a7
4
- data.tar.gz: 5dc0536e865b5e7afb69555b4a7274634e8ff7c0
2
+ SHA256:
3
+ metadata.gz: 5e3d2a512cc5d500d673afcbe56d3931b16eea1b1c2f838cd1cf0aa57cc2a2a7
4
+ data.tar.gz: 99e92b8ab7af4d29cb19b7224fef6d5a3f8d1a6c2f41ddba40cd9778011de5e4
5
5
  SHA512:
6
- metadata.gz: 4c9f9f80031affe550184f7f107d7d712e11995eddf6b644b52558affa5a9b3e6778654176ee5b4c540967dbbf43536c854d8d0fd9251cb21726803d862539b9
7
- data.tar.gz: ccc0a21928b7f598eb68a65bad34e8be0e52449ed65ef3fd9b8795d2876de549ae1e83c690909965cbf04c199451fe5d8adb6a83c820d85dcf2924b29633ac09
6
+ metadata.gz: b69f7078ad07df492666272deb8a761249ff2860f0449ae3ba673f628c158b2041df7626d0e1a068a885c25880b0d2a6304c20d6c7ab11d5c4c64d0e7cea1bd0
7
+ data.tar.gz: 35a5fcb97c23e08aa87a23a0a62ef83e07d27fb16200e8c61b21f78d4d49a06dfa8958248084051c3c35cc7d655aa4f78ff06cfdd616aa618ce6817f29a037b4
data/.travis.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4.0
3
+ - 2.4.2
4
+ - 2.5.0
4
5
  cache: bundler
5
6
  sudo: false
7
+ before_install:
8
+ - gem update --system
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
- lookup(name.strip) || find_by_special_case(name.strip) || closest(name.strip)
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
@@ -1,3 +1,3 @@
1
1
  module Spdx
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
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.10"
22
+ spec.add_development_dependency "bundler", "~> 1.16"
23
23
  spec.add_development_dependency "rake", "~> 12"
24
- spec.add_development_dependency "rspec", "~> 3.5.0"
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.2
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: 2017-04-07 00:00:00.000000000 Z
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.10'
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.10'
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.5.0
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.5.0
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.6.4
126
+ rubygems_version: 2.7.3
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: A SPDX license normalizer