licensee 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f2e9b86057294b6dcd08c9d2fc373afbe4b7f1f
4
- data.tar.gz: 3bbdb9bc63bcb6844da6fb4cab9190d1769f2281
3
+ metadata.gz: d61bca685fc4099108f7c1c9ab2c498dc0cebadd
4
+ data.tar.gz: 12600dec4b6eab596b1083e3a70e60479b4e0d71
5
5
  SHA512:
6
- metadata.gz: b83e3ba2eef669317cfee74fc88c77de0a15b7aaa5b240de093945bef158fb319ad8d08a5fbfdab2b875e44f2d4e5e8ab08aed6ae73f33a03e5bbac1d9c68bc3
7
- data.tar.gz: b8a76d6d6ecd60d26a0fd69bfe781bd2d4aac5a7c0e95af099e275ce7e7a65f657bbf839b75914416ccadfdfb6be77e45fbd85e245788dea1d6b88a64b78f99d
6
+ metadata.gz: c05b518fdd4dad9757aa28758d06649cc6491e9c8c2a4f8709336032014fdafd916d33ec123205e00770540ef1af0731de8a250b0aae321b8cfe5dd32d11f254
7
+ data.tar.gz: 3a2219d3755a4024388afa0b4b94861324804490f6869393bcb7c8a5c0bfde00d161294226029eacc9c78227e336c6fb94196b1fcbb6330d993a8358be6ba8f0
@@ -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
- LICENSE
8
- LICENSE.txt
9
- LICENSE.md
10
- UNLICENSE
11
- COPYING
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]))
@@ -1,3 +1,3 @@
1
1
  class Licensee
2
- VERSION = "4.2.1"
2
+ VERSION = "4.2.2"
3
3
  end
@@ -0,0 +1 @@
1
+ ref: refs/heads/master
@@ -0,0 +1,6 @@
1
+ [core]
2
+ repositoryformatversion = 0
3
+ filemode = true
4
+ bare = true
5
+ ignorecase = true
6
+ precomposeunicode = true
@@ -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.1
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: 2014-12-22 00:00:00.000000000 Z
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