consul-templaterb 1.9.4 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a838b58bd969446e1469ebef427c75f274a20f2120286495c1749dc8ad01e9f3
4
- data.tar.gz: 3c7f4961230c1f5c0496a3d4e6f7e0ace0e757c28ade29c0a88afaffc01709cc
3
+ metadata.gz: 641ec7ace0ee7b0bdad06b8cbaef7ceba31b520f0302ef3504cee674e48344ed
4
+ data.tar.gz: 7d996fff12f90c62b9a402342ad4b51265ae2dc59df53cdd9ee3774aabe62b29
5
5
  SHA512:
6
- metadata.gz: 54363ba53cc8aee04b9fbccee5245e4b975837f1432feffca505ed41d25a7409e067cfb26f26ef4d98348b24fcc8e3110a84f56e8508de38ba81dcd35596c316
7
- data.tar.gz: f2cf52f9f6d2d7529de619195a691ba61e55b9c28cbff923a785d128b5255c132d4789b91284b1f952d0d9a685341e786aef1178a14b3796c44e9d2a3bf5d4b3
6
+ metadata.gz: 5f904d40d4b51ca467ac13455bca0047ead220e2377143b33d610b44479b5d480ca5cec055f4628de2bde86df03711d56c3c65f5bd870b4ea3ad4a0e0a8f4adb
7
+ data.tar.gz: e653a1d9c5e2656110cb7168e4f825b4a2eb3b4cee951ad1bce2ba574f311f0f65ee800d34eceb61a18458f68b593531d2ccd3dd72fa4b04306cbdf20f542bc4
@@ -22,7 +22,7 @@ Metrics/LineLength:
22
22
  Max: 175
23
23
 
24
24
  Metrics/MethodLength:
25
- Max: 50
25
+ Max: 55
26
26
 
27
27
  Metrics/ParameterLists:
28
28
  Max: 12
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
+ ## 1.9.5 (January 14, 2019)
6
+
7
+ BUGFIX:
8
+
9
+ * Ensure to always re-open Connection to Consul agent in case of network error
10
+
5
11
  ## 1.9.4 (January 11, 2019)
6
12
 
7
13
  OPTIMIZATIONS:
data/README.md CHANGED
@@ -31,6 +31,10 @@ with fully [working examples](samples/).
31
31
  It also allow to display a very nice and hi-performance HTML5 UI for Consul,
32
32
  see [consul-ui](samples/consul-ui) for details.
33
33
 
34
+ ## Video introduction to consul-templaterb
35
+
36
+ [![Introduction to Consul-templaterb](docs/images/consul-ui_001.png)](https://youtu.be/zLzrLGLLl4Q)
37
+
34
38
  ## Differences with HashiCorp's consul-template
35
39
 
36
40
  [Hashicorp's Consul Template](https://github.com/hashicorp/consul-template)
@@ -206,14 +206,16 @@ module Consul
206
206
  connect_timeout: 5, # default connection setup timeout
207
207
  inactivity_timeout: conf.wait_duration + 1 + (conf.wait_duration / 16), # default connection inactivity (post-setup) timeout
208
208
  }
209
- connection = EventMachine::HttpRequest.new(conf.base_url, options)
209
+ connection = {
210
+ conn: EventMachine::HttpRequest.new(conf.base_url, options)
211
+ }
210
212
  cb = proc do |consul_index|
211
- http = connection.get(build_request(consul_index))
213
+ http = connection[:conn].get(build_request(consul_index))
212
214
  http.callback do
213
215
  # Dirty hack, but contrary to other path, when key is not present, Consul returns 404
214
216
  is_kv_empty = path.start_with?('/v1/kv') && http.response_header.status == 404
215
217
  if !is_kv_empty && enforce_json_200 && http.response_header.status != 200 && http.response_header['Content-Type'] != 'application/json'
216
- _handle_error(http, consul_index) { connection = EventMachine::HttpRequest.new(conf.base_url, options) }
218
+ _handle_error(http, consul_index) { connection[:conn] = EventMachine::HttpRequest.new(conf.base_url, options) }
217
219
  else
218
220
  n_consul_index = find_x_consul_index(http)
219
221
  @x_consul_index = n_consul_index.to_i if n_consul_index
@@ -247,7 +249,9 @@ module Consul
247
249
 
248
250
  http.errback do
249
251
  unless @stopping
250
- _handle_error(http, consul_index) { connection = EventMachine::HttpRequest.new(conf.base_url, options) }
252
+ _handle_error(http, consul_index) do
253
+ connection[:conn] = EventMachine::HttpRequest.new(conf.base_url, options)
254
+ end
251
255
  end
252
256
  end
253
257
  queue.pop(&cb)
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.9.4'.freeze
3
+ VERSION = '1.9.5'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul-templaterb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.4
4
+ version: 1.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - SRE Core Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-11 00:00:00.000000000 Z
11
+ date: 2019-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request
@@ -161,6 +161,7 @@ files:
161
161
  - TemplateAPI.md
162
162
  - bin/consul-templaterb
163
163
  - consul-templaterb.gemspec
164
+ - docs/images/consul-ui_001.png
164
165
  - lib/consul/async/consul_endpoint.rb
165
166
  - lib/consul/async/consul_template.rb
166
167
  - lib/consul/async/consul_template_engine.rb
@@ -232,7 +233,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
233
  - !ruby/object:Gem::Version
233
234
  version: '0'
234
235
  requirements: []
235
- rubygems_version: 3.0.2
236
+ rubyforge_project:
237
+ rubygems_version: 2.7.7
236
238
  signing_key:
237
239
  specification_version: 4
238
240
  summary: Implementation of Consul template using Ruby and .erb templating language