vagrant-bindfs 1.1.0 → 1.1.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: 8fc17d7b8bc6dadfe52d9b702d4761b473cbc388
4
- data.tar.gz: 760d7bb79eb8ca7fa4efac3fe772672c6ea316f4
3
+ metadata.gz: 9551f633610c3b6c502adf56678f00dc43236df7
4
+ data.tar.gz: 075c79a331c35a0202f0651e8ae6675bf93345f5
5
5
  SHA512:
6
- metadata.gz: 1ecf98c2bf3ed2ab3c717223681a00392080fbd6277f9da19e9a939076cee4b7de69c230902f82fe1d7646de31e3e813b6944d26664c6ebf6124ae92aa5f6841
7
- data.tar.gz: 0382d20c459d060917cfc7524b60c3e951f424869eab452210013280bf4ed7aa7f87e6543a4fcee41562e1b1970e9bb41cc6f58554c561f0c4be1a713b48cc2f
6
+ metadata.gz: e5ec0bba133b68e41e36c00973cdae4b11987c9b75ecef635e681caf06dd7e76d221d27c13caad6fd90399b9872232a83934d9e1528395c7f2004de8f2c2609f
7
+ data.tar.gz: bb9345cbd978ad3a368106107d217e2ecb73c1c82611312153bf2f2ab5fbc2e0534479a131abc16adcc33bbdc2653edb1dce67df1d7bb4247e2912970eb702a6
data/README.md CHANGED
@@ -28,8 +28,12 @@ _Note that `map_uid` and `map_gid` NFS options can be used to set the identity u
28
28
 
29
29
  ## Installation
30
30
 
31
- vagrant-bindfs is distributed as a Ruby gem.
32
- You can install it as any other Vagrant plugin with `vagrant plugin install vagrant-bindfs`.
31
+ vagrant-bindfs is distributed as a Ruby gem.
32
+ You can install it as any other Vagrant plugin with:
33
+
34
+ ```bash
35
+ vagrant plugin install vagrant-bindfs
36
+ ```
33
37
 
34
38
 
35
39
  ## Usage
@@ -83,7 +87,7 @@ Vagrant.configure("2") do |config|
83
87
  end
84
88
  ```
85
89
 
86
- Remember that Vagrant use `/vagrant` on guest side as a shared directory dedicated to provisioning and configuration. Binding a folder to `/vagrant` or one of its subfolders will fail.
90
+ Remember that Vagrant use `/vagrant` on guest side to automatically share your project directory (the one with the Vagrantfile), in particular for provisioning and configuration purposes. Binding a folder to `/vagrant` or one of its subfolders may expose unexpected behaviors.
87
91
 
88
92
  ### bindfs support
89
93
 
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ $stdout.sync = true
10
10
  $stderr.sync = true
11
11
 
12
12
  # Change to the directory of this file
13
- Dir.chdir(File.expand_path('../', __FILE__))
13
+ Dir.chdir(__dir__)
14
14
 
15
15
  # Installs the tasks for gem creation
16
16
  Bundler::GemHelper.install_tasks
data/Vagrantfile CHANGED
@@ -6,8 +6,8 @@
6
6
  # Uncomment machines you want to test
7
7
  test_machines = {
8
8
  # debian: { box: "bento/debian-9" },
9
- # ubuntu: { box: "bento/ubuntu-17.10" },
10
- # fedora: { box: "bento/fedora-26" },
9
+ # ubuntu: { box: "bento/ubuntu-18.10" },
10
+ # fedora: { box: "bento/fedora-29" },
11
11
  # redhat: { box: "bento/centos-7" },
12
12
  # gentoo: { box: "generic/gentoo" },
13
13
 
@@ -24,7 +24,7 @@ test_machines = {
24
24
  # documentation. See https://goo.gl/LbkPVF
25
25
  }
26
26
 
27
- require File.expand_path('../spec/vagrantfile_helper', __FILE__)
27
+ require File.expand_path('spec/vagrantfile_helper', __dir__)
28
28
 
29
29
  Vagrant.configure('2') do |config|
30
30
  # Common configuration
@@ -11,7 +11,7 @@ module VagrantBindfs
11
11
  autoload :Bindfs, 'vagrant-bindfs/bindfs'
12
12
  end
13
13
 
14
- I18n.load_path << File.expand_path('../../locales/en.yml', __FILE__)
14
+ I18n.load_path << File.expand_path('../locales/en.yml', __dir__)
15
15
  I18n.reload!
16
16
 
17
17
  require 'vagrant-bindfs/vagrant/plugin'
@@ -2,7 +2,7 @@
2
2
 
3
3
  module VagrantBindfs
4
4
  module Bindfs
5
- SOURCE_VERSION = '1.13.9'
5
+ SOURCE_VERSION = '1.14.0'
6
6
  SOURCE_URLS = [
7
7
  'http://bindfs.org/downloads/bindfs-%<bindfs_version>.tar.gz',
8
8
  'http://bindfs.dy.fi/downloads/bindfs-%<bindfs_version>.tar.gz'
@@ -28,6 +28,7 @@ module VagrantBindfs
28
28
 
29
29
  def format_flag(name, value)
30
30
  return unless !!value
31
+
31
32
  compatible_name = argument_compatible_name(name)
32
33
  (argument_shorthand_only?(name) ? "-#{compatible_name}" : "--#{compatible_name}")
33
34
  end
@@ -63,6 +63,7 @@
63
63
  "ctime-from-mtime": { "long": ["ctime-from-mtime"], "short": [], "type": "flag", "since": "0.0.1" },
64
64
  "enabe-ioctl": { "long": ["enable-ioctl"], "short": [], "type": "flag", "since": "1.13.2" },
65
65
  "block-devices-as-files": { "long": ["block-devices-as-files"], "short": [], "type": "flag", "since": "1.13.7" },
66
+ "forward-odirect": { "long": ["forward-odirect"], "short": [], "type": "option", "since": "1.14.0" },
66
67
 
67
68
  // FUSE options
68
69
  "o": { "long": [], "short": ["o"], "type": "option", "since": "0.0.1" },
@@ -76,6 +76,7 @@ module VagrantBindfs
76
76
 
77
77
  def extract_options_by_names!(names, to)
78
78
  return {} if names.empty?
79
+
79
80
  names.each { |name| to[name] = @options.delete(name) }
80
81
  end
81
82
 
@@ -91,18 +92,20 @@ module VagrantBindfs
91
92
 
92
93
  def cast_value_as_option(value)
93
94
  return nil if value.respond_to?(:nil?) && value.nil?
95
+
94
96
  (value.respond_to?(:to_s) ? value.to_s : value)
95
97
  end
96
98
 
97
99
  def cast_value_as_flag(value)
98
100
  return true if [true, 'true', 'True', 'yes', 'Yes', 'y', 'Y', 'on', 'On', 1].include?(value)
99
101
  return false if [false, 'false', 'False', 'no', 'No', 'n', 'N', 'off', 'Off', 0].include?(value)
102
+
100
103
  !!value
101
104
  end
102
105
 
103
106
  class << self
104
107
  def bindfs_options
105
- @bindfs_options ||= JSON.parse(File.read(File.expand_path('../option_definitions.json', __FILE__)))
108
+ @bindfs_options ||= JSON.parse(File.read(File.expand_path('option_definitions.json', __dir__)))
106
109
  end
107
110
 
108
111
  def supported_options(version)
@@ -115,6 +118,7 @@ module VagrantBindfs
115
118
  def compatible_name_for_version(option_name, version)
116
119
  return 'user' if option_name == 'force-user' && version_lower_than(version, '1.12')
117
120
  return 'group' if option_name == 'force-group' && version_lower_than(version, '1.12')
121
+
118
122
  option_name
119
123
  end
120
124
 
@@ -35,7 +35,6 @@ module VagrantBindfs
35
35
  def validate_destination!
36
36
  @errors << I18n.t('vagrant-bindfs.validations.destination_path_required') if destination.empty?
37
37
  @errors << I18n.t('vagrant-bindfs.validations.path_must_be_absolute', path: destination) if relative_path?(destination)
38
- @errors << I18n.t('vagrant-bindfs.validations.destination_path_reserved', path: destination) if reserved_path?(destination)
39
38
  end
40
39
 
41
40
  def validate_options!
@@ -49,10 +48,6 @@ module VagrantBindfs
49
48
  def relative_path?(path)
50
49
  Pathname.new(path).relative?
51
50
  end
52
-
53
- def reserved_path?(path)
54
- !Pathname.new(path).to_path.match(%r{^\/vagrant\/}).nil?
55
- end
56
51
  end
57
52
  end
58
53
  end
@@ -43,12 +43,14 @@ module VagrantBindfs
43
43
  def validate_user
44
44
  return if machine.config.bindfs.skip_validations.include?(:user)
45
45
  return if machine.guest.capability(:bindfs_exists_user, options['force-user'])
46
+
46
47
  @errors << I18n.t('vagrant-bindfs.validations.user_does_not_exist', user: options['force-user'])
47
48
  end
48
49
 
49
50
  def validate_group
50
51
  return if machine.config.bindfs.skip_validations.include?(:group)
51
52
  return if machine.guest.capability(:bindfs_exists_group, options['force-group'])
53
+
52
54
  @errors << I18n.t('vagrant-bindfs.validations.group_does_not_exist', group: options['force-group'])
53
55
  end
54
56
  end
@@ -24,6 +24,7 @@ module VagrantBindfs
24
24
 
25
25
  def apply!(_env)
26
26
  return if binded_folders.empty?
27
+
27
28
  ensure_guest_is_ready_to_bind!
28
29
  end
29
30
 
@@ -20,6 +20,7 @@ module VagrantBindfs
20
20
  def call(env)
21
21
  app.call(env)
22
22
  return if binded_folders(hook).empty?
23
+
23
24
  bind_folders!
24
25
  end
25
26
 
@@ -51,7 +52,7 @@ module VagrantBindfs
51
52
 
52
53
  error I18n.t(
53
54
  'vagrant-bindfs.validations.errors_found',
54
- dest: folder.destination,
55
+ dest: folder.destination,
55
56
  source: folder.source,
56
57
  errors: validator.errors.join(' ')
57
58
  )
@@ -61,6 +62,7 @@ module VagrantBindfs
61
62
  def empty_mountpoint?(folder)
62
63
  return false unless config.force_empty_mountpoints
63
64
  return false if folder.options.key?('o') && !folder.options['o'].match(/nonempty/).nil?
65
+
64
66
  true
65
67
  end
66
68
 
@@ -19,7 +19,7 @@ module VagrantBindfs
19
19
 
20
20
  class << self
21
21
  def included(base)
22
- capabilities = JSON.parse(File.read(File.expand_path('../capabilities.json', __FILE__)))
22
+ capabilities = JSON.parse(File.read(File.expand_path('capabilities.json', __dir__)))
23
23
  capabilities.each do |cap_name, oses|
24
24
  oses.each do |os_name, module_name|
25
25
  mod = module_by_name(module_name)
@@ -8,7 +8,7 @@ module VagrantBindfs
8
8
  class << self
9
9
  def bindfs_bindfs_search(machine)
10
10
  machine.guest.capability(:bindfs_package_manager_update)
11
- machine.communicate.test('[[ $(yum search bindfs 2>/dev/null | tail -n1) != "No matches found" ]]')
11
+ machine.communicate.test("[[ $(yum search bindfs 2>/dev/null | egrep -i '^bindfs\.' | wc -l) != 0 ]]")
12
12
  end
13
13
 
14
14
  def bindfs_bindfs_install(machine)
@@ -22,9 +22,9 @@ module VagrantBindfs
22
22
 
23
23
  @binded_folders = {}
24
24
  @default_options = Bindfs::OptionSet.new(nil,
25
- 'force-user' => 'vagrant',
25
+ 'force-user' => 'vagrant',
26
26
  'force-group' => 'vagrant',
27
- 'perms' => 'u=rwX:g=rD:o=rD')
27
+ 'perms' => 'u=rwX:g=rD:o=rD')
28
28
 
29
29
  @skip_validations = []
30
30
  @force_empty_mountpoints = false
@@ -28,7 +28,7 @@ module VagrantBindfs
28
28
  @hooks ||= begin
29
29
  {
30
30
  synced_folders: synced_folders_hook,
31
- provision: ::Vagrant::Action::Builtin::Provision
31
+ provision: ::Vagrant::Action::Builtin::Provision
32
32
  }
33
33
  end
34
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VagrantBindfs
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
data/locales/en.yml CHANGED
@@ -28,7 +28,6 @@ en:
28
28
  source_path_does_not_exist: "Source path '%{path}' doesn't exist"
29
29
 
30
30
  destination_path_required: "A destination path is required as argument to bind_folder"
31
- destination_path_reserved: "Destination path '%{path}' is part of a reserved subtree for Vagrant use"
32
31
  destination_already_mounted: "Destination path '%{dest}' is already a bindfs mount"
33
32
 
34
33
  path_must_be_absolute: "Path '%{path}' is relative but an absolute path is attended"
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.0
4
+ version: 1.1.1
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: 2018-01-30 00:00:00.000000000 Z
13
+ date: 2019-06-07 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
@@ -92,9 +92,12 @@ require_paths:
92
92
  - lib
93
93
  required_ruby_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '2.2'
98
+ - - "<"
96
99
  - !ruby/object:Gem::Version
97
- version: 2.0.0
100
+ version: '2.7'
98
101
  required_rubygems_version: !ruby/object:Gem::Requirement
99
102
  requirements:
100
103
  - - ">="