routemaster-drain 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +9 -4
- data/lib/routemaster/drain.rb +1 -1
- data/lib/routemaster/middleware/root_post_only.rb +1 -1
- data/spec/routemaster/middleware/root_post_only_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aecf883ee9fee9d43fd2374f99ae2bc0e0d5be16
|
4
|
+
data.tar.gz: fe08306983c7c9a5f13fe6e0121b7426d97b3e0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27eac8c660ab567e70e581a1b17a265780bbf9ca8355548d7e34dc883d8771b8cee25fb27fd52a5c0ed65dec6259f48c737b525ea26696a928641ab20a991fec
|
7
|
+
data.tar.gz: a0377fb79564976979452703723cd64398450e263b633383d5475314bd8e5187bdeee9e8ceb380d5e5162bfe1f0425f43c31d4074d54120a4b2fa5ae2ab9a133
|
data/.travis.yml
CHANGED
@@ -13,4 +13,4 @@ after_script:
|
|
13
13
|
- "./rebund/run upload"
|
14
14
|
env:
|
15
15
|
global:
|
16
|
-
secure:
|
16
|
+
secure: BOuoRqbmovhZUAs6mpYo8yXEaHwOvloXsCaVKr84Aub5l9GlyoaPeOs2HDGzWMLXVSI+N1Zf4or+tqWwrwnWhrqb2rj4yVd6tp/qm0V8ICw34W7RL30eWYe/Dcw2uGROAqn56xAj2pXZZY4qLb4dgoXitM+riHkq8rPvqohywZ0=
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
A Rack-based event receiver for the
|
4
4
|
[Routemaster](https://github.com/HouseTrip/routemaster) event bus.
|
5
5
|
|
6
|
-
![Version](https://badge.fury.io/rb/routemaster-drain.svg)
|
6
|
+
[![Version](https://badge.fury.io/rb/routemaster-drain.svg)](https://rubygems.org/gems/routemaster-drain)
|
7
7
|
|
8
|
-
![Build](https://travis-ci.org/HouseTrip/routemaster-drain.svg?branch=master)
|
8
|
+
[![Build](https://travis-ci.org/HouseTrip/routemaster-drain.svg?branch=master)](https://travis-ci.org/HouseTrip/routemaster-drain)
|
9
9
|
|
10
|
-
[![](http://img.shields.io/badge/API%20docs-rubydoc.info-blue.svg)](http://rubydoc.info/github/HouseTrip/routemaster-drain/frames/file/README.md)
|
10
|
+
[![Docs](http://img.shields.io/badge/API%20docs-rubydoc.info-blue.svg)](http://rubydoc.info/github/HouseTrip/routemaster-drain/frames/file/README.md)
|
11
11
|
|
12
12
|
`routemaster-drain` is a collection of Rack middleware to receive and
|
13
13
|
parse Routemaster events, filter them, and preemptively cache the corresponding
|
@@ -45,8 +45,13 @@ Add this line to your application's Gemfile:
|
|
45
45
|
This gem is configured through the environment, making 12factor compliance
|
46
46
|
easier.
|
47
47
|
|
48
|
+
Required:
|
49
|
+
|
48
50
|
- `ROUTEMASTER_DRAIN_TOKENS`: a comma-separated list of valid authentication
|
49
51
|
tokens, used by Routemaster to send you events.
|
52
|
+
|
53
|
+
Optional:
|
54
|
+
|
50
55
|
- `ROUTEMASTER_DRAIN_REDIS`: the URL of the Redis instance used for filtering
|
51
56
|
and dirty mapping. Required if you use either feature, ignored otherwise.
|
52
57
|
A namespace can be specified.
|
@@ -177,7 +182,7 @@ For this purpose, use `Routemaster::Drain::Caching`:
|
|
177
182
|
|
178
183
|
```ruby
|
179
184
|
require 'routemaster/drain/machine'
|
180
|
-
$app = Routemaster::Drain
|
185
|
+
$app = Routemaster::Drain::Caching.new
|
181
186
|
```
|
182
187
|
|
183
188
|
And mount it as usual:
|
data/lib/routemaster/drain.rb
CHANGED
@@ -22,6 +22,22 @@ describe Routemaster::Middleware::RootPostOnly do
|
|
22
22
|
get '/why_not_even'
|
23
23
|
expect(last_response.status).to eq(404)
|
24
24
|
end
|
25
|
+
|
26
|
+
context 'when mounted under another path' do
|
27
|
+
let(:app) do
|
28
|
+
Rack::Builder.new do
|
29
|
+
map '/what' do
|
30
|
+
use Routemaster::Middleware::RootPostOnly
|
31
|
+
run ErrorRackApp.new
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'passes for POST to mountpoint' do
|
37
|
+
post '/what'
|
38
|
+
expect(last_response.status).to eq(501)
|
39
|
+
end
|
40
|
+
end
|
25
41
|
end
|
26
42
|
end
|
27
43
|
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|