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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53a69fc5a28793749c7acf92e4983e62b66cf971
4
- data.tar.gz: ff5d3562617a74d17dea829c34e94d717c68495e
3
+ metadata.gz: d36bd7e8c5db7454423ff5a080c407aad30dd67e
4
+ data.tar.gz: 604cd066e8145524a01d323f4c3e021445413722
5
5
  SHA512:
6
- metadata.gz: 11382b3009be877f54fface43c21f2e1235e267d7be3f2f8806ba6d6359db00f8e8bd8f5f872375c90386cf8e6bfe585338e1d5a71bd871632902b849cb4bebb
7
- data.tar.gz: 533c0a33bf3a36b53ee05fe63e3f342c4b413fd77f46c241c535ff58ec4011113071ab61a4440566edcf23d39ea5d0c204e5f56b55e4b8d506f0fca3ec3fe8e1
6
+ metadata.gz: 4a6a22af1494cf9092ba01005e959579c93d900b6ce76d7bfb81dace1515649bf0f8b9d7bbd32b09f550120edbafeb789e71ec3a410b24aa7a9893d0692f5534
7
+ data.tar.gz: 941cc3b8d7891810c44b7998592c7263ce4cf3325d654b9041e335474b2bf094446589d5abf104d304e2a3b5b758c4838b36c53822ff5ba2518f9cd211c64976
@@ -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!(self)
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
- def initialize(route)
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 from Dispatcher
104
- def run!(dispatcher)
105
- @ctrl = @route[:controller].new(dispatcher)
105
+ ## Execute route
106
+ def run!
106
107
  execute_hooks(:before)
107
- dispatcher.body @ctrl.send(@route[:action], *arranged_params)
108
+ @ctrl.body @ctrl.send(@route[:action], *arranged_params)
108
109
  execute_hooks(:after)
109
110
  end
110
111
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flame
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.1
4
+ version: 3.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov