licensee 4.7.1 → 4.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/licensee/license.rb +1 -1
- data/lib/licensee/project.rb +3 -1
- data/lib/licensee/version.rb +1 -1
- data/test/fixtures/no-license.git/HEAD +1 -0
- data/test/fixtures/no-license.git/config +6 -0
- data/test/fixtures/no-license.git/objects/82/0c999cf27a6f71431646c404274c578f7a2869 +0 -0
- data/test/fixtures/no-license.git/objects/e1/d9b2a3d41c2ea74a520e66da2b5c63b2f6202f +0 -0
- data/test/fixtures/no-license.git/objects/ff/1592f44259635df9feda5e02853964b26f9e4d +0 -0
- data/test/fixtures/no-license.git/refs/heads/master +1 -0
- data/test/test_licensee_project.rb +4 -0
- data/test/test_licensee_vendor.rb +16 -19
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ba75185c14cbfaa45edb5dc8fdb46744c10bcf0
|
4
|
+
data.tar.gz: f4cf2d3c717c6e4f198d35e76eb3aa72451dd57d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82231c76c1ab2d6d77640420f3f850154b835703246a62ac71779f7609b348e2244f6be33b1321dd74944104cc3e01ce5add1e31735f318c3e4389a03b4bc9b8
|
7
|
+
data.tar.gz: 03d1e3e669f55a1cf3e882a1859e130715a52e7368aaf3506b03917c79483943c850113830103212785400c9ee52d78a65dd8dfcf6f99a000cb4baa517e6cabe
|
data/lib/licensee/license.rb
CHANGED
data/lib/licensee/project.rb
CHANGED
@@ -62,7 +62,9 @@ class Licensee
|
|
62
62
|
# Detects the license file, if any
|
63
63
|
# Returns the blob hash as detected in the tree
|
64
64
|
def license_hash
|
65
|
-
tree.
|
65
|
+
hashes = tree.map { |blob| [self.class.match_license_file(blob[:name]), blob] }
|
66
|
+
hash = hashes.select { |hash| hash[0] > 0 }.sort_by { |hash| hash[0] }.last
|
67
|
+
hash[1] if hash
|
66
68
|
end
|
67
69
|
|
68
70
|
def license_blob
|
data/lib/licensee/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
ref: refs/heads/master
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
e1d9b2a3d41c2ea74a520e66da2b5c63b2f6202f
|
@@ -1,31 +1,28 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
class TestLicenseeVendor < Minitest::Test
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
Dir["#{Licensee::Licenses.base}/*"].shuffle.each do |license|
|
5
|
+
|
6
|
+
should "detect the #{license} license" do
|
7
7
|
verify_license_file(license)
|
8
8
|
end
|
9
|
-
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
context "when modified" do
|
11
|
+
should "detect the #{license} license" do
|
12
|
+
verify_license_file(license, true) unless license =~ /no-license\.txt$/
|
13
|
+
end
|
15
14
|
end
|
16
|
-
end
|
17
15
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
16
|
+
context "different line lengths" do
|
17
|
+
should "detect the #{license} license" do
|
18
|
+
verify_license_file(license, false, 50)
|
19
|
+
end
|
24
20
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
context "when modified" do
|
22
|
+
should "detect the #{license} license" do
|
23
|
+
verify_license_file(license, true, 50) unless license =~ /no-license\.txt$/
|
24
|
+
end
|
25
|
+
end
|
29
26
|
end
|
30
27
|
end
|
31
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: licensee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.7.
|
4
|
+
version: 4.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
@@ -162,6 +162,12 @@ files:
|
|
162
162
|
- test/fixtures/named-license-file-suffix.git/objects/c9/b229e500e529fdbd4f50746ba207e91d0677b6
|
163
163
|
- test/fixtures/named-license-file-suffix.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
164
164
|
- test/fixtures/named-license-file-suffix.git/refs/heads/master
|
165
|
+
- test/fixtures/no-license.git/HEAD
|
166
|
+
- test/fixtures/no-license.git/config
|
167
|
+
- test/fixtures/no-license.git/objects/82/0c999cf27a6f71431646c404274c578f7a2869
|
168
|
+
- test/fixtures/no-license.git/objects/e1/d9b2a3d41c2ea74a520e66da2b5c63b2f6202f
|
169
|
+
- test/fixtures/no-license.git/objects/ff/1592f44259635df9feda5e02853964b26f9e4d
|
170
|
+
- test/fixtures/no-license.git/refs/heads/master
|
165
171
|
- test/functions.rb
|
166
172
|
- test/helper.rb
|
167
173
|
- test/test_licensee.rb
|