Class: ChefWorkflow::VagrantSupport

Inherits:
Object
  • Object
show all
Extended by:
AttrSupport
Includes:
GenericSupport
Defined in:
lib/chef-workflow/support/vagrant.rb

Overview

Vagrant configuration settings. Uses ‘GenericSupport`.

Constant Summary collapse

DEFAULT_VAGRANT_BOX =

The default vagrant box we use for provisioning.

"http://files.vagrantup.com/precise32.box"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttrSupport

fancy_attr

Methods included from GenericSupport

included

Constructor Details

#initialize(box_url = DEFAULT_VAGRANT_BOX) ⇒ VagrantSupport

– FIXME: support non-url boxes and ram configurations ++



24
25
26
# File 'lib/chef-workflow/support/vagrant.rb', line 24

def initialize(box_url=DEFAULT_VAGRANT_BOX)
  self.box_url = box_url
end

Instance Attribute Details

#boxObject (readonly)

the calculated box, currently taken from the box_url. Expect this to change.



17
18
19
# File 'lib/chef-workflow/support/vagrant.rb', line 17

def box
  @box
end

Instance Method Details

#box_url(arg = nil) ⇒ Object

Set or retrieve the box_url. See #box_url=.



31
32
33
34
35
36
37
# File 'lib/chef-workflow/support/vagrant.rb', line 31

def box_url(arg=nil)
  if arg
    self.box_url = arg
  end

  @box_url
end

#box_url=(url) ⇒ Object

Set the box_url. The box name is derived from the url currently.



42
43
44
45
# File 'lib/chef-workflow/support/vagrant.rb', line 42

def box_url=(url)
  @box_url = url
  @box = File.basename(url).gsub(/\.box$/, '')
end