From 0887a180796a541cd45359ad723f3cec2e66fca6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 26 Dec 2011 17:45:55 -0800 Subject: [PATCH] Make some fixes to get tests passing on Ruby 1.8.7 --- lib/vagrant/action/warden.rb | 4 ++++ lib/vagrant/environment.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/action/warden.rb b/lib/vagrant/action/warden.rb index 8a5d4978d..83f906f7c 100644 --- a/lib/vagrant/action/warden.rb +++ b/lib/vagrant/action/warden.rb @@ -68,6 +68,10 @@ module Vagrant def finalize_action(action, env) klass, args, block = action + # Default the arguments to an empty array. Otherwise in Ruby 1.8 + # a `nil` args will actually pass `nil` into the class. + args ||= [] + if klass.is_a?(Class) # A action klass which is to be instantiated with the # app, env, and any arguments given diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 45518817e..0635f755a 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -175,7 +175,7 @@ module Vagrant # # @return [Action::Runner] def action_runner - @action_runner ||= Action::Runner.new(action_registry) do |env| + @action_runner ||= Action::Runner.new(action_registry) do { :action_runner => action_runner, :box_collection => boxes,