Updated rake docs for new command format

This commit is contained in:
Mitchell Hashimoto 2010-03-20 09:20:03 -07:00
parent 0906869486
commit 7997f99c9d
1 changed files with 7 additions and 4 deletions

View File

@ -55,15 +55,18 @@ env = Vagrant::Environment.load!("/path/to/my/project")
## Executing Commands ## Executing Commands
All available `vagrant` command line tools are available in code through All available `vagrant` command line tools are available in code through
the `Vagrant::Commands` class as class methods. The following is a sample the `commands` accessor on the environment instance. This allows you to
rake task that simply does the equivalent of `vagrant up`, but does some easily to run the command line tools in the context of an environment
useless things around it: without any extra fuss. The following is a simple rake task that simply
does the equivalent of `vagrant up` but does some extra, useless things
around it:
{% highlight ruby %} {% highlight ruby %}
# Example of emulating vagrant up with some code around it # Example of emulating vagrant up with some code around it
task :up do task :up do
puts "About to run vagrant-up..." puts "About to run vagrant-up..."
Vagrant::Commands.up env = Vagrant::Environment.load!
env.commands.up
puts "Finished running vagrant-up" puts "Finished running vagrant-up"
end end
{% endhighlight %} {% endhighlight %}