routemaster-drain 2.5.1 → 2.5.2

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: 7a8ad60bfee0918ed21059151f9766548347337c
4
- data.tar.gz: b6522a49633aca5590802c36cb072cec0d667fd4
3
+ metadata.gz: 0e5b1d310a24d14ffe3335b5c63c40de0fdc9757
4
+ data.tar.gz: e7ee5a5854c5cf4cb4fa8af9ffaaadf6bb620289
5
5
  SHA512:
6
- metadata.gz: d05a881d29704c66cb409799d6de1503632f486be0a8b8dab6fd6012f824a170e5d96ab5827314094a10d5bb12e7b0579f7844cf48366743100f9d734ceae080
7
- data.tar.gz: b574538c1c40e6c16c4d09fdb4ccacca3f6214f1b9088cdf4fa1de2d87d8b82fff1955ecf55b0e2208a8aaaa11a9db499f4dd32a73d4ad2ced5564a8c7e7e17b
6
+ metadata.gz: 3e72b8ba79a1e267735fc66972218ece1a9f612ce726aa68ee4787022e25c693f8d31edb726871d581d0f9a38390dfd02098c08fc0e3f5308e75f8502dfe3ffe
7
+ data.tar.gz: 7c9e07067f21c1d2720fafed636d552b6981b0b2fe77a38ea489d59b431d7eeb6bac7b8f3192cb534539b68a4143c3dc2263ee26379da6cc359c056f13ff0917
data/CHANGELOG.md CHANGED
@@ -1,13 +1,18 @@
1
+ ### 2.5.2 (2017-05-11)
2
+
3
+ Bug fixes
4
+
5
+ - Bust the cache when the resource is not found (#48)
6
+
1
7
  ### 2.5.1 (2017-05-10)
2
8
 
3
9
  Features:
4
10
 
5
11
  - Adds the `Siphon` middleware to `CacheBusting` drain (#45)
6
12
 
7
- Bug fixes:
8
-
9
- - Sweep from dirty map if resource is missing (#47)
13
+ Bug fixes
10
14
 
15
+ - Sweep the dirty map if a resource is missing (#47)
11
16
 
12
17
  ### 2.5.0 (2017-04-11)
13
18
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- routemaster-drain (2.5.1)
4
+ routemaster-drain (2.5.2)
5
5
  addressable
6
6
  concurrent-ruby
7
7
  faraday (>= 0.9.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routemaster-drain (2.5.1)
4
+ routemaster-drain (2.5.2)
5
5
  addressable
6
6
  concurrent-ruby
7
7
  faraday (>= 0.9.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routemaster-drain (2.5.1)
4
+ routemaster-drain (2.5.2)
5
5
  addressable
6
6
  concurrent-ruby
7
7
  faraday (>= 0.9.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- routemaster-drain (2.5.1)
4
+ routemaster-drain (2.5.2)
5
5
  addressable
6
6
  concurrent-ruby
7
7
  faraday (>= 0.9.0)
@@ -1,5 +1,5 @@
1
1
  module Routemaster
2
2
  module Drain
3
- VERSION = '2.5.1'
3
+ VERSION = '2.5.2'
4
4
  end
5
5
  end
@@ -3,18 +3,25 @@ require 'routemaster/dirty/map'
3
3
 
4
4
  module Routemaster
5
5
  module Jobs
6
- # Caches a URL using {Cache}, and sweeps the dirty map
7
- # if sucessful.
6
+ # Caches a URL using {Cache} and sweeps the dirty map if successful.
7
+ # Busts the cache if the resource was deleted.
8
8
  class CacheAndSweep
9
9
  def perform(url)
10
10
  Dirty::Map.new.sweep_one(url) do
11
11
  begin
12
- Routemaster::Cache.new.get(url)
12
+ cache.get(url)
13
13
  rescue Errors::ResourceNotFound
14
- true # nothing to cache, remove the element from dirty
14
+ cache.bust(url)
15
+ true
15
16
  end
16
17
  end
17
18
  end
19
+
20
+ private
21
+
22
+ def cache
23
+ @cache ||= Routemaster::Cache.new
24
+ end
18
25
  end
19
26
  end
20
27
  end
@@ -25,6 +25,14 @@ RSpec.describe Routemaster::Jobs::CacheAndSweep do
25
25
 
26
26
  subject.perform(url)
27
27
  end
28
+
29
+ it 'busts the cached version of the resource' do
30
+ expect_any_instance_of(Routemaster::Cache)
31
+ .to receive(:bust)
32
+ .with(url)
33
+
34
+ subject.perform(url)
35
+ end
28
36
  end
29
37
 
30
38
  context 'when there is any other error' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: routemaster-drain
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Letessier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-10 00:00:00.000000000 Z
11
+ date: 2017-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable