rack-app 1.2.2 → 1.3.0

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
  SHA1:
3
- metadata.gz: 49d070f222f0b343601261cc9973ea9d40ae5cf0
4
- data.tar.gz: 5b4e86d5c80ad7f7b1378502e4b805b35d6861f8
3
+ metadata.gz: fca80f5b9ca4da68fe2507408d9bb142e236d2d1
4
+ data.tar.gz: acf8ab44edd28baea4b8f913f0df04ddec39f002
5
5
  SHA512:
6
- metadata.gz: 162471909bed72184b5927fbb8df9c8bc3ba3d3c1b8ca910618883302042f048aa259d34daaa1645c491d0ebc5529d0963849bee92e2f137d900a6bac4687ab7
7
- data.tar.gz: 46000c17a77422904a9d42f760ef61c604599c1ba51c508414bbe436b03bacc31d9068960534f72cb1c25468dd9429b101a83aa6b364183ac8b2c59e31774a22
6
+ metadata.gz: e1d95e2f3444a0dc75d34a09089aba483c93196231da7356c7de7878321d8c180b2c0417484397da790f97ca8396df023c1c5ff84b6d5cd8010ef86ae1ebd4c5
7
+ data.tar.gz: 26d7e611e72d96347d522ad5795fa66c67a02bde3a02669662d21a074e30849d96680b7674f3078d11cedb2da874ed8453f83030787dcb0d6fb38d3a84e0a598
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.3.0
@@ -37,6 +37,14 @@ class Rack::App
37
37
 
38
38
  end
39
39
 
40
+ def on_mounted(&block)
41
+ @on_mounted ||= []
42
+ @on_mounted << block unless block.nil?
43
+ @on_mounted
44
+ end
45
+
46
+ alias while_being_mounted on_mounted
47
+
40
48
  def on_inheritance(&block)
41
49
  @on_inheritance ||= []
42
50
  @on_inheritance << block unless block.nil?
@@ -192,6 +200,10 @@ class Rack::App
192
200
  merge_prop = {:namespaces => [@namespaces, mount_prop[:to]].flatten}
193
201
  router.merge_router!(api_class.router, merge_prop)
194
202
 
203
+ api_class.on_mounted.each do |on_mount|
204
+ on_mount.call(self, mount_prop)
205
+ end
206
+
195
207
  return nil
196
208
  end
197
209
 
@@ -67,7 +67,6 @@ module Rack::App::Utils
67
67
  File.exist?(from_project_root_path) ? from_project_root_path : file_path
68
68
 
69
69
  end
70
-
71
70
  end
72
71
 
73
72
  def namespace_folder(file_path_info)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-02-28 00:00:00.000000000 Z
12
+ date: 2016-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler