Created
April 8, 2010 12:23
-
-
Save henrik/360028 to your computer and use it in GitHub Desktop.
Find the closest spec_helper.rb, in the _root_ dir or an ancestor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = '/Users/henrik/Sites/auktion/spec/models/auction' | |
p (root.scan('/').length+1).times { |i| unless (r = Dir["#{root}/#{'../'*i}spec_helper.rb"]).empty?; break(File.expand_path(r.first)); end } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment