Class: VagrantDestroy::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
DaptivChefCI::RakeTaskHelpers, Rake::DSL
Defined in:
lib/daptiv-chef-ci/vagrant_destroy_task.rb

Overview

Example usage, destroys a Vagrant box.

VagrantUp::RakeTask.new ‘up’ do |t|

t.destroy_timeout_in_seconds = 180

end

This class lets you define Rake tasks to drive Vagrant.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DaptivChefCI::RakeTaskHelpers

#execute, #exit_on_failure, #exit_on_failure=

Constructor Details

#initialize(name = 'vagrant_destroy', desc = 'Vagrant destroy task') {|_self| ... } ⇒ RakeTask

Returns a new instance of RakeTask.

Parameters:

  • name (String) (defaults to: 'vagrant_destroy')

    The task name.

  • desc (String) (defaults to: 'Vagrant destroy task')

    Description of the task.

Yields:

  • (_self)

Yield Parameters:



27
28
29
30
31
32
33
# File 'lib/daptiv-chef-ci/vagrant_destroy_task.rb', line 27

def initialize(name = 'vagrant_destroy', desc = 'Vagrant destroy task')
  @name, @desc = name, desc
  @destroy_timeout_in_seconds = 180
  @environment = {}
  yield self if block_given?
  define_task
end

Instance Attribute Details

#destroy_timeout_in_secondsObject

Returns the value of attribute destroy_timeout_in_seconds.



22
23
24
# File 'lib/daptiv-chef-ci/vagrant_destroy_task.rb', line 22

def destroy_timeout_in_seconds
  @destroy_timeout_in_seconds
end

#environmentObject

Returns the value of attribute environment.



23
24
25
# File 'lib/daptiv-chef-ci/vagrant_destroy_task.rb', line 23

def environment
  @environment
end

#vagrant_driver=(value) ⇒ Object

Sets the attribute vagrant_driver

Parameters:

  • value

    the value to set the attribute vagrant_driver to.



21
22
23
# File 'lib/daptiv-chef-ci/vagrant_destroy_task.rb', line 21

def vagrant_driver=(value)
  @vagrant_driver = value
end