Class: VagrantPlugins::HostPath::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-host-path/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



29
30
31
32
33
34
35
# File 'lib/vagrant-host-path/config.rb', line 29

def initialize
  @enabled      = UNSET_VALUE
  @env_key      = UNSET_VALUE
  @path_file    = UNSET_VALUE
  @profile_path = UNSET_VALUE
  @temp_upload_path = UNSET_VALUE
end

Instance Attribute Details

#enabledBool

Is plugin enabled or disabled.

Returns:

  • (Bool)


7
8
9
# File 'lib/vagrant-host-path/config.rb', line 7

def enabled
  @enabled
end

#env_keyString

The name of environment variable to set.

Returns:

  • (String)


12
13
14
# File 'lib/vagrant-host-path/config.rb', line 12

def env_key
  @env_key
end

#path_fileString

The path to the tmp file used to store the actual host path.

Returns:

  • (String)


17
18
19
# File 'lib/vagrant-host-path/config.rb', line 17

def path_file
  @path_file
end

#profile_pathString

The path to a profile file (typically inside of a /etc/profile.d/ dir).

Returns:

  • (String)


22
23
24
# File 'lib/vagrant-host-path/config.rb', line 22

def profile_path
  @profile_path
end

#temp_upload_pathString

The path to the tmp file used to upload profile path.

Returns:

  • (String)


27
28
29
# File 'lib/vagrant-host-path/config.rb', line 27

def temp_upload_path
  @temp_upload_path
end

Instance Method Details

#finalize!Object



37
38
39
40
41
42
43
# File 'lib/vagrant-host-path/config.rb', line 37

def finalize!
  @enabled      = true if @enabled == UNSET_VALUE
  @env_key      = "VAGRANT_HOST_PATH" if @env_key == UNSET_VALUE
  @path_file    = "/tmp/.vagrant-host-path" if @path_file == UNSET_VALUE
  @profile_path = "/etc/profile.d/vagrant-host-path.sh" if @profile_path == UNSET_VALUE
  @temp_upload_path = "/tmp/vagrant-host-path-profile.sh" if @temp_upload_path == UNSET_VALUE
end