Class: Vagrant::Config::VMConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from 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.



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

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

Instance Attribute Details

#base_macObject

Returns the value of attribute base_mac.



73
74
75
# File 'lib/vagrant/config.rb', line 73

def base_mac
  @base_mac
end

#boxObject

Returns the value of attribute box.



71
72
73
# File 'lib/vagrant/config.rb', line 71

def box
  @box
end

#box_ovfObject

Returns the value of attribute box_ovf.



72
73
74
# File 'lib/vagrant/config.rb', line 72

def box_ovf
  @box_ovf
end

#disk_image_formatObject

Returns the value of attribute disk_image_format.



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

def disk_image_format
  @disk_image_format
end

#forwarded_portsObject (readonly)

Returns the value of attribute forwarded_ports.



75
76
77
# File 'lib/vagrant/config.rb', line 75

def forwarded_ports
  @forwarded_ports
end

#hd_locationObject

Returns the value of attribute hd_location.



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

def hd_location
  @hd_location
end

#project_directoryObject

Returns the value of attribute project_directory.



74
75
76
# File 'lib/vagrant/config.rb', line 74

def project_directory
  @project_directory
end

#provisionerObject

Returns the value of attribute provisioner.



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

def provisioner
  @provisioner
end

#shared_folder_gidObject

Returns the value of attribute shared_folder_gid.



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

def shared_folder_gid
  @shared_folder_gid
end

#shared_folder_uidObject

Returns the value of attribute shared_folder_uid.



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

def shared_folder_uid
  @shared_folder_uid
end

#shared_foldersObject (readonly)

Returns the value of attribute shared_folders.



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

def shared_folders
  @shared_folders
end

Instance Method Details

#customize(&block) ⇒ Object



117
118
119
# File 'lib/vagrant/config.rb', line 117

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

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



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

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

#share_folder(name, guestpath, hostpath) ⇒ Object



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

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