flame 3.6.1 → 3.6.2
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 +4 -4
- data/lib/flame/dispatcher.rb +3 -3
- data/lib/flame/route.rb +8 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d36bd7e8c5db7454423ff5a080c407aad30dd67e
|
4
|
+
data.tar.gz: 604cd066e8145524a01d323f4c3e021445413722
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a6a22af1494cf9092ba01005e959579c93d900b6ce76d7bfb81dace1515649bf0f8b9d7bbd32b09f550120edbafeb789e71ec3a410b24aa7a9893d0692f5534
|
7
|
+
data.tar.gz: 941cc3b8d7891810c44b7998592c7263ce4cf3325d654b9041e335474b2bf094446589d5abf104d304e2a3b5b758c4838b36c53822ff5ba2518f9cd211c64976
|
data/lib/flame/dispatcher.rb
CHANGED
@@ -105,8 +105,8 @@ module Flame
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def execute_route(route)
|
108
|
-
exec_route = route.executable
|
109
|
-
exec_route.run!
|
108
|
+
exec_route = route.executable(self)
|
109
|
+
exec_route.run!
|
110
110
|
rescue => exception
|
111
111
|
dump_error(exception)
|
112
112
|
# status 500
|
@@ -118,7 +118,7 @@ module Flame
|
|
118
118
|
status error_status if error_status
|
119
119
|
unless exec_route
|
120
120
|
route = nearest_route_for_request unless exec_route
|
121
|
-
exec_route = route.executable if route
|
121
|
+
exec_route = route.executable(self) if route
|
122
122
|
end
|
123
123
|
exec_route.execute_errors(status) if exec_route
|
124
124
|
halt
|
data/lib/flame/route.rb
CHANGED
@@ -18,8 +18,8 @@ module Flame
|
|
18
18
|
end
|
19
19
|
|
20
20
|
## Create Executable object (route)
|
21
|
-
def executable
|
22
|
-
Executable.new(self)
|
21
|
+
def executable(dispatcher)
|
22
|
+
Executable.new(self, dispatcher)
|
23
23
|
end
|
24
24
|
|
25
25
|
## Compare attributes for `Router.find_route`
|
@@ -96,15 +96,16 @@ module Flame
|
|
96
96
|
|
97
97
|
## Class for Route execution
|
98
98
|
class Executable
|
99
|
-
|
99
|
+
## Create executable route with dispatcher
|
100
|
+
def initialize(route, dispatcher)
|
100
101
|
@route = route
|
102
|
+
@ctrl = @route[:controller].new(dispatcher)
|
101
103
|
end
|
102
104
|
|
103
|
-
## Execute route
|
104
|
-
def run!
|
105
|
-
@ctrl = @route[:controller].new(dispatcher)
|
105
|
+
## Execute route
|
106
|
+
def run!
|
106
107
|
execute_hooks(:before)
|
107
|
-
|
108
|
+
@ctrl.body @ctrl.send(@route[:action], *arranged_params)
|
108
109
|
execute_hooks(:after)
|
109
110
|
end
|
110
111
|
|