alephant-broker 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7c2a4bd832e9620f656243342fb612dd1abef6d
|
4
|
+
data.tar.gz: 473481c1bb7c731e2c5e7e85aa5a27e8d730d279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a89f89e007355da7bc32af8cfae1b105a38ae0d9dfa866b56eaf0bab89647a4ecdab9a891fe884c64985103b0e65aa05a04f63eb472f9cf690ff32a132f9301
|
7
|
+
data.tar.gz: bdbe66a5a920843cfecb4ba5292aa65b88f93df3f332b9e4c6fca9030b77c5e99a2f05e4b2a2f3b6d6d89015353c74a5021369482b12aa8703de074c312e62d9
|
data/lib/alephant/broker.rb
CHANGED
@@ -38,7 +38,11 @@ module Alephant
|
|
38
38
|
def send(response)
|
39
39
|
[
|
40
40
|
response.status,
|
41
|
-
{
|
41
|
+
{
|
42
|
+
"Content-Type" => response.content_type,
|
43
|
+
"X-Version" => response.version.to_s,
|
44
|
+
"X-Cached" => response.cached.to_s
|
45
|
+
},
|
42
46
|
[ response.content.to_s ]
|
43
47
|
]
|
44
48
|
end
|
@@ -12,17 +12,19 @@ module Alephant
|
|
12
12
|
class Component
|
13
13
|
include Logger
|
14
14
|
|
15
|
-
attr_reader :id, :batch_id, :options, :content
|
15
|
+
attr_reader :id, :batch_id, :options, :content, :cached
|
16
16
|
|
17
17
|
def initialize(id, batch_id, options)
|
18
18
|
@id = id
|
19
19
|
@batch_id = batch_id
|
20
20
|
@cache = Cache::Client.new
|
21
21
|
@options = symbolize(options || {})
|
22
|
+
@cached = true
|
22
23
|
end
|
23
24
|
|
24
25
|
def load
|
25
26
|
@content ||= @cache.get(cache_key) do
|
27
|
+
@cached = false
|
26
28
|
s3.get(s3_path)
|
27
29
|
end
|
28
30
|
end
|
@@ -15,10 +15,12 @@ module Alephant
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def setup
|
18
|
-
result = load(component)
|
19
18
|
|
19
|
+
result = load(component)
|
20
20
|
@status = result['status']
|
21
21
|
@content = result['body']
|
22
|
+
@version = component.version.nil? ? 'not available' : component.version
|
23
|
+
@cached = component.cached
|
22
24
|
end
|
23
25
|
|
24
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant-broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|