routemaster-drain 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc848f2c1b75d8d36a4807ac8d8f0d871f9fca29
4
- data.tar.gz: 5c627ab91e9497abb0acb81227484650f280853c
3
+ metadata.gz: aecf883ee9fee9d43fd2374f99ae2bc0e0d5be16
4
+ data.tar.gz: fe08306983c7c9a5f13fe6e0121b7426d97b3e0f
5
5
  SHA512:
6
- metadata.gz: fdcd9b0cb52cb767ac97d9b7df8b7c26c1ff92755487b7801748f488b3946c256079e441a8c9264768c858b3b12f70eed38b6a23fd93a2d48526a40642314445
7
- data.tar.gz: 2cb2c4af8600340854423def3364f3e1d4f3d51627765d2e6f8a4579e70c25ba31ee38058acf7b37941be52b4f00e1ad3d472ed9607590f4f242043b2d65b232
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: "kMxJcT8xyQ+QyCeKW5lDP44IU99Y8iN1AWZo9Z1BKN6HigGa8Ua8O/aD8AJjrTfRRSjnM402utmW6mk78RYVxJha3+69jJYr25I9EeyYhV2cuRu+5Ictxfcb9R9VhS0b6LDncz9h55xDS1UA35rvj+EOO4/M9moccw7T2qzPa2U="
16
+ secure: BOuoRqbmovhZUAs6mpYo8yXEaHwOvloXsCaVKr84Aub5l9GlyoaPeOs2HDGzWMLXVSI+N1Zf4or+tqWwrwnWhrqb2rj4yVd6tp/qm0V8ICw34W7RL30eWYe/Dcw2uGROAqn56xAj2pXZZY4qLb4dgoXitM+riHkq8rPvqohywZ0=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- routemaster-drain (1.0.0)
4
+ routemaster-drain (1.0.1)
5
5
  faraday
6
6
  faraday_middleware
7
7
  hashie
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:Caching.new
185
+ $app = Routemaster::Drain::Caching.new
181
186
  ```
182
187
 
183
188
  And mount it as usual:
@@ -1,5 +1,5 @@
1
1
  module Routemaster
2
2
  module Drain
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@ module Routemaster
7
7
  end
8
8
 
9
9
  def call(env)
10
- return [404, {}, []] if env['PATH_INFO'] != '/'
10
+ return [404, {}, []] unless ['', '/'].include? env['PATH_INFO']
11
11
  return [405, {}, []] if env['REQUEST_METHOD'] != 'POST'
12
12
  @app.call(env)
13
13
  end
@@ -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.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-09 00:00:00.000000000 Z
11
+ date: 2014-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday