lib/vagrant-hosts/config.rb in vagrant-hosts-2.8.1 vs lib/vagrant-hosts/config.rb in vagrant-hosts-2.8.2
- old
+ new
@@ -85,10 +85,22 @@
# @param other [VagrantHosts::Config]
# @return [VagrantHosts::Config] The merged results
def merge(other)
result = super
- result.instance_variable_set(:@hosts, self.hosts.dup + other.hosts.dup)
+
+ new_hosts = (self.hosts.dup + other.hosts.dup).uniq
+ result.instance_variable_set(:@hosts, new_hosts.to_a)
+
+ result.imports = (self.imports.dup + other.imports.dup).uniq
+
+ result.exports = {}
+ [self.exports, other.exports].each do |hash|
+ hash.each do |k, v|
+ result.exports[k] ||= []
+ result.exports[k] += v.dup
+ end
+ end
result
end
def validate(machine)