From d8c16035c87f8ad04d779198c136bc150a2bb06b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 22 Jun 2012 20:47:43 -0700 Subject: [PATCH] Don't use Pathname#each_child for 1.8.7 compat [GH-979] each_child is a 1.9.x feature. The implementation however is simple enough that I copied it over and just use the 1.8.7 compatible version. --- lib/vagrant.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant.rb b/lib/vagrant.rb index cc10d327c..e0d339bb6 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -158,7 +158,7 @@ end # plugins are allowed to be in a directory in `plugins` or at most one # directory deep within the plugins directory. So a plugin can be at # `plugins/foo` or also at `plugins/foo/bar`, but no deeper. -Vagrant.source_root.join("plugins").each_child do |directory| +Vagrant.source_root.join("plugins").children(true).each do |directory| # Ignore non-directories next if !directory.directory? @@ -166,5 +166,5 @@ Vagrant.source_root.join("plugins").each_child do |directory| next if plugin_load_proc.call(directory) # Otherwise, attempt to load from sub-directories - directory.each_child(&plugin_load_proc) + directory.children(true).each(&plugin_load_proc) end