alephant-broker 1.2.0 → 1.2.1

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: ffbec731bdb53ec91a9c0d1b5194f3e45219e578
4
- data.tar.gz: 6ad479c7351251f7d160b5550f57e6ffc3767504
3
+ metadata.gz: 7188ad7416429b9e3644497b893e54d17cf18848
4
+ data.tar.gz: 600553f7caaceb30285b9454192211cdc8b49773
5
5
  SHA512:
6
- metadata.gz: 3038bc90069fd8a25168adb91aef80a7f5ed1388da0a6d726ea2d43d25abfa7d15522aff542097ab1372aae0e10a1c7d56bbb6f27888d83b99c92416ca02c6ac
7
- data.tar.gz: 3daadef81b28b9b6d7400d08703210f34ab7e8c8a4ae9dc3df72b664b5c72c438188f1d3d8c4ce85ca39c1a16d712ec9aeb15e73a0367ee2125d4da732ead062
6
+ metadata.gz: e880ac06f905b8d4e56b4ec9e25f601d2c0996bcd37321a25d3779c951139ab08c150499e6c5f688fa35505150b04cc7378e769c3ee6d7ea2ea8a7bb0595c4a3
7
+ data.tar.gz: 93191cbd238306a803f607520522d2ee02018c36fdb9d4e8c5435a2fed4a050a24ebb566a97e84a45cd1b4d834847ace817087f51ac6b6df2d9ba3096599a984
@@ -54,6 +54,7 @@ module Alephant
54
54
  response.status,
55
55
  {
56
56
  "Content-Type" => response.content_type,
57
+ "X-Sequence" => response.sequence.to_s,
57
58
  "X-Version" => response.version.to_s,
58
59
  "X-Cached" => response.cached.to_s
59
60
  }.merge(response.headers),
@@ -65,10 +66,11 @@ module Alephant
65
66
 
66
67
  def stop_poll_response
67
68
  response = OpenStruct.new(
68
- :status => 420,
69
- :content => "Stopped polling",
70
- :cached => false,
71
- :version => 0,
69
+ :status => 420,
70
+ :content => "Stopped polling",
71
+ :cached => false,
72
+ :version => 0,
73
+ :sequence => 0,
72
74
  :headers => {
73
75
  "Content-Type" => "plain/text",
74
76
  "X-Cached" => "false",
@@ -20,7 +20,7 @@ module Alephant
20
20
  @content = loaded_content[:body]
21
21
  @content_type = loaded_content[:content_type]
22
22
  @status = loaded_content[:status]
23
- @version = component.version.nil? ? 'not available' : component.version
23
+ @sequence = component.version.nil? ? 'not available' : component.version
24
24
  @cached = component.cached
25
25
  end
26
26
 
@@ -6,7 +6,7 @@ module Alephant
6
6
  module Response
7
7
  class Base
8
8
  attr_reader :headers
9
- attr_accessor :status, :content, :content_type, :version, :cached
9
+ attr_accessor :status, :content, :content_type, :version, :sequence, :cached
10
10
 
11
11
  STATUS_CODE_MAPPING = {
12
12
  200 => 'ok',
@@ -16,7 +16,8 @@ module Alephant
16
16
 
17
17
  def initialize(status = 200, content_type = "text/html")
18
18
  @headers = {}
19
- @version = 'not available'
19
+ @sequence = 'not available'
20
+ @version = Broker.config.fetch('elasticache_cache_version', 'not available').to_s
20
21
  @cached = false
21
22
  @content_type = content_type
22
23
  @status = status
@@ -31,6 +32,7 @@ module Alephant
31
32
  :content => @content,
32
33
  :content_type => @content_type,
33
34
  :version => @version,
35
+ :sequence => @sequence,
34
36
  :cached => @cached
35
37
  }
36
38
  end
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Broker
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack