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: 85722b0330f29047967d4ca4720f426ae91bb189
4
- data.tar.gz: 8e2c8efbda1cc38181caa059aeed914af9e633f4
3
+ metadata.gz: 225cc24dcfea221f0c7c6dcd7c06857b21f07ae8
4
+ data.tar.gz: a66bf44b3825ce1e406a7fc3dc22cf5fe3fdfdd2
5
5
  SHA512:
6
- metadata.gz: 5e98e351adac155ec9972e51b440680c19a3e4c703c270c2dfccd7ad597e5117fcabf8c2688a2bf08694d47d36155d6fd8e5f9a06e6b06f27beaf120b9281aa6
7
- data.tar.gz: 8a4ad0c89aa5d22e7666ffc6a20a8aa066b01197855a1b89e8fb1b47b1f9a3f5fc7b81dcd85c9232342362735c534bd28792a121c2a335aaca4f5d5aba7bc4eb
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
- 'cert' => '----- BEGIN ... -----',
26
- 'port' => 42,
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
- 'link-key' => 'link-value',
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.
@@ -162,6 +162,7 @@ module Bosh
162
162
  link_spec['deployment_name'],
163
163
  link_spec['domain'],
164
164
  encoder_to_inject,
165
+ link_spec.fetch('use_short_dns_addresses', false)
165
166
  )
166
167
  end
167
168
 
@@ -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
@@ -5,7 +5,7 @@ module Bosh
5
5
  @manual_link_address = manual_link_address
6
6
  end
7
7
 
8
- def encode_query(_)
8
+ def encode_query(*_)
9
9
  @manual_link_address
10
10
  end
11
11
  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
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Template
3
- VERSION = '2.1.0'
3
+ VERSION = '2.2.0'
4
4
  end
5
5
  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.1.0
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-03-09 00:00:00.000000000 Z
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.13
75
+ rubygems_version: 2.6.14.1
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Renders bosh templates