flame 3.3.4 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/flame/application.rb +4 -23
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e0db91f0d0f3aa52afc2ca16e70829d42b83148
4
- data.tar.gz: 654955ee8ab44693297c4ec6949413de930edc65
3
+ metadata.gz: e91ac518b94afb516a97c8ed22a63c7e6381dc0e
4
+ data.tar.gz: 187942692b4872a65869011f43153275e6faff36
5
5
  SHA512:
6
- metadata.gz: 379507397d57b13962c921e30bc67c0ca4ec22a234da8fe6d3431e5916950fb9a444af078037d9320f008e68b9e116f687a788d06d2839afc7fc0f39e068b4c7
7
- data.tar.gz: dbaa9b8f502c024f6f05e518390fcf2e566565f0d548eb5bb1dd09f74d365769b1e8f6fb4a68adb887e11bcaeaa25d7ca8d181dda80d9ab7528abec8ee92f805
6
+ metadata.gz: 21d8513b6c528d7b3b576f7cab5aedfe51ddd66c8b18cf451a0f6049ca7ef5b974c4668732c46c29e9c42c7a14c8b18943908c2f9493cfedb273071aa0ad5f61
7
+ data.tar.gz: b78b9c72ba68ad431d27877776814261c4b74fd9b1e5b5c14d75a055c5f96c02ce2652e317b5d4b9fc70df0f76ffd68d8223b6f2e63692c5381e97d3309918e5
@@ -23,41 +23,22 @@ module Flame
23
23
  environment: ENV['RACK_ENV'] || 'development'
24
24
  )
25
25
  )
26
- # app.use Rack::Session::Pool
27
26
  end
28
27
 
29
- def initialize
30
- app = self
31
- @builder = Rack::Builder.new do
32
- app.class.middlewares.each do |m|
33
- use m[:class], *m[:args], &m[:block]
34
- end
35
- run app
36
- end
28
+ def self.call(env)
29
+ @app ||= new
30
+ @app.call env
37
31
  end
38
32
 
39
33
  ## Init function
40
34
  def call(env)
41
- if env[:FLAME_CALL]
42
- Flame::Dispatcher.new(self, env).run!
43
- else
44
- env[:FLAME_CALL] = true
45
- @builder.call env
46
- end
35
+ Flame::Dispatcher.new(self, env).run!
47
36
  end
48
37
 
49
38
  def self.mount(ctrl, path = nil, &block)
50
39
  router.add_controller(ctrl, path, block)
51
40
  end
52
41
 
53
- def self.middlewares
54
- @middlewares ||= []
55
- end
56
-
57
- def self.use(middleware, *args, &block)
58
- middlewares << { class: middleware, args: args, block: block }
59
- end
60
-
61
42
  def self.helpers(*modules)
62
43
  modules.empty? ? (@helpers ||= []) : @helpers = modules
63
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flame
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-10 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.4.5.1
106
+ rubygems_version: 2.5.1
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Web-framework, based on MVC-pattern