Skip to content

Commit

Permalink
Don't use Pathname#each_child for 1.8.7 compat [hashicorpGH-979]
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mitchellh committed Jun 23, 2012
1 parent e02f694 commit d8c1603
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vagrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ def self.require_plugin(name)
# 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?

# Load from this directory, and exit if we successfully loaded a plugin
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

0 comments on commit d8c1603

Please sign in to comment.