consul-templaterb 1.8.0 → 1.8.1
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/TemplateAPI.md +12 -11
- data/lib/consul/async/consul_template_render.rb +2 -4
- data/lib/consul/async/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4575bd9573abe22918149095549c1942aba92f447bc57c9bf466e3f4e692955f
|
4
|
+
data.tar.gz: e0f1daefa7fd071b16becceeb955acbf465a8c63f09a787161ea26786342be5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d06c13276838fc70fd31beeac8875b89f9b80b9efde59614be9b6b0f272e8fba819ef40424ff3b6f0a300f1f17eb719f16b66dd697b86193e3a3c7b92ea79a11
|
7
|
+
data.tar.gz: 4664f4a357a97d5f3047a328aa4907b08d4dab11d570a961cde0e51d0ac4453649ddb97d76cda113509e93ed43f99c96f69b86d50872d1ab38e2285a811e0f60
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
## (UNRELEASED)
|
4
4
|
|
5
|
+
## 1.8.1 (December 12, 2018)
|
6
|
+
|
7
|
+
BUGFIX:
|
8
|
+
|
9
|
+
* Properly fill `template_info` strtucture when hot reload is performed so templates using
|
10
|
+
`template_info()` new function can behave nicely.
|
11
|
+
|
12
|
+
NEW FEATURES:
|
13
|
+
|
14
|
+
* template_info now includes `hot_reloading_in_progress: true` when the hotreloading is in progress.
|
15
|
+
|
5
16
|
## 1.8.0 (December 11, 2018)
|
6
17
|
|
7
18
|
NEW FEATURES:
|
data/TemplateAPI.md
CHANGED
@@ -383,15 +383,6 @@ secret('secret/foo', [force_ttl: intInSecond])
|
|
383
383
|
It returns information about current template being rendered.
|
384
384
|
The information returned has the following structure:
|
385
385
|
|
386
|
-
```json
|
387
|
-
{
|
388
|
-
'destination': destination_file_for_root_template
|
389
|
-
'source': absolute_path_to_template_file.erb
|
390
|
-
'source_root': absolute_path_to_root_template.erb
|
391
|
-
'was_rendered_once': true|false
|
392
|
-
}
|
393
|
-
```
|
394
|
-
|
395
386
|
- `destination`: absolute path where the file is gonna be written
|
396
387
|
- `source`: the template absolute path file, most of the time, if will be
|
397
388
|
equal to `source_root`, except when the current template is included
|
@@ -413,12 +404,22 @@ I am the file <%= File.basename(template_info['source']) %><%
|
|
413
404
|
%> rendered as <%= File.basename(template_info['destination']) %>
|
414
405
|
```
|
415
406
|
|
407
|
+
#### Simple rendering
|
408
|
+
|
416
409
|
The command `consul-template template_info.erb` would render:
|
417
|
-
|
410
|
+
|
411
|
+
```
|
412
|
+
I am the file template_info.erb rendered as template_info`
|
413
|
+
```
|
414
|
+
|
415
|
+
#### Rendering with template included into another
|
418
416
|
|
419
417
|
If creating a file called include.erb with contents: `<%= render_file('template_info.erb') %>`,
|
420
418
|
the command `consul-templaterb --template include.erb:destination_file.txt` would render:
|
421
|
-
|
419
|
+
|
420
|
+
```
|
421
|
+
I am the file template_info.erb included from template include.erb rendered as destination_file.txt`
|
422
|
+
```
|
422
423
|
|
423
424
|
</div>
|
424
425
|
</details>
|
@@ -80,13 +80,11 @@ module Consul
|
|
80
80
|
new_time = File.ctime(template_file)
|
81
81
|
if template_file_ctime != new_time
|
82
82
|
begin
|
83
|
-
current_template_info =
|
84
|
-
current_template_info.!merge(current_template_info)
|
85
|
-
current_template_info['ready'] = false
|
83
|
+
current_template_info = _build_default_template_info.merge('ready' => false, 'hot_reloading_in_progress' => true)
|
86
84
|
@template_file_ctime = new_time
|
87
85
|
return update_template(load_template, current_template_info: current_template_info)
|
88
86
|
rescue Consul::Async::InvalidTemplateException => e
|
89
|
-
STDERR.puts "****\n[ERROR] HOT Reload of template #{template_file} did fail due to:\n #{e}\n****\n"
|
87
|
+
STDERR.puts "****\n[ERROR] HOT Reload of template #{template_file} did fail due to:\n #{e}\n****\n template_info: #{current_template_info}\n****"
|
90
88
|
raise e unless hot_reload_failure == 'keep'
|
91
89
|
STDERR.puts "[WARN] Hot reload of #{template_file} was not taken into account, keep running with previous version"
|
92
90
|
end
|
data/lib/consul/async/version.rb
CHANGED
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.8.
|
4
|
+
version: 1.8.1
|
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: 2018-12-
|
11
|
+
date: 2018-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-http-request
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.7.
|
231
|
+
rubygems_version: 2.7.8
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
234
|
summary: Implementation of Consul template using Ruby and .erb templating language
|