vagrant-bindfs 0.3.4 → 0.4.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: 748c092fd2cadf3c3605d820738e0f6a4a34af90
4
- data.tar.gz: 9b44bc4f51b98206dc4536742049ad5bf0b6093f
3
+ metadata.gz: eb0a221dbae3d1303dff2f6f52617ab02e105a2d
4
+ data.tar.gz: 2c91c80a71052fe269ca380e18bf73b156b3dde9
5
5
  SHA512:
6
- metadata.gz: 8f28c41dc2bdae4d6fca9b81e609d3f48dad43ff7469aedbf79d8affe38cec60c518bfbfc2becc17187a73efcf5ac225c9d02d87e8f7fcedce2374358514e5e2
7
- data.tar.gz: 359fd4c6710a62cce62b84d76841659e9871bc9f85053a8cd939bd357d2adcb18d28e374da9c8f9fd11dca0b9994292d755dbc631102a6b48407119b6a6f3021
6
+ metadata.gz: 905e8a4e965323dc8433c6365707ad316159e9048697c838212fb328e2c50f303a84a4b2a13283ea41092c0ab24799cc0e942ce98ac538e70564c5d32027c2db
7
+ data.tar.gz: a8e7c4271630137d2374ce44c29582f65580d6426eff5500cc75149350a337eb31247d246a30b2cfd57ab95bf16767634f7d6dd0a9be20573cd55b2c9cf405a7
@@ -66,16 +66,16 @@ module VagrantPlugins
66
66
  unless @machine.guest.capability(:bindfs_installed)
67
67
  @env[:ui].warn(I18n.t("vagrant.config.bindfs.not_installed"))
68
68
 
69
- unless @machine.guest.capability(:bindfs_install)
69
+ unless @machine.guest.capability(:install_bindfs)
70
70
  raise Vagrant::Bindfs::Error, :cannot_install
71
71
  end
72
72
  end
73
73
 
74
- unless @machine.guest.capability(:loaded_fuse?)
74
+ unless @machine.guest.capability(:fuse_loaded)
75
75
  @env[:ui].warn(I18n.t("vagrant.config.bindfs.not_loaded"))
76
76
 
77
- unless @machine.guest.capability(:modprobe_fuse)
78
- raise Vagrant::Bindfs::Error, :cannot_modprobe
77
+ unless @machine.guest.capability(:enable_fuse)
78
+ raise Vagrant::Bindfs::Error, :cannot_enable_fuse
79
79
  end
80
80
  end
81
81
  end
@@ -2,9 +2,9 @@ module VagrantPlugins
2
2
  module Bindfs
3
3
  module Cap
4
4
  module Debian
5
- module BindfsInstall
5
+ module InstallBindfs
6
6
 
7
- def self.bindfs_install(machine)
7
+ def self.install_bindfs(machine)
8
8
  machine.communicate.tap do |comm|
9
9
  comm.sudo("apt-get update")
10
10
  comm.sudo("apt-get install -y bindfs")
@@ -2,9 +2,9 @@ module VagrantPlugins
2
2
  module Bindfs
3
3
  module Cap
4
4
  module Fedora
5
- module BindfsInstall
5
+ module InstallBindfs
6
6
 
7
- def self.bindfs_install(machine)
7
+ def self.install_bindfs(machine)
8
8
  machine.communicate.tap do |comm|
9
9
  comm.sudo('yum -y install bindfs')
10
10
  end
@@ -8,17 +8,6 @@ module VagrantPlugins
8
8
  machine.communicate.test("bindfs --help")
9
9
  end
10
10
 
11
- def self.loaded_fuse?(machine)
12
- machine.communicate.test("lsmod | grep -q fuse || grep -q fuse /etc/modules")
13
- end
14
-
15
- def self.modprobe_fuse(machine)
16
- unless machine.communicate.test("grep -q fuse /etc/modules")
17
- machine.communicate.sudo("bash -c \"echo 'fuse' >> /etc/modules\"")
18
- end
19
- machine.communicate.sudo("/sbin/modprobe fuse")
20
- end
21
-
22
11
  end
23
12
  end
24
13
  end
@@ -0,0 +1,15 @@
1
+ module VagrantPlugins
2
+ module Bindfs
3
+ module Cap
4
+ module Linux
5
+ module EnableFuse
6
+
7
+ def self.enable_fuse(machine)
8
+ machine.communicate.sudo("/sbin/modprobe fuse")
9
+ end
10
+
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module VagrantPlugins
2
+ module Bindfs
3
+ module Cap
4
+ module Linux
5
+ module FuseLoaded
6
+
7
+ def self.fuse_loaded(machine)
8
+ machine.communicate.test("lsmod | grep -q fuse")
9
+ end
10
+
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ require "vagrant-bindfs/version"
2
+
3
+ module VagrantPlugins
4
+ module Bindfs
5
+ module Cap
6
+ module RedHat
7
+ module InstallBindfs
8
+
9
+ def self.install_bindfs(machine)
10
+ machine.communicate.tap do |comm|
11
+ if comm.test("test 0 -eq $(sudo yum search bindfs 2>&1 >/dev/null | wc -l)")
12
+ comm.sudo("yum -y install bindfs")
13
+ else
14
+ comm.sudo("yum -y install fuse fuse-devel gcc")
15
+ comm.sudo("wget http://bindfs.org/downloads/bindfs-#{SOURCE_VERSION}.tar.gz -O bindfs.tar.gz")
16
+ comm.sudo("tar --overwrite -zxvf bindfs.tar.gz")
17
+ comm.sudo("[ -d ./bindfs-#{SOURCE_VERSION} ] && cd bindfs-#{SOURCE_VERSION} && ./configure && make && make install")
18
+ comm.sudo("ln -s /usr/local/bin/bindfs /usr/bin")
19
+ end
20
+ end
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,10 +1,10 @@
1
1
  module VagrantPlugins
2
2
  module Bindfs
3
3
  module Cap
4
- module SUSE
5
- module BindfsInstall
4
+ module Suse
5
+ module InstallBindfs
6
6
 
7
- def self.bindfs_install(machine)
7
+ def self.install_bindfs(machine)
8
8
  machine.communicate.tap do |comm|
9
9
  comm.sudo("zypper -n install bindfs")
10
10
  end
@@ -0,0 +1,17 @@
1
+ module VagrantPlugins
2
+ module Bindfs
3
+ module Cap
4
+ module Ubuntu
5
+ module FuseLoaded
6
+
7
+ def self.fuse_loaded(machine)
8
+ # Ubuntu 6.10 and after automatically load fuse.
9
+ # Just check if it is installed
10
+ machine.communicate.test("test -e /dev/fuse")
11
+ end
12
+
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -152,8 +152,9 @@ module VagrantPlugins
152
152
  end
153
153
 
154
154
  def bindfs_version_lower_than(version)
155
- test_command = %{test "$(echo "%{v} $(sudo bindfs --version | cut -d" " -f2)" | tr " " "\n" | sort -V | tail -n 1)" == "%{v}"}
156
- @machine.communicate.test(test_command % { v: version})
155
+ bindfs_version_command = %{sudo bindfs --version | cut -d" " -f2}
156
+ bindfs_version = @machine.communicate.execute(bindfs_version_command);
157
+ Gem::Version.new(bindfs_version) < Gem::Version.new(version)
157
158
  end
158
159
 
159
160
  end
@@ -1,51 +1,63 @@
1
1
  module VagrantPlugins
2
2
  module Bindfs
3
3
  class Plugin < Vagrant.plugin("2")
4
+
4
5
  name "Bindfs"
5
6
  description <<-DESC
6
7
  This plugin allows you to mount -o bind filesystems inside the guest. This is
7
8
  useful to change their ownership and permissions.
8
9
  DESC
9
10
 
11
+
10
12
  config(:bindfs) do
11
13
  require "vagrant-bindfs/config"
12
14
  Config
13
15
  end
16
+
14
17
 
15
- guest_capability("debian", "bindfs_install") do
16
- require "vagrant-bindfs/cap/debian/bindfs_install"
17
- Cap::Debian::BindfsInstall
18
+ guest_capability("linux", "bindfs_installed") do
19
+ require "vagrant-bindfs/cap/linux/bindfs_installed"
20
+ Cap::Linux::BindfsInstalled
18
21
  end
19
22
 
20
- guest_capability("suse", "bindfs_install") do
21
- require "vagrant-bindfs/cap/suse/bindfs_install"
22
- Cap::SUSE::BindfsInstall
23
+
24
+ guest_capability("linux", "fuse_loaded") do
25
+ require "vagrant-bindfs/cap/linux/fuse_loaded"
26
+ Cap::Linux::FuseLoaded
27
+ end
28
+
29
+ guest_capability("ubuntu", "fuse_loaded") do
30
+ require "vagrant-bindfs/cap/ubuntu/fuse_loaded"
31
+ Cap::Ubuntu::FuseLoaded
23
32
  end
24
33
 
25
- guest_capability("fedora", "bindfs_install") do
26
- require 'vagrant-bindfs/cap/fedora/bindfs_install'
27
- Cap::Fedora::BindfsInstall
34
+
35
+ guest_capability("linux", "enable_fuse") do
36
+ require "vagrant-bindfs/cap/linux/enable_fuse"
37
+ Cap::Linux::EnableFuse
28
38
  end
39
+
29
40
 
30
- guest_capability("redhat", "bindfs_install") do
31
- require 'vagrant-bindfs/cap/redhat/bindfs_install'
32
- Cap::RedHat::BindfsInstall
41
+ guest_capability("debian", "install_bindfs") do
42
+ require "vagrant-bindfs/cap/debian/install_bindfs"
43
+ Cap::Debian::InstallBindfs
33
44
  end
34
45
 
35
- guest_capability("linux", "bindfs_installed") do
36
- require "vagrant-bindfs/cap/linux/bindfs_installed"
37
- Cap::Linux::BindfsInstalled
46
+ guest_capability("suse", "install_bindfs") do
47
+ require "vagrant-bindfs/cap/suse/install_bindfs"
48
+ Cap::Suse::InstallBindfs
38
49
  end
39
50
 
40
- guest_capability("linux", "loaded_fuse?") do
41
- require "vagrant-bindfs/cap/linux/bindfs_installed"
42
- Cap::Linux::BindfsInstalled
51
+ guest_capability("fedora", "install_bindfs") do
52
+ require 'vagrant-bindfs/cap/fedora/install_bindfs'
53
+ Cap::Fedora::InstallBindfs
43
54
  end
44
55
 
45
- guest_capability("linux", "modprobe_fuse") do
46
- require "vagrant-bindfs/cap/linux/bindfs_installed"
47
- Cap::Linux::BindfsInstalled
56
+ guest_capability("redhat", "install_bindfs") do
57
+ require 'vagrant-bindfs/cap/redhat/install_bindfs'
58
+ Cap::RedHat::InstallBindfs
48
59
  end
60
+
49
61
 
50
62
  require "vagrant-bindfs/bind"
51
63
 
@@ -60,6 +72,7 @@ module VagrantPlugins
60
72
  hook.before(target, Action::Bind)
61
73
  end
62
74
  end
75
+
63
76
  end
64
77
  end
65
78
  end
@@ -1,6 +1,6 @@
1
1
  module VagrantPlugins
2
2
  module Bindfs
3
- VERSION = "0.3.4"
3
+ VERSION = "0.4.0"
4
4
  SOURCE_VERSION = "1.12.6"
5
5
  end
6
6
  end
@@ -11,6 +11,7 @@ require "pathname"
11
11
 
12
12
  module VagrantPlugins
13
13
  module Bindfs
14
+
14
15
  def self.source_root
15
16
  @source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
16
17
  end
data/locales/en.yml CHANGED
@@ -12,7 +12,7 @@ en:
12
12
  destination_path_relative: "Destination path is relative for bind whatever"
13
13
  source_path_relative: "Source path is relative for bind whatever"
14
14
  source_path_not_exist: "Cannot bind source path %{path} because it doesn't exist"
15
- cannot_modprobe: "The fuse kernel module seems to not be loadable on the virtual machine"
15
+ cannot_enable_fuse: "The fuse kernel module seems to not be loadable on the virtual machine"
16
16
  binding_failed: |-
17
17
  The bind command `%{command}` failed to run!
18
18
 
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: 0.3.4
4
+ version: 0.4.0
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: 2015-01-17 00:00:00.000000000 Z
13
+ date: 2015-02-02 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: A Vagrant plugin to automate bindfs mount in the VM. This allow you to
16
16
  change owner, group and permissions on files and, for example, work around NFS share
@@ -26,11 +26,14 @@ files:
26
26
  - README.md
27
27
  - lib/vagrant-bindfs.rb
28
28
  - lib/vagrant-bindfs/bind.rb
29
- - lib/vagrant-bindfs/cap/debian/bindfs_install.rb
30
- - lib/vagrant-bindfs/cap/fedora/bindfs_install.rb
29
+ - lib/vagrant-bindfs/cap/debian/install_bindfs.rb
30
+ - lib/vagrant-bindfs/cap/fedora/install_bindfs.rb
31
31
  - lib/vagrant-bindfs/cap/linux/bindfs_installed.rb
32
- - lib/vagrant-bindfs/cap/redhat/bindfs_install.rb
33
- - lib/vagrant-bindfs/cap/suse/bindfs_install.rb
32
+ - lib/vagrant-bindfs/cap/linux/enable_fuse.rb
33
+ - lib/vagrant-bindfs/cap/linux/fuse_loaded.rb
34
+ - lib/vagrant-bindfs/cap/redhat/install_bindfs.rb
35
+ - lib/vagrant-bindfs/cap/suse/install_bindfs.rb
36
+ - lib/vagrant-bindfs/cap/ubuntu/fuse_loaded.rb
34
37
  - lib/vagrant-bindfs/command.rb
35
38
  - lib/vagrant-bindfs/config.rb
36
39
  - lib/vagrant-bindfs/errors.rb
@@ -1,28 +0,0 @@
1
- module VagrantPlugins
2
- module Bindfs
3
- module Cap
4
- module RedHat
5
- module BindfsInstall
6
-
7
- def self.bindfs_install(machine)
8
- machine.communicate.tap do |comm|
9
-
10
- require "vagrant-bindfs/version"
11
-
12
- if comm.test("grep \"CentOS release 6\" /etc/centos-release")
13
- comm.sudo("yum -y install fuse fuse-devel")
14
- comm.sudo("wget http://bindfs.org/downloads/bindfs-#{VagrantPlugins::Bindfs::SOURCE_VERSION}.tar.gz -O bindfs.tar.gz")
15
- comm.sudo("tar --overwrite -zxvf bindfs.tar.gz")
16
- comm.sudo("[ -d ./bindfs-#{VagrantPlugins::Bindfs::SOURCE_VERSION} ] && cd bindfs-#{VagrantPlugins::Bindfs::SOURCE_VERSION} && ./configure && make && make install")
17
- comm.sudo("ln -s /usr/local/bin/bindfs /usr/bin")
18
- else
19
- comm.sudo("yum -y install bindfs")
20
- end
21
- end
22
- end
23
-
24
- end # BindfsInstall
25
- end # RedHat
26
- end # Cap
27
- end # Bindfs
28
- end # VagrantPlugins