licensee 4.0.1 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/licensee/licenses.rb +0 -9
- data/lib/licensee/version.rb +1 -1
- data/test/test_licensee_licenses.rb +2 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5222de4fdd764de0105fdaafe36cef8c2c8b2b0c
|
4
|
+
data.tar.gz: 2955d94214e96c50829decbdb1b2bb1dfb49371a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89b208f5829262ba09bdd506237a763d045370853f0ef0dc8a19416cd1001a39576adb707b4eefcbd9c1cdf5a9bc0e132ffce14f5f35bc46817da97a52eb1a83
|
7
|
+
data.tar.gz: 0454cf6944bda0265c27a447eb8c2f55609ac7d15c692951b6fe4b3b76fdd3fde30d8d028ac9a8749971e844ab823d6acc01ead8b279c087126d8e66c0a6dea6
|
data/lib/licensee/licenses.rb
CHANGED
@@ -11,12 +11,6 @@ class Licensee
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
def sorted_list
|
15
|
-
list.sort { |a,b| a.name <=> b.name }.
|
16
|
-
partition { |license| license.featured? }.
|
17
|
-
flatten
|
18
|
-
end
|
19
|
-
|
20
14
|
# Given a license key, attempt to return a matching Licensee::License instance
|
21
15
|
def find(key)
|
22
16
|
list.find { |l| l.key.downcase == key.downcase }
|
@@ -28,8 +22,6 @@ class Licensee
|
|
28
22
|
@base ||= File.expand_path "../../vendor/choosealicense.com/_licenses", File.dirname(__FILE__)
|
29
23
|
end
|
30
24
|
|
31
|
-
private
|
32
|
-
|
33
25
|
# Returns a list of potential license keys, as vendored
|
34
26
|
def keys
|
35
27
|
@keys ||= begin
|
@@ -39,7 +31,6 @@ class Licensee
|
|
39
31
|
keyes
|
40
32
|
end
|
41
33
|
end
|
42
|
-
|
43
34
|
end
|
44
35
|
end
|
45
36
|
end
|
data/lib/licensee/version.rb
CHANGED
@@ -3,8 +3,8 @@ require 'helper'
|
|
3
3
|
class TestLicenseeLicenses < Minitest::Test
|
4
4
|
|
5
5
|
should "know license names" do
|
6
|
-
assert_equal Array, Licensee::Licenses.
|
7
|
-
assert_equal 15, Licensee::Licenses.
|
6
|
+
assert_equal Array, Licensee::Licenses.keys.class
|
7
|
+
assert_equal 15, Licensee::Licenses.keys.size
|
8
8
|
end
|
9
9
|
|
10
10
|
should "load the licenses" do
|
@@ -18,9 +18,4 @@ class TestLicenseeLicenses < Minitest::Test
|
|
18
18
|
assert_equal "mit", Licensee::Licenses.find("MIT").key
|
19
19
|
assert_equal "mit", Licensee::Licenses["mit"].key
|
20
20
|
end
|
21
|
-
|
22
|
-
should "sort the licenses" do
|
23
|
-
assert_equal "apache-2.0", Licensee::Licenses.sorted_list.first.key
|
24
|
-
assert_equal "bsd-2-clause", Licensee::Licenses.sorted_list.last.key
|
25
|
-
end
|
26
21
|
end
|