<commit_before># Vagrant::List

TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

    gem 'vagrant-list'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install vagrant-list

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request<commit_msg>Add README<commit_after>vagrant-list
=====

### What does it do?

`vagrant-list` adds a command to the Vagrant CLI to list both all VMs known to VirtualBox, as well as any that are running. It's handy for seeing what all your VMs are up to.


### How do I install it?

#### Using bundler?
Just add `gem 'vagrant-list'` to your `Gemfile`

#### Not using bundler?
Untested, but just running `gem install vagrant-list` should have the same effect.

### How do I use it?

#### From the CLI
`vagrant-list` adds just one command to vagrant - `list`. 
For example, this following command will list the VMs:

`bundle exec vagrant list` will output:

``` sh
[vagrant] ALL:
[vagrant] 35279736-412a-47b0-aa09-b1aef373a9c7: IE7 (Windows Vista)
[vagrant] ebb807dd-64d6-4a17-87f8-1d6d80a3f467: IE8 (Windows 7)
[vagrant] 4db11a4d-0a97-48c4-8b23-9cb2ca4fcb93: IE9 (Windows 7)
[vagrant] 508bf5cd-dcce-48f6-b19d-287fba4306d6: Windows XP (Windows XP)
[vagrant] 729322cf-e11d-438c-b9dc-6b1d31e9a56d: Python Development (Windows XP)
[vagrant] RUNNING:
[vagrant] ebb807dd-64d6-4a17-87f8-1d6d80a3f467: IE8 (Windows 7)
```

#### From your own code

`vagrant-list` handily extends the driver for VirtualBox 4.1 to query both running and all VMs (previous to this you could only query all). If you'd like to use this feature in your code, you should just be able to add the gem to your `Gemfile`, and then run:


`Vagrant::Driver::VirtualBox.new(nil).read_vms(:vms)` to show **all** VMs (default), or `Vagrant::Driver::VirtualBox.new(nil).read_vms(:runningvms)` to show **running** VMs.

### Running Tests

The code has exactly three specs that check:

* That the overridden driver method lists a known VM
* That the overridden driver method does not list an unknown VM
* That the overridden driver method lists a running VM

Unfortunately, because we are almost directly interacting with the VirtualBox command line tools, there is little opportunity for mocking or stubbing virtual machines. 

**Therefore, in order for the specs to pass, it is required that you have a VM called 'Test' running when the specs are run. It doesn't matter what this VM _is_ (XP, Ubuntu etc.), just as long as it's there**

### License

This open source software is licensed under the MIT License.

---
** If this project has been useful to you, I ask that you consider a donation to an open source project in need - check out my donations page at http://joshmcarthur.com/donations for projects that I've donated to for inspiration.**
{'fraction_non_alphanumeric': 0.093038601121742, 'fraction_numerical': 0.04289013526888816, 'mean_word_length': 4.395017793594306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4834479', 'n_tokens_mistral': 1077, 'n_tokens_neox': 977, 'n_words': 422}