Class: Builderator::Tasks::Vagrant
- Inherits:
-
Thor
- Object
- Thor
- Builderator::Tasks::Vagrant
- Includes:
- Thor::Actions
- Defined in:
- lib/builderator/tasks/vagrant.rb
Instance Method Summary collapse
- #destroy(*args) ⇒ Object
-
#initialize(*_) ⇒ Vagrant
constructor
A new instance of Vagrant.
- #provision(*args) ⇒ Object
- #rebuild(*args) ⇒ Object
- #up(*args) ⇒ Object
Constructor Details
#initialize(*_) ⇒ Vagrant
Returns a new instance of Vagrant.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/builderator/tasks/vagrant.rb', line 12 def initialize(*_) unless Gem.loaded_specs.key?('vagrant') say '!!! Vagrant is not available in this bundle !!!!', [:red, :bold] puts '' say 'Please add the following to your Gemfile and update your bundle to use the `vagrant` command:' say ' +------------------------------------------------+', :green say " | gem 'vagrant', :github => 'mitchellh/vagrant', |", :green say " | :tag => 'v1.7.4' |", :green say ' +------------------------------------------------+', :green exit 1 end super end |
Instance Method Details
#destroy(*args) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/builderator/tasks/vagrant.rb', line 50 def destroy(*args) command = 'ulimit -n 1024;' command << ' VAGRANT_I_KNOW_WHAT_IM_DOING_PLEASE_BE_QUIET=true' command << " vagrant destroy #{ args.join(' ') }" command << ' -f' if ['force'] run command end |
#provision(*args) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/builderator/tasks/vagrant.rb', line 39 def provision(*args) command = 'ulimit -n 1024;' command << ' VAGRANT_I_KNOW_WHAT_IM_DOING_PLEASE_BE_QUIET=true' command << " vagrant provision #{ args.join(' ') }" invoke Tasks::Berks, 'local', [], run command end |