mitchellh/vagrant — pull request #915 by ryanlecompte (2012-05-06 08:51:25+00:00)
Title: Fix support for multiple unique easy commands

So, it turns out that my original issue with the class variable usage for Vagrant::Easy::CommandBase actually causes issues. I wrote a small test that fails with the current codebase:

```ruby
it "should support registering multiple unique commands" do
plugins = %w(foo bar baz).map do |cmd|
[cmd, Vagrant::Easy.create_command(cmd)]
end

plugins.each do |cmd, plugin|
plugin.class_variable_get(:@@command).should == cmd
end
end
```

The above test will fail since @@command will end up having the value 'baz' for all three easy commands. This is because class variables will be shared across new subclasses of Vagrant::Easy::CommandBase:

```ruby
def self.create_command(name, &block)
# Create a new command class for this command, and return it
command = Class.new(CommandBase)
command.configure(name, &block)
command
end
```

The fix is to not use class variables and instead use class instance variables for @@command and @@runner.