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.
This commit is contained in:
Mitchell Hashimoto 2012-06-22 20:47:43 -07:00
parent e02f694712
commit d8c16035c8
1 changed files with 2 additions and 2 deletions

View File

@ -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