vagrant-config_builder 0.10.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b8f804b5113a9fae5ab9161daff63c371decd57
4
- data.tar.gz: 7cc438b36c2c5ad9255a3bef2aa81c339cc68cf6
3
+ metadata.gz: ad642e21b08ad1ad7baf002cd01ec1167758a332
4
+ data.tar.gz: 8f473ceb06a835407c996de34a96c609ab8a0cc0
5
5
  SHA512:
6
- metadata.gz: ef8a0b918542ed737a1544df01df943c9b5ef1a4d594500ba67baf282a2587bf44f2130ea51ae5b48762683902f7e88cc62667291bd5161e94b54f6021a0d351
7
- data.tar.gz: fe7f55d729affe65bef07875cadb86c7573a9cf0485fa4b6920fe36fe511e297e82118f44330f4c2d220024ab0a883d8f0b1eccdd7a50c9cf60c04eeec7c752a
6
+ metadata.gz: 8cc9a6ba0eeb0dff69ff001b477b5e4473c072d29ca76f554840a630bdd6cd348df9562d80d645954ff846dbbb365bee82b55bd890b3104b6c62c0525822a443
7
+ data.tar.gz: ed2c49b370655683309dbffe8cabc7b38bb505ed68e4f92eda5e6a4722d43878a3294a37d50fbd03e5105f23fc39e5ec5e11cd937c99de5d1f7be095238fab17
data/CHANGELOG CHANGED
@@ -1,6 +1,18 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 0.10.1
5
+ ------
6
+
7
+ 2014-07-08
8
+
9
+ This is a backwards bugfix release.
10
+
11
+ * Fixed an issue where VM definitions would end up with linked copies of an
12
+ array because cloning was not used.
13
+
14
+ * The `id` attribute can now be specified for `forwarded_port`.
15
+
4
16
  0.10.0
5
17
  ------
6
18
 
@@ -134,7 +134,7 @@ class ConfigBuilder::Filter::Roles
134
134
  if (left[key] and right[key])
135
135
  retval[key] += left[key]
136
136
  elsif left[key]
137
- retval[key] = left[key]
137
+ retval[key] = left[key].clone
138
138
  end
139
139
  end
140
140
 
@@ -15,8 +15,12 @@ class ConfigBuilder::Model::Network::ForwardedPort < ConfigBuilder::Model::Base
15
15
  # @return [Boolean] Whether to automatically correct port collisions
16
16
  def_model_attribute :auto_correct
17
17
 
18
+ # @!attribute [rw] id
19
+ # @return [String, nil] An optional name used to identify this port forward
20
+ def_model_attribute :id
21
+
18
22
  def initialize
19
- @defaults = {:auto_correct => false}
23
+ @defaults = {:auto_correct => false, :id => nil}
20
24
  end
21
25
 
22
26
  def to_proc
@@ -25,7 +29,8 @@ class ConfigBuilder::Model::Network::ForwardedPort < ConfigBuilder::Model::Base
25
29
  :forwarded_port,
26
30
  :guest => attr(:guest),
27
31
  :host => attr(:host),
28
- :auto_correct => attr(:auto_correct)
32
+ :auto_correct => attr(:auto_correct),
33
+ :id => attr(:id),
29
34
  )
30
35
  end
31
36
  end
@@ -1,3 +1,3 @@
1
1
  module ConfigBuilder
2
- VERSION = '0.10.0'
2
+ VERSION = '0.10.1'
3
3
  end
@@ -35,6 +35,11 @@ describe ConfigBuilder::Filter::Roles do
35
35
  {'guest_path' => '/guest-3', 'host_path' => './host-3'},
36
36
  {'guest_path' => '/guest-4', 'host_path' => './host-4'},
37
37
  ],
38
+ },
39
+ 'shared-networks' => {
40
+ 'private_networks' => [
41
+ {'ip' => '1.2.3.4'}
42
+ ]
38
43
  }
39
44
  }
40
45
  end
@@ -183,11 +188,11 @@ describe ConfigBuilder::Filter::Roles do
183
188
  [
184
189
  {
185
190
  'name' => 'master',
186
- 'roles' => ['shell-provisioner', 'potato-provisioner', 'folders-12', 'folders-34'],
191
+ 'roles' => ['shell-provisioner', 'potato-provisioner', 'folders-12', 'folders-34', 'shared-networks'],
187
192
  },
188
193
  {
189
194
  'name' => 'agent',
190
- 'roles' => ['shell-provisioner', 'puppet-provisioner', 'folders-34'],
195
+ 'roles' => ['shell-provisioner', 'puppet-provisioner', 'folders-34', 'shared-networks'],
191
196
  }
192
197
  ]
193
198
  end
@@ -251,6 +256,16 @@ describe ConfigBuilder::Filter::Roles do
251
256
  expect(vm['synced_folders']).to eq expected
252
257
  end
253
258
  end
259
+
260
+ context 'when modifying an array inherited from a role' do
261
+ before :each do
262
+ filtered_vms[0]['private_networks'].push 'ip' => '5.6.7.8'
263
+ end
264
+
265
+ it 'other VMs using that role are not affected' do
266
+ expect(filtered_vms[1]['private_networks']).to eq roles['shared-networks']['private_networks']
267
+ end
268
+ end
254
269
  end
255
270
 
256
271
  describe 'when a class references a non-existent role' do
@@ -259,14 +274,14 @@ describe ConfigBuilder::Filter::Roles do
259
274
  'vms' => [{'name' => 'master', 'roles' => 'nope'}],
260
275
  'roles' => {'yep' => {'box' => 'moxxi'}}
261
276
  }
277
+ end
262
278
 
263
- before do
264
- subject.set_config(dup(config))
265
- end
279
+ before do
280
+ subject.set_config(dup(config))
281
+ end
266
282
 
267
- it 'raises an error' do
268
- expect { subject.run }.to raise_error, /Couldn't find role named .*nope.*/
269
- end
283
+ it 'raises an error' do
284
+ expect { subject.run }.to raise_error(/^Requested role "nope" is not defined/)
270
285
  end
271
286
  end
272
287
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-config_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-22 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge
@@ -114,3 +114,4 @@ signing_key:
114
114
  specification_version: 4
115
115
  summary: Generate Vagrant configurations from arbitrary data
116
116
  test_files: []
117
+ has_rdoc: true