rack-app 7.3.2 → 7.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rack/app/endpoint/builder.rb +17 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92598b6ab5871f755687a9719455f02f616c2566
|
4
|
+
data.tar.gz: cd34aafaf566ef166af275daeb02a4d133336998
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fb15c98af1024b361a429bfbc583e5799a538c9302c65d175db51d2d89d2870e7bf6a3c0f74806b9d8a266a4577dcb39809560278c0dd68f6ba12cd593d92c5
|
7
|
+
data.tar.gz: c614b65cce23478c9c2e1bc5723ad143b1859d0658d318735d89f694c029693bd6c22315f9e30ce72ddd3319e5b4a572e3b580dae3879078b4cf9f95b7085398
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.4.0
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'rack/builder'
|
3
4
|
class Rack::App::Endpoint::Builder
|
4
5
|
def initialize(config)
|
@@ -33,17 +34,28 @@ class Rack::App::Endpoint::Builder
|
|
33
34
|
end
|
34
35
|
builder.use(Rack::App::Middlewares::Configuration, @config)
|
35
36
|
|
36
|
-
|
37
|
+
apply_catcher_on_need(builder)
|
38
|
+
@config.ancestor_apps.reverse_each do |app_class|
|
39
|
+
apply_hook_middlewares(app_class, builder)
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
|
-
def
|
40
|
-
|
43
|
+
def apply_catcher_on_need(builder)
|
44
|
+
at_least_one_hook_requested = @config.ancestor_apps.any? do |app_class|
|
45
|
+
app_class.before.length + app_class.after.length > 0
|
46
|
+
end
|
47
|
+
|
48
|
+
if at_least_one_hook_requested
|
41
49
|
builder.use(Rack::App::Endpoint::Catcher, @config)
|
42
50
|
end
|
43
|
-
|
51
|
+
end
|
52
|
+
|
53
|
+
def apply_hook_middlewares(app_class, builder)
|
54
|
+
app_class.before.each do |before_block|
|
44
55
|
builder.use(Rack::App::Middlewares::Hooks::Before, before_block)
|
45
56
|
end
|
46
|
-
|
57
|
+
|
58
|
+
app_class.after.each do |after_block|
|
47
59
|
builder.use(Rack::App::Middlewares::Hooks::After, after_block)
|
48
60
|
end
|
49
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
version: '0'
|
227
227
|
requirements: []
|
228
228
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.6.
|
229
|
+
rubygems_version: 2.6.14
|
230
230
|
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: Your next favourite, performance designed micro framework!
|