rack-berater 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/berater/prioritizer.rb +5 -2
- data/lib/rack/berater/version.rb +1 -1
- data/spec/prioritizer_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b726fd0709ef54111d4e767fbe040ad3ab05fd0b0426bae20c67ef41f6fc869
|
4
|
+
data.tar.gz: 666a443527911b61660208f5e6ebf09b2a7adf298c67cb157665988c32868623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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
|
|
data/lib/rack/berater/version.rb
CHANGED
data/spec/prioritizer_spec.rb
CHANGED
@@ -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
|
-
|
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(
|
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(
|
288
|
+
expect(post('/nine').body).to be_empty
|
289
289
|
|
290
290
|
expect(get('/six').body).to eq '6'
|
291
|
-
expect(
|
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.
|
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-
|
11
|
+
date: 2021-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: berater
|