vagrant-hosts 2.8.1 → 2.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG +14 -0
- data/Gemfile +1 -1
- data/lib/vagrant-hosts/config.rb +13 -1
- data/lib/vagrant-hosts/config_builder/1_x.rb +14 -0
- data/lib/vagrant-hosts/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/config_spec.rb +41 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb44f6bea01ff90f2b53ea6f4e70a185eb1d9e7
|
4
|
+
data.tar.gz: 89e47f7c063126ed95a1428d5c9a731af03577aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5f02bcd8e452c89d4e5b8a8e191336bce48f1c9ed32b4d429fc7bd2313d67b9e4429650c4a9179f80fdc47bcaf672f8c4cff17d6dc4f868fb5f0acf5a7b3b82
|
7
|
+
data.tar.gz: def43babfd82b53a2080f26577a0ece85d42260eff2dba04ebc7b1e2f4e1b53c60a1f22b7f7ce6e81c7fe824dc45119c5043027462ccd72909831f23473b5207
|
data/.travis.yml
CHANGED
@@ -28,5 +28,7 @@ matrix:
|
|
28
28
|
env: TEST_VAGRANT_VERSION=v1.9.8 BUNDLER_VERSION=1.16.1
|
29
29
|
- rvm: 2.4.4
|
30
30
|
env: TEST_VAGRANT_VERSION=v2.0.4 BUNDLER_VERSION=1.16.1
|
31
|
+
- rvm: 2.4.4
|
32
|
+
env: TEST_VAGRANT_VERSION=v2.1.1 BUNDLER_VERSION=1.16.1
|
31
33
|
- rvm: 2.4.4
|
32
34
|
env: TEST_VAGRANT_VERSION=HEAD BUNDLER_VERSION=1.16.1
|
data/CHANGELOG
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
2.8.2
|
5
|
+
-----
|
6
|
+
|
7
|
+
2018-06-05
|
8
|
+
|
9
|
+
This is a backwards compatible bugfix release.
|
10
|
+
|
11
|
+
* The `exports` and `imports` attributes of the hosts provisioner now
|
12
|
+
properly merge when a provisioner with the same name is definied in
|
13
|
+
multiple scopes (e.g. global, per-vm, per-provider).
|
14
|
+
|
15
|
+
* Added test coverage for Vagrant 2.1.
|
16
|
+
|
17
|
+
|
4
18
|
2.8.1
|
5
19
|
-----
|
6
20
|
|
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
require 'rubygems/version'
|
3
3
|
|
4
|
-
vagrant_branch = ENV['TEST_VAGRANT_VERSION'] || 'v2.
|
4
|
+
vagrant_branch = ENV['TEST_VAGRANT_VERSION'] || 'v2.1.1'
|
5
5
|
vagrant_version = nil
|
6
6
|
|
7
7
|
# Wrapping gemspec in the :plugins group causes Vagrant 1.5 and newer to
|
data/lib/vagrant-hosts/config.rb
CHANGED
@@ -87,7 +87,19 @@ module VagrantHosts
|
|
87
87
|
# @return [VagrantHosts::Config] The merged results
|
88
88
|
def merge(other)
|
89
89
|
result = super
|
90
|
-
|
90
|
+
|
91
|
+
new_hosts = (self.hosts.dup + other.hosts.dup).uniq
|
92
|
+
result.instance_variable_set(:@hosts, new_hosts.to_a)
|
93
|
+
|
94
|
+
result.imports = (self.imports.dup + other.imports.dup).uniq
|
95
|
+
|
96
|
+
result.exports = {}
|
97
|
+
[self.exports, other.exports].each do |hash|
|
98
|
+
hash.each do |k, v|
|
99
|
+
result.exports[k] ||= []
|
100
|
+
result.exports[k] += v.dup
|
101
|
+
end
|
102
|
+
end
|
91
103
|
|
92
104
|
result
|
93
105
|
end
|
@@ -20,6 +20,20 @@ module VagrantHosts
|
|
20
20
|
# @!attribute [rw] exports
|
21
21
|
def_model_attribute :imports
|
22
22
|
|
23
|
+
# @private
|
24
|
+
def configure_exports(config, val)
|
25
|
+
val.each do |k, v|
|
26
|
+
config.exports[k] ||= []
|
27
|
+
config.exports[k] += v
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# @private
|
32
|
+
def configure_imports(config, val)
|
33
|
+
config.imports += val
|
34
|
+
config.imports.uniq!
|
35
|
+
end
|
36
|
+
|
23
37
|
# @private
|
24
38
|
def configure_hosts(config, val)
|
25
39
|
val.each do |(address, aliases)|
|
data/spec/spec_helper.rb
CHANGED
data/spec/unit/config_spec.rb
CHANGED
@@ -24,20 +24,50 @@ describe VagrantHosts::Config do
|
|
24
24
|
expect(errors['Vagrant Hosts']).to eq []
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
subject.finalize!
|
27
|
+
context 'when merging' do
|
28
|
+
let(:other) { described_class.new }
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
it 'combines hosts arrays' do
|
31
|
+
subject.add_host '127.0.0.1', ['local.server']
|
32
|
+
subject.finalize!
|
34
33
|
|
35
|
-
|
34
|
+
other.add_host '127.0.0.1', ['some-alias']
|
35
|
+
other.add_host '10.0.20.1', ['other.server']
|
36
|
+
other.finalize!
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
[
|
40
|
-
|
38
|
+
result = subject.merge(other)
|
39
|
+
|
40
|
+
expect(result.hosts).to eq [['127.0.0.1', ['local.server']],
|
41
|
+
['127.0.0.1', ['some-alias']],
|
42
|
+
['10.0.20.1', ['other.server']]]
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'combines import arrays' do
|
46
|
+
subject.imports = ['foo', 'baz']
|
47
|
+
subject.finalize!
|
48
|
+
|
49
|
+
other.imports = ['foo', 'bar']
|
50
|
+
other.finalize!
|
41
51
|
|
52
|
+
result = subject.merge(other)
|
53
|
+
|
54
|
+
expect(result.imports).to eq ['foo', 'baz', 'bar']
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'merges export hashes' do
|
58
|
+
subject.exports = {global: [["127.0.0.1", ["local.server"]]]}
|
59
|
+
subject.finalize!
|
60
|
+
|
61
|
+
other.exports = {global: [["127.0.0.1", ["test.server"]]],
|
62
|
+
some_provider: [["127.0.0.1", ["some-alias"]]]}
|
63
|
+
other.finalize!
|
64
|
+
|
65
|
+
result = subject.merge(other)
|
66
|
+
|
67
|
+
expect(result.exports).to eq({global: [['127.0.0.1', ['local.server']],
|
68
|
+
['127.0.0.1', ['test.server']]],
|
69
|
+
some_provider: [["127.0.0.1", ["some-alias"]]]})
|
70
|
+
end
|
71
|
+
end
|
42
72
|
end
|
43
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-hosts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Thebo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-05
|
12
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|