diff --git a/CHANGELOG.md b/CHANGELOG.md index 0000e6f77..fbb719ff0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.6.1 (unreleased) - + - Fix issues with Ruby 1.8.7 where Vagrant simply failed. ## 0.6.0 (September 27, 2010) diff --git a/lib/vagrant/config.rb b/lib/vagrant/config.rb index a59402c14..2acf68c9b 100644 --- a/lib/vagrant/config.rb +++ b/lib/vagrant/config.rb @@ -116,19 +116,19 @@ module Vagrant # # If you're looking to create your own configuration class, see {Base}. class Top < Base - @@configures = [] + @@configures = {} if !defined?(@@configures) class << self # The list of registered configuration classes as well as the key # they're registered under. def configures_list - @@configures ||= [] + @@configures ||= {} end # Registers a configuration class with the given key. This method shouldn't # be called. Instead, inherit from {Base} and call {Base.configures}. def configures(key, klass) - configures_list << [key, klass] + configures_list[key] = klass attr_reader key.to_sym end end diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 649ab2f77..1cb3c4e7b 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -28,7 +28,7 @@ module Vagrant [[:warn, :yellow], [:error, :red], [:info, nil], [:confirm, :green]].each do |method, color| class_eval <<-CODE def #{method}(message, opts=nil) - @shell.say("\#{line_reset}\#{format_message(message, opts)}", color) + @shell.say("\#{line_reset}\#{format_message(message, opts)}", "#{color}") end CODE end diff --git a/test/vagrant/config_test.rb b/test/vagrant/config_test.rb index e8276acb5..37dd3f628 100644 --- a/test/vagrant/config_test.rb +++ b/test/vagrant/config_test.rb @@ -138,7 +138,7 @@ class ConfigTest < Test::Unit::TestCase context "top config class" do setup do - @configures_list = [] + @configures_list = {} @klass::Top.stubs(:configures_list).returns(@configures_list) end @@ -149,8 +149,8 @@ class ConfigTest < Test::Unit::TestCase end should "add key and klass to configures list" do - @configures_list.expects(:<<).with([@key, @config_klass]) @klass::Top.configures(@key, @config_klass) + assert_equal @config_klass, @configures_list[@key] end end @@ -168,7 +168,7 @@ class ConfigTest < Test::Unit::TestCase instance = mock("instance#{i}") instance.expects(:env=).with(env) klass.expects(:new).returns(instance) - @configures_list << [key, klass] + @configures_list[key] = klass end @klass::Top.new(env)