certmeister 1.2.1 → 2.0.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: 0596ac0be7f99055dd61519c1c1ef2b01f7bd8e9
4
- data.tar.gz: 17c0811a312517027222e9e61958d0bc360751ad
3
+ metadata.gz: 083750255abf59b0e78a0c68f3b3aca6fd57d790
4
+ data.tar.gz: 5438388c4400a77bfa580dbb86d11560104a246a
5
5
  SHA512:
6
- metadata.gz: 9ece4718f7fc5ac4c314a98191d1ecdca0895851d00881a8bac0cb9696e5fcfe02e650f68653490d6acaac732615a2c892caa547ea9f7e46a840c8316719c114
7
- data.tar.gz: 1578a5ecf49d45dea1ca9e16966db80342eae0cb9d855bb83d9fd02a6832b3ae45f23e0f97844df90ac853365d617baf0210056986fb85d662e4bf239bc996ae
6
+ metadata.gz: 437fd1f9d23f2e5355bb70453bbaa06d9195ab037b23eeda614eccc109e7027900de0ae1b7637d346a887775173bc5761d6d3b7e50220a7cc007327e6599a5c4
7
+ data.tar.gz: 9d4b7cfef3c402a6547df3cee80301a00bdc4eda57a8f86c04f572f85eaba7760d55bacfa6fb6a23b15560cfa82fe0871f11f283875ac608934e1f799eda49bf
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- certmeister (1.2.1)
5
- certmeister-rack (1.2.1)
6
- certmeister (= 1.2.1)
4
+ certmeister (2.0.0)
5
+ certmeister-rack (2.0.0)
6
+ certmeister (= 2.0.0)
7
7
  rack (~> 1.5)
8
8
 
9
9
  GEM
@@ -4,6 +4,8 @@ module Certmeister
4
4
 
5
5
  class InMemoryStore
6
6
 
7
+ include Enumerable
8
+
7
9
  def initialize(certs = {})
8
10
  @certs = certs
9
11
  @healthy = true
@@ -24,6 +26,12 @@ module Certmeister
24
26
  !!@certs.delete(cn)
25
27
  end
26
28
 
29
+ def each
30
+ @certs.each do |cn, cert|
31
+ yield cn, cert
32
+ end
33
+ end
34
+
27
35
  def health_check
28
36
  @healthy
29
37
  end
@@ -32,6 +32,21 @@ module Certmeister
32
32
  expect(subject.fetch('axl.hetzner.africa')).to be_nil
33
33
  end
34
34
 
35
+ it "is enumerable" do
36
+ expect(subject).to be_a(Enumerable)
37
+ end
38
+
39
+ it "iterates certificates by cn" do
40
+ subject.store('axl.hetzner.africa', "hetzner-cert")
41
+ subject.store('axl.starjuice.net', "hetzner-cert")
42
+ received = {}
43
+ subject.each do |cn, cert|
44
+ expect(received).to_not include(cn)
45
+ received[cn] = cert
46
+ end
47
+ expect(received).to eql({'axl.hetzner.africa' => "hetzner-cert", 'axl.starjuice.net' => "hetzner-cert"})
48
+ end
49
+
35
50
  it "returns false when removing a non-existent CN" do
36
51
  expect(subject.remove('axl.hetzner.africa')).to be false
37
52
  end
@@ -1,5 +1,5 @@
1
1
  module Certmeister
2
2
 
3
- VERSION = '1.2.1' unless defined?(VERSION)
3
+ VERSION = '2.0.0' unless defined?(VERSION)
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: certmeister
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheldon Hearn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-03 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler