Class: Vito::Tasks::VagrantBootstrap
- Inherits:
-
Object
- Object
- Vito::Tasks::VagrantBootstrap
- Defined in:
- lib/vito/tasks/vagrant_bootstrap.rb
Instance Method Summary collapse
-
#initialize(os_name) ⇒ VagrantBootstrap
constructor
A new instance of VagrantBootstrap.
- #install ⇒ Object
Constructor Details
#initialize(os_name) ⇒ VagrantBootstrap
Returns a new instance of VagrantBootstrap.
4 5 6 |
# File 'lib/vito/tasks/vagrant_bootstrap.rb', line 4 def initialize(os_name) @os_name = os_name end |
Instance Method Details
#install ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vito/tasks/vagrant_bootstrap.rb', line 8 def install puts "=> Initializing #{os_name} box called #{os_name}_test_box into: #{box_location(os_name)}" pwd = Dir.pwd Dir.chdir("spec/vagrant_boxes/#{os_name}") puts "Attempting to download and prepare the box..." system "vagrant up && vagrant halt" puts "Attempting to take snapshot of clean box..." install_snapshot_plugin system "vagrant snapshot take #{snapshot_name}" unless snapshot_exist? puts "Done.\n" Dir.chdir(pwd) end |