restpack-web 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/restpack-web/app.rb +10 -8
- data/lib/restpack-web/version.rb +1 -1
- metadata +1 -1
data/lib/restpack-web/app.rb
CHANGED
@@ -11,18 +11,20 @@ module RestPack
|
|
11
11
|
@core_cache = RestPack::Core::Client::Cache.create(@settings[:core_domain], @settings[:password])
|
12
12
|
end
|
13
13
|
|
14
|
-
def call(env)
|
15
|
-
restpack = env[:restpack] ||= {}
|
16
|
-
host = env["SERVER_NAME"]
|
17
|
-
|
18
|
-
restpack[:host] = host
|
14
|
+
def call(env)
|
19
15
|
begin #TODO: GJ: cache should handle errors gracefully
|
16
|
+
env[:restpack] ||= {}
|
17
|
+
|
18
|
+
host = env["SERVER_NAME"]
|
19
|
+
|
20
|
+
restpack[:host] = host
|
21
|
+
|
20
22
|
channel = @core_cache.get_channel(host)
|
21
23
|
domain = channel.get_domain_by_host(host)
|
22
24
|
|
23
|
-
restpack[:channel] = channel
|
24
|
-
restpack[:application] = domain.application
|
25
|
-
restpack[:domain] = domain
|
25
|
+
env[:restpack][:channel] = channel
|
26
|
+
env[:restpack][:application] = domain.application
|
27
|
+
env[:restpack][:domain] = domain
|
26
28
|
rescue Exception => e
|
27
29
|
p e.message
|
28
30
|
p e.backtrace.inspect
|
data/lib/restpack-web/version.rb
CHANGED