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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29ab9521da605cc10dd970e9f8736ee48804c212
4
- data.tar.gz: bd0a104987412fd77c16f7517ffc38a1ebc19504
3
+ metadata.gz: 92598b6ab5871f755687a9719455f02f616c2566
4
+ data.tar.gz: cd34aafaf566ef166af275daeb02a4d133336998
5
5
  SHA512:
6
- metadata.gz: 0cbbcc149f4d751691b86db4183687e1a787768dab8fafbd172d83988dc91f27d0c6b631a83afbfb995b573d7e5d05d8db4314ee45d1afd7a131b928451b626a
7
- data.tar.gz: 4213b29c6b75f3e3f812252ffa0a6a5522d2a1383a0c7b98b68e9385087ef71ca18cd5211b254bcde881131395403167fd8f92217ddb405d1abd5eec43755bab
6
+ metadata.gz: 2fb15c98af1024b361a429bfbc583e5799a538c9302c65d175db51d2d89d2870e7bf6a3c0f74806b9d8a266a4577dcb39809560278c0dd68f6ba12cd593d92c5
7
+ data.tar.gz: c614b65cce23478c9c2e1bc5723ad143b1859d0658d318735d89f694c029693bd6c22315f9e30ce72ddd3319e5b4a572e3b580dae3879078b4cf9f95b7085398
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.3.2
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
- apply_hook_middlewares(builder)
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 apply_hook_middlewares(builder)
40
- if @config.app_class.before.length + @config.app_class.after.length > 0
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
- @config.app_class.before.each do |before_block|
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
- @config.app_class.after.each do |after_block|
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.3.2
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-08-11 00:00:00.000000000 Z
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.8
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!