routemaster-drain 2.5.0 → 2.5.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 +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +2 -2
- 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/drain/cache_busting.rb +2 -0
- data/lib/routemaster/jobs/cache_and_sweep.rb +1 -1
- data/lib/routemaster/middleware/dirty.rb +1 -0
- data/spec/routemaster/drain/cache_busting_spec.rb +8 -3
- data/spec/routemaster/jobs/cache_and_sweep_spec.rb +15 -2
- 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: 7a8ad60bfee0918ed21059151f9766548347337c
         | 
| 4 | 
            +
              data.tar.gz: b6522a49633aca5590802c36cb072cec0d667fd4
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d05a881d29704c66cb409799d6de1503632f486be0a8b8dab6fd6012f824a170e5d96ab5827314094a10d5bb12e7b0579f7844cf48366743100f9d734ceae080
         | 
| 7 | 
            +
              data.tar.gz: b574538c1c40e6c16c4d09fdb4ccacca3f6214f1b9088cdf4fa1de2d87d8b82fff1955ecf55b0e2208a8aaaa11a9db499f4dd32a73d4ad2ced5564a8c7e7e17b
         | 
    
        data/.rubocop.yml
    CHANGED
    
    | @@ -716,7 +716,7 @@ Style/LineEndConcatenation: | |
| 716 716 | 
             
                             line end.
         | 
| 717 717 | 
             
              Enabled: false
         | 
| 718 718 |  | 
| 719 | 
            -
            Style/ | 
| 719 | 
            +
            Style/MethodCallWithoutArgsParentheses:
         | 
| 720 720 | 
             
              Description: 'Do not use parentheses for method calls with no arguments.'
         | 
| 721 721 | 
             
              StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
         | 
| 722 722 | 
             
              Enabled: false
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                routemaster-drain (2.5. | 
| 4 | 
            +
                routemaster-drain (2.5.1)
         | 
| 5 5 | 
             
                  addressable
         | 
| 6 6 | 
             
                  concurrent-ruby
         | 
| 7 7 | 
             
                  faraday (>= 0.9.0)
         | 
| @@ -37,7 +37,7 @@ GEM | |
| 37 37 | 
             
                dotenv (2.1.1)
         | 
| 38 38 | 
             
                ethon (0.10.1)
         | 
| 39 39 | 
             
                  ffi (>= 1.3.0)
         | 
| 40 | 
            -
                faraday (0.12. | 
| 40 | 
            +
                faraday (0.12.1)
         | 
| 41 41 | 
             
                  multipart-post (>= 1.2, < 3)
         | 
| 42 42 | 
             
                faraday_middleware (0.11.0.1)
         | 
| 43 43 | 
             
                  faraday (>= 0.7.4, < 1.0)
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: ..
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                routemaster-drain (2.5. | 
| 4 | 
            +
                routemaster-drain (2.5.1)
         | 
| 5 5 | 
             
                  addressable
         | 
| 6 6 | 
             
                  concurrent-ruby
         | 
| 7 7 | 
             
                  faraday (>= 0.9.0)
         | 
| @@ -67,7 +67,7 @@ GEM | |
| 67 67 | 
             
                erubis (2.7.0)
         | 
| 68 68 | 
             
                ethon (0.10.1)
         | 
| 69 69 | 
             
                  ffi (>= 1.3.0)
         | 
| 70 | 
            -
                faraday (0.12. | 
| 70 | 
            +
                faraday (0.12.1)
         | 
| 71 71 | 
             
                  multipart-post (>= 1.2, < 3)
         | 
| 72 72 | 
             
                faraday_middleware (0.11.0.1)
         | 
| 73 73 | 
             
                  faraday (>= 0.7.4, < 1.0)
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: ..
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                routemaster-drain (2.5. | 
| 4 | 
            +
                routemaster-drain (2.5.1)
         | 
| 5 5 | 
             
                  addressable
         | 
| 6 6 | 
             
                  concurrent-ruby
         | 
| 7 7 | 
             
                  faraday (>= 0.9.0)
         | 
| @@ -74,7 +74,7 @@ GEM | |
| 74 74 | 
             
                erubis (2.7.0)
         | 
| 75 75 | 
             
                ethon (0.10.1)
         | 
| 76 76 | 
             
                  ffi (>= 1.3.0)
         | 
| 77 | 
            -
                faraday (0.12. | 
| 77 | 
            +
                faraday (0.12.1)
         | 
| 78 78 | 
             
                  multipart-post (>= 1.2, < 3)
         | 
| 79 79 | 
             
                faraday_middleware (0.11.0.1)
         | 
| 80 80 | 
             
                  faraday (>= 0.7.4, < 1.0)
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: ..
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                routemaster-drain (2.5. | 
| 4 | 
            +
                routemaster-drain (2.5.1)
         | 
| 5 5 | 
             
                  addressable
         | 
| 6 6 | 
             
                  concurrent-ruby
         | 
| 7 7 | 
             
                  faraday (>= 0.9.0)
         | 
| @@ -77,7 +77,7 @@ GEM | |
| 77 77 | 
             
                erubis (2.7.0)
         | 
| 78 78 | 
             
                ethon (0.10.1)
         | 
| 79 79 | 
             
                  ffi (>= 1.3.0)
         | 
| 80 | 
            -
                faraday (0.12. | 
| 80 | 
            +
                faraday (0.12.1)
         | 
| 81 81 | 
             
                  multipart-post (>= 1.2, < 3)
         | 
| 82 82 | 
             
                faraday_middleware (0.11.0.1)
         | 
| 83 83 | 
             
                  faraday (>= 0.7.4, < 1.0)
         | 
    
        data/lib/routemaster/drain.rb
    CHANGED
    
    
| @@ -1,6 +1,7 @@ | |
| 1 1 | 
             
            require 'routemaster/middleware/root_post_only'
         | 
| 2 2 | 
             
            require 'routemaster/middleware/authenticate'
         | 
| 3 3 | 
             
            require 'routemaster/middleware/parse'
         | 
| 4 | 
            +
            require 'routemaster/middleware/siphon'
         | 
| 4 5 | 
             
            require 'routemaster/middleware/expire_cache'
         | 
| 5 6 | 
             
            require 'routemaster/middleware/payload_filter'
         | 
| 6 7 | 
             
            require 'routemaster/middleware/filter'
         | 
| @@ -25,6 +26,7 @@ module Routemaster | |
| 25 26 | 
             
                      use Middleware::RootPostOnly
         | 
| 26 27 | 
             
                      use Middleware::Authenticate, options
         | 
| 27 28 | 
             
                      use Middleware::Parse
         | 
| 29 | 
            +
                      use Middleware::Siphon,       options
         | 
| 28 30 | 
             
                      use Middleware::Filter, { filter: Routemaster::Middleware::PayloadFilter.new }.merge(options)
         | 
| 29 31 | 
             
                      use Middleware::ExpireCache
         | 
| 30 32 | 
             
                      run terminator
         | 
| @@ -3,6 +3,8 @@ require 'spec/support/rack_test' | |
| 3 3 | 
             
            require 'spec/support/uses_redis'
         | 
| 4 4 | 
             
            require 'spec/support/uses_dotenv'
         | 
| 5 5 | 
             
            require 'spec/support/events'
         | 
| 6 | 
            +
            require 'spec/support/siphon'
         | 
| 7 | 
            +
             | 
| 6 8 | 
             
            require 'routemaster/drain/cache_busting'
         | 
| 7 9 | 
             
            require 'json'
         | 
| 8 10 |  | 
| @@ -10,18 +12,21 @@ describe Routemaster::Drain::CacheBusting do | |
| 10 12 | 
             
              uses_dotenv
         | 
| 11 13 | 
             
              uses_redis
         | 
| 12 14 |  | 
| 13 | 
            -
              let(:app) { described_class.new }
         | 
| 15 | 
            +
              let(:app) { described_class.new options }
         | 
| 14 16 | 
             
              let(:listener) { double 'listener' }
         | 
| 17 | 
            +
              let(:options) { {} }
         | 
| 15 18 |  | 
| 16 19 | 
             
              before { app.subscribe(listener, prefix: true) }
         | 
| 17 20 |  | 
| 18 21 | 
             
              let(:path)    { '/' }
         | 
| 19 | 
            -
              let(:payload) { [1,2,3,1].map { |idx| make_event(idx) } | 
| 22 | 
            +
              let(:payload) { [1,2,3,1].map { |idx| make_event(idx) } }
         | 
| 20 23 | 
             
              let(:environment) {{ 'CONTENT_TYPE' => 'application/json' }}
         | 
| 21 | 
            -
              let(:perform) { post path, payload, environment }
         | 
| 24 | 
            +
              let(:perform) { post path, payload.to_json, environment }
         | 
| 22 25 |  | 
| 23 26 | 
             
              before { authorize 'd3m0', 'x' }
         | 
| 24 27 |  | 
| 28 | 
            +
              include_examples 'supports siphon'
         | 
| 29 | 
            +
             | 
| 25 30 | 
             
              it 'succeeds' do
         | 
| 26 31 | 
             
                perform
         | 
| 27 32 | 
             
                expect(last_response.status).to eq(204)
         | 
| @@ -1,16 +1,29 @@ | |
| 1 1 | 
             
            require 'routemaster/jobs/cache_and_sweep'
         | 
| 2 | 
            +
            require 'routemaster/dirty/map'
         | 
| 2 3 | 
             
            require 'spec_helper'
         | 
| 3 4 |  | 
| 4 5 | 
             
            RSpec.describe Routemaster::Jobs::CacheAndSweep do
         | 
| 6 | 
            +
              let(:url) { 'https://example.com/foo' }
         | 
| 7 | 
            +
             | 
| 5 8 | 
             
              subject { described_class.new }
         | 
| 6 9 |  | 
| 7 10 | 
             
              context 'when there is an ResourceNotFound error' do
         | 
| 8 11 | 
             
                before do
         | 
| 9 | 
            -
                   | 
| 12 | 
            +
                  allow_any_instance_of(Routemaster::Cache)
         | 
| 13 | 
            +
                    .to receive(:get)
         | 
| 14 | 
            +
                    .and_raise(Routemaster::Errors::ResourceNotFound.new(""))
         | 
| 10 15 | 
             
                end
         | 
| 11 16 |  | 
| 12 17 | 
             
                it 'does not bubble up the error' do
         | 
| 13 | 
            -
                  expect { subject.perform( | 
| 18 | 
            +
                  expect { subject.perform(url) }.to_not raise_error
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                it 'sweeps the resource from the dirty map' do
         | 
| 22 | 
            +
                  expect_any_instance_of(Routemaster::Dirty::Map)
         | 
| 23 | 
            +
                    .to receive(:sweep_one)
         | 
| 24 | 
            +
                    .with(url) { |&block| expect(block.call).to eq true }
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                  subject.perform(url)
         | 
| 14 27 | 
             
                end
         | 
| 15 28 | 
             
              end
         | 
| 16 29 |  | 
    
        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. | 
| 4 | 
            +
              version: 2.5.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: 2017- | 
| 11 | 
            +
            date: 2017-05-10 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: addressable
         |