restpack-web 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/restpack-web/app.rb +4 -6
- data/lib/restpack-web/version.rb +1 -1
- data/spec/restpack_web_spec.rb +3 -2
- metadata +1 -1
data/lib/restpack-web/app.rb
CHANGED
@@ -2,12 +2,12 @@ module RestPack
|
|
2
2
|
module Web
|
3
3
|
class App
|
4
4
|
attr_accessor :core_domain
|
5
|
-
def initialize(app)
|
5
|
+
def initialize(app, settings = {})
|
6
6
|
p "RestPack::Web::App.initialize"
|
7
7
|
@app = app
|
8
|
-
@
|
8
|
+
@settings = settings
|
9
9
|
|
10
|
-
|
10
|
+
p "settings: #{settings}"
|
11
11
|
end
|
12
12
|
|
13
13
|
def call(env)
|
@@ -15,9 +15,7 @@ module RestPack
|
|
15
15
|
host = env["SERVER_NAME"]
|
16
16
|
|
17
17
|
env["restpack"][:host] = host #TODO: GJ: add some magic
|
18
|
-
env["restpack"][:
|
19
|
-
|
20
|
-
|
18
|
+
env["restpack"][:settings] = @settings
|
21
19
|
|
22
20
|
@app.call(env)
|
23
21
|
end
|
data/lib/restpack-web/version.rb
CHANGED
data/spec/restpack_web_spec.rb
CHANGED
@@ -12,8 +12,9 @@ describe RestPack::Web do
|
|
12
12
|
|
13
13
|
let(:app) {
|
14
14
|
RestPack::Web::App.new(
|
15
|
-
lambda { |env| [200, {'Content-Type' => 'text/plain'}, 'hello there'] }
|
16
|
-
|
15
|
+
lambda { |env| [200, {'Content-Type' => 'text/plain'}, 'hello there'] },
|
16
|
+
{ :aa => 444}
|
17
|
+
)
|
17
18
|
}
|
18
19
|
|
19
20
|
it "returns a valid response" do
|