Skip to content

Instantly share code, notes, and snippets.

@henrik
Created April 8, 2010 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save henrik/360028 to your computer and use it in GitHub Desktop.
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.
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