method
search_up
Ruby latest stable (v2_5_5)
-
0 notes -
Class: SharedHelpers
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
search_up(*names)
private
Hide source
# File lib/bundler/shared_helpers.rb, line 270 def search_up(*names) previous = nil current = File.expand_path(SharedHelpers.pwd).untaint until !File.directory?(current) || current == previous if ENV["BUNDLE_SPEC_RUN"] # avoid stepping above the tmp directory when testing gemspec = if ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"] # for Ruby Core "lib/bundler.gemspec" else "bundler.gemspec" end # avoid stepping above the tmp directory when testing return nil if File.file?(File.join(current, gemspec)) end names.each do |name| filename = File.join(current, name) yield filename end previous = current current = File.expand_path("..", current) end end