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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99fc294a5629e4b14e3483f626ff01a6b3e4e369
4
- data.tar.gz: 59d66b77d426fbb3e71d4794549ba7e09abc9977
3
+ metadata.gz: e32073ffb1db6eed03c14cee02c4d72096fc70c8
4
+ data.tar.gz: f658b84856962074cebd0a310510510b7aa34dac
5
5
  SHA512:
6
- metadata.gz: a69d140676e75804094a8d8c57b8af01a22a2c47b1f890d0baf84ade654149be96e0bc7b043193a3a2655d2dab3c062f7b7c99b0ac254c434206779a7fb25c4d
7
- data.tar.gz: 542c42872d3e944e62d9ba877881613606d09086830480907f7bcfe01c4cbb7373cec8f50acc895b6d9c8134a886e19ea8a80f392cfefa99bde883bb9d4d62d5
6
+ metadata.gz: 36b583c9dfc992f30e54425046d79f23b4522b31e470b54d61e1d08e20b146be096fdf8a684e0b45780ff487108a9bf5850452ba002883a1e8d357d316ef87c3
7
+ data.tar.gz: 682553fa645a933c8bf3c2db07a29a59ff5269564aef2c58604bf17351212508e8f74f9e51388d71894f4e844c6bf52bc21dca1c6385f598695e67d4fb9cdb39
@@ -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]
@@ -1,3 +1,3 @@
1
1
  class Licensee
2
- VERSION = "4.8.0"
2
+ VERSION = "4.9.0"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensee
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.0
4
+ version: 4.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter