routemaster-drain 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/Gemfile.lock +1 -1
- data/gemfiles/rails_3.gemfile.lock +2 -2
- data/gemfiles/rails_4.gemfile.lock +2 -2
- data/gemfiles/rails_5.gemfile.lock +2 -2
- data/lib/routemaster/drain.rb +1 -1
- data/lib/routemaster/jobs/cache_and_sweep.rb +4 -1
- data/lib/routemaster/responses/hateoas_response.rb +4 -0
- data/spec/routemaster/jobs/cache_and_sweep_spec.rb +26 -0
- data/spec/routemaster/responses/hateoas_response_spec.rb +10 -0
- data/spec/spec_helper.rb +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fd71f8707bbb1dcb850a267cd9d34c739848464
|
4
|
+
data.tar.gz: ac8e9c641add1bf27d1eee9f96d7299d6ce7f686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a248eb16c4595c21ea88f19331fd61e47e4a63b5a2a30eae0617201f4a4c854e5fc5baf8de632ab4b4ae72e2d1fa015b25305ffcdd9e988c71d4daff818adca
|
7
|
+
data.tar.gz: b1b5d6c5ca784b7dbd21f14a63640c78c7f1fa422fe492f0aaa9a4d2b4d84cbc93b2c701194ded0bf96f74a3a771fc6ce50eabd307ed3bc73dd3f1182ac32fb6
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
+
### 2.3.0 (2017-01-16)
|
2
|
+
|
3
|
+
- Add #has? method on HateoasResponse of identifying resource without invocation
|
4
|
+
- Fix 404 breaking CacheAndSweep job run
|
5
|
+
|
1
6
|
### 2.2.2 (2017-01-10)
|
2
7
|
|
3
8
|
- Fix logging for error responses:
|
4
9
|
For unsuccessful responses rescue the raised error and
|
5
10
|
send increment signal to metrics backend
|
6
11
|
- Add Telemetry support for requests and responses
|
7
|
-
- Add support for PATCH requests.
|
12
|
+
- Add support for PATCH requests.
|
8
13
|
Invalidate cached response (if any) on PATCH
|
9
14
|
|
10
15
|
### 2.0.0 (2016-12-14)
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
routemaster-drain (2.
|
4
|
+
routemaster-drain (2.3.0)
|
5
5
|
faraday (>= 0.9.0)
|
6
6
|
faraday_middleware
|
7
7
|
hashie
|
@@ -61,7 +61,7 @@ GEM
|
|
61
61
|
docile (1.1.5)
|
62
62
|
dotenv (2.1.1)
|
63
63
|
erubis (2.7.0)
|
64
|
-
faraday (0.10.
|
64
|
+
faraday (0.10.1)
|
65
65
|
multipart-post (>= 1.2, < 3)
|
66
66
|
faraday_middleware (0.10.1)
|
67
67
|
faraday (>= 0.7.4, < 1.0)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
routemaster-drain (2.
|
4
|
+
routemaster-drain (2.3.0)
|
5
5
|
faraday (>= 0.9.0)
|
6
6
|
faraday_middleware
|
7
7
|
hashie
|
@@ -58,7 +58,7 @@ GEM
|
|
58
58
|
docile (1.1.5)
|
59
59
|
dotenv (2.1.1)
|
60
60
|
erubis (2.7.0)
|
61
|
-
faraday (0.10.
|
61
|
+
faraday (0.10.1)
|
62
62
|
multipart-post (>= 1.2, < 3)
|
63
63
|
faraday_middleware (0.10.1)
|
64
64
|
faraday (>= 0.7.4, < 1.0)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
routemaster-drain (2.
|
4
|
+
routemaster-drain (2.3.0)
|
5
5
|
faraday (>= 0.9.0)
|
6
6
|
faraday_middleware
|
7
7
|
hashie
|
@@ -71,7 +71,7 @@ GEM
|
|
71
71
|
docile (1.1.5)
|
72
72
|
dotenv (2.1.1)
|
73
73
|
erubis (2.7.0)
|
74
|
-
faraday (0.10.
|
74
|
+
faraday (0.10.1)
|
75
75
|
multipart-post (>= 1.2, < 3)
|
76
76
|
faraday_middleware (0.10.1)
|
77
77
|
faraday (>= 0.7.4, < 1.0)
|
data/lib/routemaster/drain.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'routemaster/jobs/cache_and_sweep'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
RSpec.describe Routemaster::Jobs::CacheAndSweep do
|
5
|
+
subject { described_class.new }
|
6
|
+
|
7
|
+
context 'when there is an ResourceNotFound error' do
|
8
|
+
before do
|
9
|
+
expect_any_instance_of(Routemaster::Cache).to receive(:get).and_raise(Routemaster::Errors::ResourceNotFound.new(""))
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'does not bubble up the error' do
|
13
|
+
expect { subject.perform('url') }.to_not raise_error
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when there is any other error' do
|
18
|
+
before do
|
19
|
+
expect_any_instance_of(Routemaster::Cache).to receive(:get).and_raise("boom")
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'does bubble up the error' do
|
23
|
+
expect { subject.perform('url') }.to raise_error("boom")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -44,6 +44,16 @@ module Routemaster
|
|
44
44
|
expect(subject.body_without_links).to eq({ 'foo' => 'bar' })
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
describe '#has?' do
|
49
|
+
it 'returns true for an existing link' do
|
50
|
+
expect(subject.has?(:resource_a)).to be_truthy
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'returns false for a non existing link' do
|
54
|
+
expect(subject.has?(:other_resource)).to be_falsy
|
55
|
+
end
|
56
|
+
end
|
47
57
|
end
|
48
58
|
end
|
49
59
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,9 @@ require 'simplecov'
|
|
2
2
|
SimpleCov.start
|
3
3
|
|
4
4
|
require 'byebug'
|
5
|
+
require 'sidekiq/testing'
|
6
|
+
require 'dotenv'
|
7
|
+
Dotenv.overload('.env.test')
|
5
8
|
|
6
9
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
7
10
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
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.
|
4
|
+
version: 2.3.0
|
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-01-
|
11
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- spec/routemaster/jobs/backends/backend_examples.rb
|
197
197
|
- spec/routemaster/jobs/backends/resque_spec.rb
|
198
198
|
- spec/routemaster/jobs/backends/sidekiq_spec.rb
|
199
|
+
- spec/routemaster/jobs/cache_and_sweep_spec.rb
|
199
200
|
- spec/routemaster/jobs/client_spec.rb
|
200
201
|
- spec/routemaster/middleware/authenticate_spec.rb
|
201
202
|
- spec/routemaster/middleware/cache_spec.rb
|
@@ -252,6 +253,7 @@ test_files:
|
|
252
253
|
- spec/routemaster/jobs/backends/backend_examples.rb
|
253
254
|
- spec/routemaster/jobs/backends/resque_spec.rb
|
254
255
|
- spec/routemaster/jobs/backends/sidekiq_spec.rb
|
256
|
+
- spec/routemaster/jobs/cache_and_sweep_spec.rb
|
255
257
|
- spec/routemaster/jobs/client_spec.rb
|
256
258
|
- spec/routemaster/middleware/authenticate_spec.rb
|
257
259
|
- spec/routemaster/middleware/cache_spec.rb
|