lib/serverspec/setup.rb in serverspec-0.7.1 vs lib/serverspec/setup.rb in serverspec-0.7.2
- old
+ new
@@ -196,11 +196,19 @@
end
puts ' + Rakefile'
end
end
+ def self.find_vagrantfile
+ Pathname.new(Dir.pwd).ascend do |dir|
+ path = File.expand_path("Vagrantfile", dir)
+ return path if File.exists?(path)
+ end
+ nil
+ end
+
def self.auto_vagrant_configuration
- if File.exists?("Vagrantfile")
+ if find_vagrantfile
vagrant_list = `vagrant status`
list_of_vms = []
if vagrant_list != ''
vagrant_list.each_line do |line|
if match = /([a-z]+[\s]+)(created|not created|poweroff|running|saved)[\s](\(virtualbox\)|\(vmware\))/.match(line)