Class: Vagrant::Config::VMConfig

Inherits:
Base
  • Object
show all
Includes:
Util::StackedProcRunner
Defined in:
lib/vagrant/config.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#env

Instance Method Summary collapse

Methods included from Util::StackedProcRunner

#proc_stack, #push_proc, #run_procs!

Methods inherited from Base

#[], #instance_variables_hash, #to_json

Constructor Details

#initializeVMConfig

Returns a new instance of VMConfig.



89
90
91
92
93
# File 'lib/vagrant/config.rb', line 89

def initialize
  @forwarded_ports = {}
  @shared_folders = {}
  @provisioner = nil
end

Instance Attribute Details

#base_macObject

Returns the value of attribute base_mac.



79
80
81
# File 'lib/vagrant/config.rb', line 79

def base_mac
  @base_mac
end

#boxObject

Returns the value of attribute box.



77
78
79
# File 'lib/vagrant/config.rb', line 77

def box
  @box
end

#box_ovfObject

Returns the value of attribute box_ovf.



78
79
80
# File 'lib/vagrant/config.rb', line 78

def box_ovf
  @box_ovf
end

#disk_image_formatObject

Returns the value of attribute disk_image_format.



84
85
86
# File 'lib/vagrant/config.rb', line 84

def disk_image_format
  @disk_image_format
end

#forwarded_portsObject (readonly)

Returns the value of attribute forwarded_ports.



81
82
83
# File 'lib/vagrant/config.rb', line 81

def forwarded_ports
  @forwarded_ports
end

#hd_locationObject

Returns the value of attribute hd_location.



83
84
85
# File 'lib/vagrant/config.rb', line 83

def hd_location
  @hd_location
end

#project_directoryObject

Returns the value of attribute project_directory.



80
81
82
# File 'lib/vagrant/config.rb', line 80

def project_directory
  @project_directory
end

#provisionerObject

Returns the value of attribute provisioner.



85
86
87
# File 'lib/vagrant/config.rb', line 85

def provisioner
  @provisioner
end

#shared_folder_gidObject

Returns the value of attribute shared_folder_gid.



87
88
89
# File 'lib/vagrant/config.rb', line 87

def shared_folder_gid
  @shared_folder_gid
end

#shared_folder_uidObject

Returns the value of attribute shared_folder_uid.



86
87
88
# File 'lib/vagrant/config.rb', line 86

def shared_folder_uid
  @shared_folder_uid
end

#shared_foldersObject (readonly)

Returns the value of attribute shared_folders.



82
83
84
# File 'lib/vagrant/config.rb', line 82

def shared_folders
  @shared_folders
end

Instance Method Details

#customize(&block) ⇒ Object



123
124
125
# File 'lib/vagrant/config.rb', line 123

def customize(&block)
  push_proc(&block)
end

#forward_port(name, guestport, hostport, protocol = "TCP") ⇒ Object



95
96
97
98
99
100
101
# File 'lib/vagrant/config.rb', line 95

def forward_port(name, guestport, hostport, protocol="TCP")
  forwarded_ports[name] = {
    :guestport  => guestport,
    :hostport   => hostport,
    :protocol   => protocol
  }
end

#share_folder(name, guestpath, hostpath) ⇒ Object



103
104
105
106
107
108
# File 'lib/vagrant/config.rb', line 103

def share_folder(name, guestpath, hostpath)
  @shared_folders[name] = {
    :guestpath => guestpath,
    :hostpath => hostpath
  }
end