vagrant-bindfs 1.1.6 → 1.1.7

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
  SHA256:
3
- metadata.gz: 29109806b17badcdf58bb6f69156ecaa1ae7d8a410887374dee025717241613e
4
- data.tar.gz: d20770847365c2c98631992d2013ff340ba8e3f33f630259cb42a59adb126217
3
+ metadata.gz: eb3417cbc3128343426040923ca3e7ac4b2f8bdb42fe827d72d96e5e3dc6c383
4
+ data.tar.gz: 81d8fcb6135c267ac35b2f99355ffa543648664310b0445f69221191502b409d
5
5
  SHA512:
6
- metadata.gz: '01934f31742057f2943ada6b89dfa362e6eb463954543735da6ee382b8170f1f77294675dbfa39d60aa8a9d3a0cf82a8da40b2e21a9d71d2201e7e524cf3eddc'
7
- data.tar.gz: 4b1f8bb868d0316c93ef9bf8095666408012fe2aa201c7d7bf96688b4088b3105b71ccf9d1ecd59e541746fe74d6006c934e7ec9565a96c168f171843797ef1c
6
+ metadata.gz: 497f0b59fe30d4aa1f57a2999a3adbfb9d6400ade72e88a62e168ea10149933a501825514a096b06646a8b39cdbbab6ef5b7c65d0a3b2f9bc9365c34612f94c7
7
+ data.tar.gz: 7b88615529c76195d46edc91970e0c879f66b3450523db4744afd048e01f7a3ca4a77492cf981b60491fdfd56717afb7a1cf1c5074be76cfc36a1a71622a2ad3
@@ -38,7 +38,7 @@ module VagrantBindfs
38
38
  end
39
39
 
40
40
  def validate_options!
41
- folder.options.invalid_options.keys.each do |option_name|
41
+ folder.options.invalid_options.each_key do |option_name|
42
42
  @errors << I18n.t(option_name.tr('-', '_'), scope: 'vagrant-bindfs.deprecations')
43
43
  end
44
44
  end
@@ -3,6 +3,12 @@
3
3
  module VagrantBindfs
4
4
  module Vagrant
5
5
  class Config < ::Vagrant.plugin('2', :config)
6
+ DEFAULT_OPTIONS = {
7
+ 'force-user' => 'vagrant',
8
+ 'force-group' => 'vagrant',
9
+ 'perms' => 'u=rwX:g=rD:o=rD'
10
+ }.freeze
11
+
6
12
  attr_reader :debug
7
13
 
8
14
  attr_accessor :bindfs_version
@@ -21,10 +27,7 @@ module VagrantBindfs
21
27
  @install_bindfs_from_source = false
22
28
 
23
29
  @bound_folders = {}
24
- @default_options = Bindfs::OptionSet.new(nil,
25
- 'force-user' => 'vagrant',
26
- 'force-group' => 'vagrant',
27
- 'perms' => 'u=rwX:g=rD:o=rD')
30
+ @default_options = UNSET_VALUE
28
31
 
29
32
  @skip_validations = []
30
33
  @force_empty_mountpoints = false
@@ -62,22 +65,20 @@ module VagrantBindfs
62
65
 
63
66
  def merge(other) # rubocop:disable Metrics/AbcSize
64
67
  super.tap do |result|
65
- result.debug = (debug || other.debug)
66
-
67
- result_bindfs_version = [bindfs_version, other.bindfs_version].reject { |v| v == UNSET_VALUE }.min
68
- result.bindfs_version = result_bindfs_version unless result_bindfs_version.nil?
69
- result.install_bindfs_from_source = (install_bindfs_from_source || other.install_bindfs_from_source)
70
-
71
- result.default_options = default_options.merge(other.default_options)
68
+ %i[debug force_empty_mountpoints install_bindfs_from_source].each do |boolean|
69
+ result.send("#{boolean}=", (send(boolean) || other.send(boolean)))
70
+ end
72
71
  result.bound_folders = bound_folders.merge(other.bound_folders)
73
-
74
72
  result.skip_validations = (skip_validations + other.skip_validations).uniq
75
- result.force_empty_mountpoints = (force_empty_mountpoints || other.force_empty_mountpoints)
73
+
74
+ result.bindfs_version = merge_bindfs_version(other) unless merge_bindfs_version(other) == UNSET_VALUE
75
+ result.default_options = merge_default_options(other) unless merge_default_options(other) == UNSET_VALUE
76
76
  end
77
77
  end
78
78
 
79
79
  def finalize!
80
80
  @bindfs_version = :latest if @bindfs_version == UNSET_VALUE
81
+ self.default_options = DEFAULT_OPTIONS if default_options == UNSET_VALUE
81
82
  end
82
83
 
83
84
  def validate(_machine)
@@ -90,6 +91,22 @@ module VagrantBindfs
90
91
 
91
92
  { 'vagrant-bindfs' => errors.flatten }
92
93
  end
94
+
95
+ protected
96
+
97
+ def merge_bindfs_version(other)
98
+ return other.bindfs_version if bindfs_version == UNSET_VALUE
99
+ return bindfs_version if other.bindfs_version == UNSET_VALUE
100
+
101
+ [bindfs_version, other.bindfs_version].reject { |v| v == UNSET_VALUE }.min
102
+ end
103
+
104
+ def merge_default_options(other)
105
+ return other.default_options if default_options == UNSET_VALUE
106
+ return default_options if other.default_options == UNSET_VALUE
107
+
108
+ default_options.merge(other.default_options)
109
+ end
93
110
  end
94
111
  end
95
112
  end
@@ -34,7 +34,7 @@ module VagrantBindfs
34
34
  end
35
35
 
36
36
  def synced_folders_hook
37
- if ::Vagrant::Action::Builtin.const_defined? :NFS
37
+ if ::Vagrant::Action::Builtin.const_defined?(:NFS, false)
38
38
  ::Vagrant::Action::Builtin::NFS
39
39
  else
40
40
  ::Vagrant::Action::Builtin::SyncedFolders
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VagrantBindfs
4
- VERSION = '1.1.6'
4
+ VERSION = '1.1.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-bindfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaël-Ian Havard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-01-14 00:00:00.000000000 Z
13
+ date: 2020-05-08 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: " A Vagrant plugin to automate bindfs mount in the VM. This allow you
16
16
  to change owner, group and permissions on files and, for example, work around NFS