Class: VagrantPlugins::Berkshelf::Action::Base
- Inherits:
-
Object
- Object
- VagrantPlugins::Berkshelf::Action::Base
- Includes:
- Helpers
- Defined in:
- lib/vagrant-berkshelf/action/base.rb
Class Method Summary collapse
-
.clean ⇒ Object
Cleanup any shared folders before destroying the VM.
-
.provision ⇒ Object
Provision the VM, calling setup, install, and upload.
-
.setup ⇒ Object
Setup all the required middlemare, including checking for the presence of Berkshelf, checking for the proper version of Berkshelf, and loading the datafile from disk.
Instance Method Summary collapse
-
#initialize(app, env) ⇒ Base
constructor
A new instance of Base.
Methods included from Helpers
#berks, #berks_bin, #berkshelf_enabled?, #chef_client?, #chef_solo?, #chef_zero?, #datafile_path, #provision_enabled?, #provisioners, #with_clean_env
Constructor Details
#initialize(app, env) ⇒ Base
Returns a new instance of Base.
40 41 42 43 44 45 |
# File 'lib/vagrant-berkshelf/action/base.rb', line 40 def initialize(app, env) @app = app klass = self.class.name.downcase.split('::').last @logger = Log4r::Logger.new("vagrant::berkshelf::#{klass}") end |
Class Method Details
.clean ⇒ Object
Cleanup any shared folders before destroying the VM.
10 11 12 13 14 15 |
# File 'lib/vagrant-berkshelf/action/base.rb', line 10 def self.clean Vagrant::Action::Builder.new.tap do |b| b.use setup b.use Action::Clean end end |
.provision ⇒ Object
Provision the VM, calling setup, install, and upload.
18 19 20 21 22 23 24 |
# File 'lib/vagrant-berkshelf/action/base.rb', line 18 def self.provision Vagrant::Action::Builder.new.tap do |b| b.use Action::Save b.use Action::Install b.use Action::Upload end end |
.setup ⇒ Object
Setup all the required middlemare, including checking for the presence of Berkshelf, checking for the proper version of Berkshelf, and loading the datafile from disk.
29 30 31 32 33 34 35 36 |
# File 'lib/vagrant-berkshelf/action/base.rb', line 29 def self.setup Vagrant::Action::Builder.new.tap do |b| b.use Action::Check b.use Vagrant::Action::Builtin::EnvSet, berkshelf: Env.new b.use Action::Load b.use Action::Share end end |