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.
@@ -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
@@ -1,5 +1,5 @@
1
1
  module RestPack
2
2
  module Web
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: