Class: Berkshelf::Vagrant::Action::Install

Inherits:
Object
  • Object
show all
Defined in:
lib/berkshelf/vagrant/action/install.rb

Overview

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Install

Returns a new instance of Install.



10
11
12
13
14
# File 'lib/berkshelf/vagrant/action/install.rb', line 10

def initialize(app, env)
  @app       = app
  @shelf     = Berkshelf::Vagrant.shelf_for(env)
  @berksfile = Berksfile.from_file(env[:vm].config.berkshelf.berksfile_path)
end

Instance Attribute Details

#berksfileObject (readonly)

Returns the value of attribute berksfile.



8
9
10
# File 'lib/berkshelf/vagrant/action/install.rb', line 8

def berksfile
  @berksfile
end

#shelfObject (readonly)

Returns the value of attribute shelf.



7
8
9
# File 'lib/berkshelf/vagrant/action/install.rb', line 7

def shelf
  @shelf
end

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/berkshelf/vagrant/action/install.rb', line 16

def call(env)
  if Berkshelf::Vagrant.chef_solo?(env[:vm].config)
    configure_cookbooks_path(env)
    install(env)
  end

  @app.call(env)
rescue BerkshelfError => e
  raise VagrantWrapperError.new(e)
end