rack-berater 0.3.0 → 0.3.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
  SHA256:
3
- metadata.gz: 5840eaff6319d5e24c78c2f50960138ca27fcce25bb3d45354e7eca195b50f0d
4
- data.tar.gz: f9cdde9f38c97d82e03d6a1e9cea2e1939eaca13f4202a2a674a6fda4e6f530e
3
+ metadata.gz: 0b726fd0709ef54111d4e767fbe040ad3ab05fd0b0426bae20c67ef41f6fc869
4
+ data.tar.gz: 666a443527911b61660208f5e6ebf09b2a7adf298c67cb157665988c32868623
5
5
  SHA512:
6
- metadata.gz: b0f561957104a0d049d161b720615a97474439c41f16507b3bd34a1f68269fccbea314f54736393a5e030abdf755de8ae30bc5a92724502371728975b6cf7460
7
- data.tar.gz: f91a4cb03f24b7c18554c8145375a78f1b61cc66a2d99a0841ddca4b547dc97822bd99dfe9267ae1feeb01d3e2c8eba72d70ea075d367671f3e2077e404a8e36
6
+ metadata.gz: f5bfe591019a79137181785ae76f6e5603b3495cc5ef8e207eab1be88bec114988bbe190509752e093aa1458ecd2ce11dd91dcd4a31fe96b9c00e94f62a931ea
7
+ data.tar.gz: a83f26c06eeeb1c570233b1b84bdec1dadf501e8774a388290dd6c733fd2c095435f86974b4f27216ffbd118e261206097ac3f16187dfeb2f2da8eb03adb9657
@@ -55,8 +55,11 @@ module Rack
55
55
  req_method = env[Rack::REQUEST_METHOD].downcase
56
56
  path = ''
57
57
 
58
- if defined?(Rails) && Rails.application
59
- res = Rails.application.routes.recognize_path(env[Rack::PATH_INFO])
58
+ if defined?(Rails) && Rails.respond_to?(:application) && Rails.application
59
+ res = Rails.application.routes.recognize_path(
60
+ env[Rack::PATH_INFO],
61
+ method: env[Rack::REQUEST_METHOD],
62
+ )
60
63
  path = res.values_at(:controller, :action).compact.join('#')
61
64
  end
62
65
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Berater
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -248,7 +248,7 @@ describe Rack::Berater::Prioritizer do
248
248
  Rails.application.routes.draw do
249
249
  get '/' => 'echo#index'
250
250
  get '/six' => 'echo#six'
251
- get '/nine' => 'echo#nine'
251
+ post '/nine' => 'echo#nine'
252
252
  end
253
253
  end
254
254
 
@@ -280,15 +280,15 @@ describe Rack::Berater::Prioritizer do
280
280
  context 'when the app returns a priority' do
281
281
  it 'does not know the first time the controller is called' do
282
282
  expect(get('/six').body).to be_empty
283
- expect(get('/nine').body).to be_empty
283
+ expect(post('/nine').body).to be_empty
284
284
  end
285
285
 
286
286
  it 'caches the repsonses for the second time' do
287
287
  expect(get('/six').body).to be_empty
288
- expect(get('/nine').body).to be_empty
288
+ expect(post('/nine').body).to be_empty
289
289
 
290
290
  expect(get('/six').body).to eq '6'
291
- expect(get('/nine').body).to eq '9'
291
+ expect(post('/nine').body).to eq '9'
292
292
  end
293
293
  end
294
294
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-berater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2021-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: berater