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.
- data/lib/rad/http/_http.rb +1 -1
- data/lib/rad/http/_support/rack/rack_adapter.rb +7 -11
- data/lib/rad/profiles/web.rb +1 -1
- metadata +1 -1
data/lib/rad/http/_http.rb
CHANGED
@@ -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 :
|
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
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
data/lib/rad/profiles/web.rb
CHANGED
@@ -32,7 +32,7 @@ end
|
|
32
32
|
#
|
33
33
|
# Rack
|
34
34
|
#
|
35
|
-
rad.http.
|
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?
|