licensee 4.1.0 → 4.1.1

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
2
  SHA1:
3
- metadata.gz: 5222de4fdd764de0105fdaafe36cef8c2c8b2b0c
4
- data.tar.gz: 2955d94214e96c50829decbdb1b2bb1dfb49371a
3
+ metadata.gz: 5eaaff5a763689349aefc891e2c2af17e2a3ca15
4
+ data.tar.gz: 7f2f905878854668bb0d0d498a11c47dc0fb07f4
5
5
  SHA512:
6
- metadata.gz: 89b208f5829262ba09bdd506237a763d045370853f0ef0dc8a19416cd1001a39576adb707b4eefcbd9c1cdf5a9bc0e132ffce14f5f35bc46817da97a52eb1a83
7
- data.tar.gz: 0454cf6944bda0265c27a447eb8c2f55609ac7d15c692951b6fe4b3b76fdd3fde30d8d028ac9a8749971e844ab823d6acc01ead8b279c087126d8e66c0a6dea6
6
+ metadata.gz: dd90d60d7f3fa5bb96babd6ce60f3134d12e0cf1394303ccef2feeca39e4041fa3ace76b75c49138a482ef278d6994b18813c09331632ae3e4ffa3c210b6ae81
7
+ data.tar.gz: cd7e6da8e836830b0cc751f5b346b2eedebb312084cd1323036a6e3cd302513d6ce1ba01eec376d830e00fb2cdc4c8b50e0422e6a02f3ca8368b8a840eb7c8b4
data/README.md CHANGED
@@ -18,7 +18,7 @@ First, we look to see if the license is an exact match. Licenses like GPL don't
18
18
 
19
19
  Next, we look to Git's internal change calculation method, which is fast, but is done on a line-by-line basis, so if the license is wrapped differently, or has extra words inserted, it's not going to match the license.
20
20
 
21
- Finally, if we still can't match the license, we use a fancy math thing called the [Levenshtein distance algorthm](https://en.wikipedia.org/wiki/Levenshtein_distance), which while slow, is really good at calculating the similarity between two a known license and an unknown license. By calculating the percent changed from the known license, you can tell, e.g., that a given license is 98% similar to the MIT license, that 2% likely representing the copyright line being properly adapted to the project.
21
+ Finally, if we still can't match the license, we use a fancy math thing called the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance), which while slow, is really good at calculating the similarity between two a known license and an unknown license. By calculating the percent changed from the known license, you can tell, e.g., that a given license is 98% similar to the MIT license, that 2% likely representing the copyright line being properly adapted to the project.
22
22
 
23
23
  Licensee will even diff the distributed license with the original, so you can see exactly what, if anything's been changed.
24
24
 
@@ -19,6 +19,8 @@ class Licensee
19
19
  # Raw content of license file, including YAML front matter
20
20
  def content
21
21
  @content ||= File.open(path).read
22
+ rescue
23
+ ""
22
24
  end
23
25
 
24
26
  # License metadata from YAML front matter
@@ -39,14 +41,14 @@ class Licensee
39
41
 
40
42
  # The license body (e.g., contents - frontmatter)
41
43
  def body
42
- @body ||= parts[2]
44
+ @body ||= parts[2] if parts[2]
43
45
  end
44
46
  alias_method :to_s, :body
45
47
  alias_method :text, :body
46
48
 
47
49
  # License body with all whitespace replaced with a single space
48
50
  def body_normalized
49
- @content_normalized ||= body.downcase.gsub(/\s+/, " ").strip
51
+ @content_normalized ||= body.to_s.downcase.gsub(/\s+/, " ").strip
50
52
  end
51
53
 
52
54
  # Git-computed hash signature for the license file
@@ -1,3 +1,3 @@
1
1
  class Licensee
2
- VERSION = "4.1.0"
2
+ VERSION = "4.1.1"
3
3
  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.1.0
4
+ version: 4.1.1
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-11-10 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged