vagrant-host-path 1.3.1 → 1.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: ecd0e673105d47e8c7afacea891b2330987ef6dd
4
- data.tar.gz: b15d112a48335757835c78cbb2bddf7e1332a25d
3
+ metadata.gz: 6383578d8cd3601bc433983eb910130b759d69d5
4
+ data.tar.gz: 0763278f3b0c33ef561a8c853f7f863b7204040c
5
5
  SHA512:
6
- metadata.gz: a245af44f23aa32d6c7520621f11593c68285c1ac82cbf1efe5f91da0eaacc2f2ce8c4becf1af9c2b056399877a7f4ab3905f5fd6562a133cfa080419288dbcf
7
- data.tar.gz: eddfa296074d14b15bbf80f523d8a48427e21b567eaf465071cb9715ee652516b58564bba2bf9976ba8e6098774c32d7d0793a9b95c5e89e0b1e1abd549f3182
6
+ metadata.gz: 3f45e7cff43df48400513e9ab08e83fb73cae8293f7a2e08bd5f0e9543086559c10a588faad8135354311753576d22076b96da5bff431126595b31c187a37026
7
+ data.tar.gz: 3ff8de362d41d7ba3f97d7c91705d3b501ab673474ec1fa556db042d432f70eb3beeb6fcce60ad84bf159a829ca98931fa0f999c01c019bebcb0886071f610c9
data/README.md CHANGED
@@ -36,15 +36,21 @@ And after that you can use the env var within your VM:
36
36
 
37
37
  ```ruby
38
38
  Vagrant::Config.run do |config|
39
-
40
- # The environment key to set
41
- config.host_path.env_key = "VAGRANT_HOST_PATH"
42
39
 
43
- # Temp file to save path to
44
- config.host_path.path_file = "/tmp/.vagrant-host-path"
40
+ if Vagrant.has_plugin?("vagrant-host-path")
41
+ # Enable or disable plugin (enabled by default)
42
+ config.host_path.enabled = true
43
+
44
+ # The environment key to set
45
+ config.host_path.env_key = "VAGRANT_HOST_PATH"
46
+
47
+ # Temp file to save path to
48
+ config.host_path.path_file = "/tmp/.vagrant-host-path"
49
+
50
+ # Profile script path
51
+ config.host_path.profile_path = "/etc/profile.d/vagrant-host-path.sh"
52
+ end
45
53
 
46
- # Profile script path
47
- config.host_path.profile_path = "/etc/profile.d/vagrant-host-path.sh"
48
54
  end
49
55
  ```
50
56
 
@@ -1,6 +1,11 @@
1
1
  module VagrantPlugins
2
2
  module HostPath
3
3
  class Config < Vagrant.plugin(2, :config)
4
+ # Is plugin enabled or disabled.
5
+ #
6
+ # @return [Bool]
7
+ attr_accessor :enabled
8
+
4
9
  # The name of environment variable to set.
5
10
  #
6
11
  # @return [String]
@@ -22,6 +27,7 @@ module VagrantPlugins
22
27
  attr_accessor :temp_upload_path
23
28
 
24
29
  def initialize
30
+ @enabled = UNSET_VALUE
25
31
  @env_key = UNSET_VALUE
26
32
  @path_file = UNSET_VALUE
27
33
  @profile_path = UNSET_VALUE
@@ -29,6 +35,7 @@ module VagrantPlugins
29
35
  end
30
36
 
31
37
  def finalize!
38
+ @enabled = true if @enabled == UNSET_VALUE
32
39
  @env_key = "VAGRANT_HOST_PATH" if @env_key == UNSET_VALUE
33
40
  @path_file = "/tmp/.vagrant-host-path" if @path_file == UNSET_VALUE
34
41
  @profile_path = "/etc/profile.d/vagrant-host-path.sh" if @profile_path == UNSET_VALUE
@@ -2,6 +2,7 @@ module VagrantPlugins
2
2
  module HostPath
3
3
  module Legacy
4
4
  class Config < Vagrant::Config::Base
5
+ attr_writer :enabled
5
6
  attr_writer :env_key
6
7
  attr_writer :path_file
7
8
  attr_writer :profile_path
@@ -9,6 +10,11 @@ module VagrantPlugins
9
10
 
10
11
  # FIXME: Defaults duplication here!
11
12
 
13
+ def enabled
14
+ return true if @enabled.nil?
15
+ @enabled
16
+ end
17
+
12
18
  def env_key
13
19
  @env_key || "VAGRANT_HOST_PATH"
14
20
  end
@@ -27,6 +27,7 @@ module VagrantPlugins
27
27
  end
28
28
 
29
29
  def setup
30
+ return unless config.enabled
30
31
  put_path_file(config, @vm.env.cwd)
31
32
  put_profile_file(config)
32
33
  @vm.ui.success "Host Path set!"
@@ -26,6 +26,7 @@ module VagrantPlugins
26
26
  end
27
27
 
28
28
  def setup
29
+ return unless config.enabled
29
30
  put_path_file(config, @machine.env.cwd)
30
31
  put_profile_file(config)
31
32
  @machine.ui.success "Host Path set!"
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module HostPath
3
- VERSION = "1.3.1"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-host-path
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MOZGIII
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-08 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,8 +82,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.1.10
85
+ rubygems_version: 2.4.1
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: The host path to your project in the environment variable in the VM for Vagrant.
89
89
  test_files: []
90
+ has_rdoc: