licensee 4.2.1 → 4.2.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/project.rb +7 -6
- data/lib/licensee/version.rb +1 -1
- data/test/fixtures/case-sensitive.git/HEAD +1 -0
- data/test/fixtures/case-sensitive.git/config +6 -0
- data/test/fixtures/case-sensitive.git/objects/01/7b4f1eebd1dcb735e950b1d01093e3e2bf85e9 +0 -0
- data/test/fixtures/case-sensitive.git/objects/2c/b878e0851c5cf53d7455d9018baa6755a38bd7 +0 -0
- data/test/fixtures/case-sensitive.git/objects/fb/ddf40ba5f30225af7cd9841afe374ca5800cb9 +0 -0
- data/test/fixtures/case-sensitive.git/refs/heads/master +1 -0
- data/test/test_licensee_project.rb +5 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d61bca685fc4099108f7c1c9ab2c498dc0cebadd
|
4
|
+
data.tar.gz: 12600dec4b6eab596b1083e3a70e60479b4e0d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c05b518fdd4dad9757aa28758d06649cc6491e9c8c2a4f8709336032014fdafd916d33ec123205e00770540ef1af0731de8a250b0aae321b8cfe5dd32d11f254
|
7
|
+
data.tar.gz: 3a2219d3755a4024388afa0b4b94861324804490f6869393bcb7c8a5c0bfde00d161294226029eacc9c78227e336c6fb94196b1fcbb6330d993a8358be6ba8f0
|
data/lib/licensee/project.rb
CHANGED
@@ -3,12 +3,13 @@ class Licensee
|
|
3
3
|
attr_reader :repository
|
4
4
|
|
5
5
|
# Array of file names to look for potential license files, in order
|
6
|
+
# Filenames should be lower case as candidates are downcased before comparison
|
6
7
|
LICENSE_FILENAMES = %w[
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
license
|
9
|
+
license.txt
|
10
|
+
license.md
|
11
|
+
unlicense
|
12
|
+
copying
|
12
13
|
]
|
13
14
|
|
14
15
|
# Initializes a new project
|
@@ -31,7 +32,7 @@ class Licensee
|
|
31
32
|
return @license_file if defined? @license_file
|
32
33
|
|
33
34
|
commit = @revision ? @repository.lookup(@revision) : @repository.last_commit
|
34
|
-
license_blob = commit.tree.each_blob { |blob| break blob if LICENSE_FILENAMES.include? blob[:name] }
|
35
|
+
license_blob = commit.tree.each_blob { |blob| break blob if LICENSE_FILENAMES.include? blob[:name].downcase }
|
35
36
|
|
36
37
|
@license_file = if license_blob
|
37
38
|
LicenseFile.new(@repository.lookup(license_blob[:oid]))
|
data/lib/licensee/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
ref: refs/heads/master
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
017b4f1eebd1dcb735e950b1d01093e3e2bf85e9
|
@@ -13,4 +13,9 @@ class TestLicenseeProject < Minitest::Test
|
|
13
13
|
should "detect the license" do
|
14
14
|
assert_equal "mit", @project.license.key
|
15
15
|
end
|
16
|
+
|
17
|
+
should "detect an atypically cased license file" do
|
18
|
+
project = Licensee::Project.new fixture_path("case-sensitive.git")
|
19
|
+
assert_equal Licensee::LicenseFile, project.license_file.class
|
20
|
+
end
|
16
21
|
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: 4.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
@@ -116,6 +116,12 @@ files:
|
|
116
116
|
- lib/licensee/matchers/levenshtein_matcher.rb
|
117
117
|
- lib/licensee/project.rb
|
118
118
|
- lib/licensee/version.rb
|
119
|
+
- test/fixtures/case-sensitive.git/HEAD
|
120
|
+
- test/fixtures/case-sensitive.git/config
|
121
|
+
- test/fixtures/case-sensitive.git/objects/01/7b4f1eebd1dcb735e950b1d01093e3e2bf85e9
|
122
|
+
- test/fixtures/case-sensitive.git/objects/2c/b878e0851c5cf53d7455d9018baa6755a38bd7
|
123
|
+
- test/fixtures/case-sensitive.git/objects/fb/ddf40ba5f30225af7cd9841afe374ca5800cb9
|
124
|
+
- test/fixtures/case-sensitive.git/refs/heads/master
|
119
125
|
- test/fixtures/licenses.git/HEAD
|
120
126
|
- test/fixtures/licenses.git/config
|
121
127
|
- test/fixtures/licenses.git/objects/info/packs
|