bosh-template 2.1.0 → 2.2.0
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: 225cc24dcfea221f0c7c6dcd7c06857b21f07ae8
|
4
|
+
data.tar.gz: a66bf44b3825ce1e406a7fc3dc22cf5fe3fdfdd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93cfadffd893c78c122399b806f4ae8bdd3da693d40c342dc51a4bb18546b1bd91b8dc151f10544abc315a977685fe453036bf2661687056dc7ed3fbdf60bc86
|
7
|
+
data.tar.gz: 4dba063576b3a70450260d33b5cafc6cf80524731949ea78aa77b658954427109d48684ac56e9121254bd28b877ba7560a414ca4e04cbd1a7c29e2ab6040f2a5
|
data/README.md
CHANGED
@@ -21,19 +21,21 @@ When you create your own release, you can likewise create a tests folder in your
|
|
21
21
|
```ruby
|
22
22
|
let(:job) {release.job('JOB-NAME')} # e.g. 'web-server;
|
23
23
|
let(:template) {job.template('PATH-TO-TEMPLATE')} # e.g. 'config/config-with-nested'
|
24
|
-
let(:manifest)
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
let(:manifest) do
|
25
|
+
{
|
26
|
+
'cert' => '----- BEGIN ... -----',
|
27
|
+
'port' => 42,
|
28
|
+
}
|
29
|
+
end
|
28
30
|
let(:instance) { InstanceSpec.new(name:'instance-name', az: 'az1', bootstrap: true) }
|
29
31
|
let(:link_instance) { InstanceSpec.new(name:'link-instance-name', az: 'az2') }
|
30
|
-
let(:link_properties)
|
31
|
-
|
32
|
-
|
32
|
+
let(:link_properties) do
|
33
|
+
{ 'link-key' => 'link-value' }
|
34
|
+
end
|
33
35
|
let(:link) { Link.new(name:'link-name', instances:[link_instance], properties: link_properties)}
|
34
36
|
|
35
37
|
|
36
38
|
rendered_template = JSON.parse(template.render(manifest, spec: instance, consumes: [link]))
|
37
39
|
```
|
38
40
|
|
39
|
-
And then check that their template rendered as they expected.
|
41
|
+
And then check that their template rendered as they expected.
|
@@ -8,7 +8,7 @@ module Bosh
|
|
8
8
|
attr_reader :instances
|
9
9
|
attr_reader :properties
|
10
10
|
|
11
|
-
def initialize(instances, properties, instance_group, default_network, deployment_name, root_domain, dns_encoder)
|
11
|
+
def initialize(instances, properties, instance_group, default_network, deployment_name, root_domain, dns_encoder, use_short_dns)
|
12
12
|
@instances = instances
|
13
13
|
@properties = properties
|
14
14
|
@instance_group = instance_group
|
@@ -16,6 +16,7 @@ module Bosh
|
|
16
16
|
@deployment_name = deployment_name
|
17
17
|
@root_domain = root_domain
|
18
18
|
@dns_encoder = dns_encoder
|
19
|
+
@use_short_dns = use_short_dns
|
19
20
|
end
|
20
21
|
|
21
22
|
def p(*args)
|
@@ -51,7 +52,7 @@ module Bosh
|
|
51
52
|
root_domain: @root_domain,
|
52
53
|
)
|
53
54
|
|
54
|
-
@dns_encoder.encode_query(full_criteria)
|
55
|
+
@dns_encoder.encode_query(full_criteria, @use_short_dns)
|
55
56
|
end
|
56
57
|
end
|
57
58
|
end
|
@@ -19,7 +19,7 @@ module Bosh::Template
|
|
19
19
|
|
20
20
|
binding = Bosh::Template::EvaluationContext.new(sanitized_hash_with_spec, nil).get_binding
|
21
21
|
raise "No such file at #{@template_path}" unless File.exist?(@template_path)
|
22
|
-
ERB.new(File.read(@template_path)).result(binding)
|
22
|
+
ERB.new(File.read(@template_path), safe_level = nil, trim_mode = '-').result(binding)
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -74,4 +74,4 @@ module Bosh::Template
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
77
|
-
end
|
77
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pivotal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semi_semantic
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
74
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.6.
|
75
|
+
rubygems_version: 2.6.14.1
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Renders bosh templates
|