Created
April 8, 2010 12:23
Revisions
-
henrik revised this gist
Apr 8, 2010 . 1 changed file with 1 addition and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,2 @@ 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 } -
henrik renamed this gist
Apr 8, 2010 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
henrik created this gist
Apr 8, 2010 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ root = '/Users/henrik/Sites/auktion/spec/models/auction' max = root.scan('/').length + 1 x = max.times { |i| path = "#{root}/#{'../'*i}spec_helper.rb" unless (found = Dir[path]).empty? break(File.expand_path(found.first)) end } p x