rad_core 0.0.23 → 0.0.24

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.
@@ -6,6 +6,6 @@ class Rad::Http
6
6
  @rack_adapter, @http_adapter = Rad::Http::RackAdapter.new, Rad::Http::HttpAdapter.new
7
7
  end
8
8
 
9
- delegate :initialize_rack, :run, to: :rack_adapter
9
+ delegate :configure_rack!, :stack, :run, to: :rack_adapter
10
10
  delegate :call, :mock_environment, to: :http_adapter
11
11
  end
@@ -9,17 +9,13 @@ class Rad::Http::RackAdapter
9
9
  # class << self
10
10
  inject logger: :logger
11
11
 
12
- def initialize_rack builder = nil, &block
13
- @rack_configurations ||= []
14
- if block
15
- raise "provide configuration block!" unless block
16
- @rack_configurations << block
17
- else
18
- if @rack_configurations.empty?
19
- raise "Common App not defined! Use profiles (like rad/profiles/web), define it by yourself or use your own configuration!"
20
- end
21
- @rack_configurations.each{|conf| conf.call builder}
22
- end
12
+ def configure_rack! builder
13
+ raise "Rack stack not defined! Use profiles (see rad/profiles/web.rb), or use your own configuration!" if stack.empty?
14
+ stack.each{|conf| conf.call builder}
15
+ end
16
+
17
+ def stack
18
+ @rack_stack ||= []
23
19
  end
24
20
 
25
21
  def run app, host, port
@@ -32,7 +32,7 @@ end
32
32
  #
33
33
  # Rack
34
34
  #
35
- rad.http.initialize_rack do |builder|
35
+ rad.http.stack << labmda do |builder|
36
36
  # CommonLogger, ShowExceptions, Lint
37
37
  builder.use Rack::Lint if rad.development?
38
38
  # builder.use Rad::Middleware::StaticFiles if rad.http.static? and rad.http.public_path? and rad.development?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rad_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: