licensee 4.8.0 → 4.9.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/license.rb +7 -0
- data/lib/licensee/version.rb +1 -1
- data/test/test_licensee_license.rb +7 -0
- 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: e32073ffb1db6eed03c14cee02c4d72096fc70c8
|
4
|
+
data.tar.gz: f658b84856962074cebd0a310510510b7aa34dac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36b583c9dfc992f30e54425046d79f23b4522b31e470b54d61e1d08e20b146be096fdf8a684e0b45780ff487108a9bf5850452ba002883a1e8d357d316ef87c3
|
7
|
+
data.tar.gz: 682553fa645a933c8bf3c2db07a29a59ff5269564aef2c58604bf17351212508e8f74f9e51388d71894f4e844c6bf52bc21dca1c6385f598695e67d4fb9cdb39
|
data/lib/licensee/license.rb
CHANGED
@@ -14,6 +14,8 @@ class Licensee
|
|
14
14
|
"variant" => false
|
15
15
|
}
|
16
16
|
|
17
|
+
HIDDEN_LICENSES = %w[other no-license]
|
18
|
+
|
17
19
|
def initialize(key)
|
18
20
|
@key=key.downcase
|
19
21
|
end
|
@@ -56,6 +58,11 @@ class Licensee
|
|
56
58
|
end
|
57
59
|
alias_method :featured, :featured?
|
58
60
|
|
61
|
+
def hidden?
|
62
|
+
return true if HIDDEN_LICENSES.include?(key)
|
63
|
+
!!(meta["hidden"] if meta)
|
64
|
+
end
|
65
|
+
|
59
66
|
# The license body (e.g., contents - frontmatter)
|
60
67
|
def body
|
61
68
|
@body ||= parts[2] if parts && parts[2]
|
data/lib/licensee/version.rb
CHANGED
@@ -54,6 +54,13 @@ class TestLicenseeLicense < Minitest::Test
|
|
54
54
|
assert_equal true, license.meta["variant"]
|
55
55
|
end
|
56
56
|
|
57
|
+
should "know when the license is hidden" do
|
58
|
+
refute @license.hidden?
|
59
|
+
assert Licensee::License.new("ofl-1.1").hidden?
|
60
|
+
assert Licensee::License.new("no-license").hidden?
|
61
|
+
|
62
|
+
end
|
63
|
+
|
57
64
|
should "parse the license parts" do
|
58
65
|
assert_equal 3, @license.send(:parts).size
|
59
66
|
end
|