Ruby 1.8 compatibility
This commit is contained in:
parent
dd31453c1a
commit
4c6673270a
|
@ -324,10 +324,13 @@ module Vagrant
|
|||
return @root_path if defined?(@root_path)
|
||||
|
||||
root_finder = lambda do |path|
|
||||
vagrantfile_name.each do |rootfile|
|
||||
return path if File.exist?(File.join(path.to_s, rootfile))
|
||||
# Note: To remain compatible with Ruby 1.8, we have to use
|
||||
# a `find` here instead of an `each`.
|
||||
found = vagrantfile_name.find do |rootfile|
|
||||
File.exist?(File.join(path.to_s, rootfile))
|
||||
end
|
||||
|
||||
return path if found
|
||||
return nil if path.root? || !File.exist?(path)
|
||||
root_finder.call(path.parent)
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'thread'
|
||||
|
||||
module Vagrant
|
||||
module Util
|
||||
# Atomic counter implementation. This is useful for incrementing
|
||||
|
|
Loading…
Reference in New Issue