vagrant-invade 0.6.4 → 0.7.0

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: dd40809f47915424d22391ac52ef13899ce46285
4
- data.tar.gz: ccdaa0b5ef73e7b5b374fd319b60fc9fe1a9abb8
3
+ metadata.gz: f6d05d703e83eeb6fc6d8ffb8e0de3c50988d58f
4
+ data.tar.gz: 8dafe62da9c4bc56d8fb82d01062ccec910924f6
5
5
  SHA512:
6
- metadata.gz: a6c1373e32591bdd714b8a96ac78c59c06049e93ac5294b21adb593d41f051edd8b21372b3d6601fe83ddf8988bbce1758ba62f6036007e40e80c87c66ebdd90
7
- data.tar.gz: 21e75da17edaace7d6ac27377a40a21dd7c189ec3dfb6e62ec9b6e96373c8e0acac0d0cc9667ab6da4907b8b09f183c445bf27cb9b68430a75ac059ce7943623
6
+ metadata.gz: 0ca932f0f09a78d05fbe3f0fc7de6f5b6da85d26c49b6abf8c35d34af84e9ad5880a980de74d600ac0961b414664aca98107f9ef677043bc5a72b424fe5fe088
7
+ data.tar.gz: 21beb6a37e3e975f10185247c05e7171a9388c06954de003145d5357262df9e74ced320f5fa745db7002683bbfcfe46856aed0c0e49d6b41e151ae7986787ed8
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
4
  gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', :ref => 'v1.8.5'
5
+ gem 'bundler', '>= 1.12.5'
5
6
  end
6
7
 
7
8
  group :plugins do
data/Gemfile.lock CHANGED
@@ -24,7 +24,7 @@ GIT
24
24
  PATH
25
25
  remote: .
26
26
  specs:
27
- vagrant-invade (0.6.3)
27
+ vagrant-invade (0.7.0)
28
28
 
29
29
  GEM
30
30
  remote: https://rubygems.org/
@@ -103,7 +103,7 @@ PLATFORMS
103
103
  ruby
104
104
 
105
105
  DEPENDENCIES
106
- bundler (~> 1.12, >= 1.12.5)
106
+ bundler (>= 1.12.5)
107
107
  rake (~> 10.0)
108
108
  vagrant!
109
109
  vagrant-invade!
@@ -28,7 +28,7 @@ module VagrantPlugins
28
28
  config = env[:invade]
29
29
 
30
30
  # Remove empty Hashes
31
- config.delete_blank
31
+ config = config.compact(config)
32
32
 
33
33
  config.each do |config_key, config_data|
34
34
  if config_key == 'machines'
@@ -8,9 +8,12 @@ class Hash
8
8
  d
9
9
  end
10
10
 
11
- def delete_blank
12
- delete_if do |_, v|
13
- (v.respond_to?(:empty?) ? v.empty? : !v) or v.instance_of?(Hash) && v.delete_blank.empty?
11
+ def compact(opts={})
12
+ inject({}) do |new_hash, (k,v)|
13
+ if !v.nil?
14
+ new_hash[k] = opts[:recurse] && v.class == Hash ? v.compact(opts) : v
15
+ end
16
+ new_hash
14
17
  end
15
18
  end
16
19
  end
@@ -1,5 +1,5 @@
1
1
  <% if enabled %>
2
- # --- Hostmanager Settings --- #
2
+ # --- Hostmanager Global Settings --- #
3
3
  config.hostmanager.enabled = <%= enabled %>
4
4
  config.hostmanager.manage_host = <%= manage_host %>
5
5
  config.hostmanager.manage_guest = <%= manage_guest %>
@@ -20,7 +20,7 @@ module VagrantPlugins
20
20
  b = binding
21
21
 
22
22
  # Delete all nil keys
23
- @private_network_data.delete_blank
23
+ @private_network_data.compact
24
24
 
25
25
  ip = @private_network_data['ip']
26
26
 
@@ -5,10 +5,9 @@ module VagrantPlugins
5
5
  class Nfs < InvadeModule
6
6
 
7
7
  attr_reader :result
8
- attr_accessor :machine_name, :nfs_data
8
+ attr_accessor :nfs_data
9
9
 
10
- def initialize(machine_name, nfs_data, result: nil)
11
- @machine_name = machine_name
10
+ def initialize(nfs_data, result: nil)
12
11
  @nfs_data = nfs_data
13
12
  @result = result
14
13
  end
@@ -20,8 +19,8 @@ module VagrantPlugins
20
19
 
21
20
  # Values for nfs part
22
21
  functional = @nfs_data['functional']
23
- map_uid = @nfs_data['map_uid']
24
- map_gid = @nfs_data['map_gid']
22
+ @nfs_data['map_uid'] ? map_uid = @nfs_data['map_uid'] : map_uid = Process.uid
23
+ @nfs_data['map_gid'] ? map_gid = @nfs_data['map_gid'] : map_gid = Process.gid
25
24
  verify_installed = @nfs_data['verify_installed']
26
25
 
27
26
  eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__)))
@@ -3,10 +3,10 @@ functional:
3
3
  default: nil
4
4
  map_uid:
5
5
  type: Integer
6
- default: Process.uid
6
+ default: nil
7
7
  map_gid:
8
8
  type: Integer
9
- default: Process.gid
9
+ default: nil
10
10
  verify_installed:
11
11
  type: Boolean
12
12
  default: nil
@@ -1,12 +1,9 @@
1
- <% if functional %>
2
- <%= machine_name %>.nfs.functional = <%= functional %>
3
- <% end %>
4
- <% if map_uid %>
5
- <%= machine_name %>.nfs.map_uid = <%= map_uid %>
6
- <% end %>
7
- <% if map_gid %>
8
- <%= machine_name %>.nfs.map_gid = <%= map_gid %>
9
- <% end %>
10
- <% if verify_installed %>
11
- <%= machine_name %>.nfs.verify_installed = <%= verify_installed %>
12
- <% end %>
1
+ # --- NFS Global Settings --- #
2
+ <% if functional %>
3
+ config.nfs.functional = <%= functional %>
4
+ <% end %>
5
+ config.nfs.map_uid = <%= map_uid %>
6
+ config.nfs.map_gid = <%= map_gid %>
7
+ <% if verify_installed %>
8
+ config.nfs.verify_installed = <%= verify_installed %>
9
+ <% end %>
@@ -27,9 +27,6 @@ module VagrantPlugins
27
27
 
28
28
  # Values for hostmanager section
29
29
  enabled = @hostmanager_data['enabled']
30
- manage_host = @hostmanager_data['manage_host']
31
- ignore_private_ip = @hostmanager_data['ignore_private_ip']
32
- include_offline =@hostmanager_data['include_offline']
33
30
  aliases = @hostmanager_data['aliases']
34
31
 
35
32
  eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__)))
@@ -1,3 +1,6 @@
1
+ enabled:
2
+ type: Boolean
3
+ default: true
1
4
  aliases:
2
5
  type: Array
3
6
  default:
@@ -1,3 +1,5 @@
1
- <% if aliases %>
1
+ <% if enabled %>
2
+ <% if aliases %>
2
3
  <%= machine_name %>.hostmanager.aliases = <%= aliases %>
3
4
  <% end %>
5
+ <% end %>
@@ -29,6 +29,10 @@ module VagrantPlugins
29
29
  source = @nfs_data['source']
30
30
  path = @nfs_data['path']
31
31
  mount_options = @nfs_data['mount_options']
32
+ linux__nfs_options = @nfs_data['linux__nfs_options']
33
+ bsd__nfs_options = @nfs_data['bsd__nfs_options']
34
+ nfs_version = @nfs_data['nfs_version']
35
+ nfs_udp = @nfs_data['nfs_udp']
32
36
 
33
37
  eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__)))
34
38
  @result = eruby.result b
@@ -20,3 +20,15 @@ mount_options:
20
20
  type: Array
21
21
  default:
22
22
  - nolock
23
+ linux__nfs_options:
24
+ type: Array
25
+ default: nil
26
+ bsd__nfs_options:
27
+ type: Array
28
+ default: nil
29
+ nfs_version:
30
+ type: Integer
31
+ default: nil
32
+ nfs_udp:
33
+ type: Boolean
34
+ default: nil
@@ -1,2 +1,2 @@
1
1
  <%= machine_name %>.vm.synced_folder '<%= source %>', '<%= path %>',
2
- type: 'nfs'<% if mount_options %>, mount_options: <%= mount_options %><% end %><% if enabled %>, disabled: true<% end %>
2
+ type: 'nfs'<% if mount_options %>, mount_options: <%= mount_options %><% end %><% if linux__nfs_options %>, linux__nfs_options: <%= linux__nfs_options %><% end %><% if bsd__nfs_options %>, bsd__nfs_options: <%= bsd__nfs_options%><% end %><% if nfs_version %>, nfs_version: <%= nfs_version %><% end %><% unless nfs_udp.nil? %>, nfs_udp: <%= nfs_udp %><% end %><% if enabled %>, disabled: true<% end %>
@@ -6,5 +6,6 @@ Vagrant.configure(2) do |config|
6
6
  <% machines.each do |_, data| %>
7
7
  <%= data %>
8
8
  <% end %>
9
- <%= hostmanager %>
9
+ <%= global_hostmanager %>
10
+ <%= global_nfs %>
10
11
  end
@@ -19,7 +19,8 @@ module VagrantPlugins
19
19
  begin
20
20
 
21
21
  # Set variables for template files
22
- hostmanager = @vagrantfile_data['hostmanager']
22
+ global_hostmanager = @vagrantfile_data['hostmanager']
23
+ global_nfs = @vagrantfile_data['nfs']
23
24
  machines = @vagrantfile_data['machines']
24
25
 
25
26
  eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__)))
@@ -27,6 +27,7 @@ module VagrantPlugins
27
27
 
28
28
  # Fill with defaults
29
29
  @ruleset.rules.each do |rule_key, rule_value|
30
+
30
31
  unless rule_value['default'] == 'nil'
31
32
  value_data[rule_key] = rule_value['default'] if value_data[rule_key].nil?
32
33
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Invade
3
- VERSION = '0.6.4'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-invade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lennart Stein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-30 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler