diff options
author | Andre Arko <andre@arko.net> | 2010-10-25 14:36:34 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-10-25 14:36:34 -0700 |
commit | 07ee571e79b3b1688c75f2d0c14f8c41bbed9663 (patch) | |
tree | 75289f69bb4dbd85319bac5b0722c916833330b0 /lib/bundler/shared_helpers.rb | |
parent | 3eb21057c747a35c4f48a078339b349e39ac84ef (diff) | |
download | bundler-07ee571e79b3b1688c75f2d0c14f8c41bbed9663.tar.gz |
Allow searching past bundler.gemspec outside of tests
Diffstat (limited to 'lib/bundler/shared_helpers.rb')
-rw-r--r-- | lib/bundler/shared_helpers.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 20354cd4..61dd448b 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -33,14 +33,17 @@ module Bundler private def find_gemfile - return ENV['BUNDLE_GEMFILE'] if ENV['BUNDLE_GEMFILE'] && !ENV['BUNDLE_GEMFILE'].empty? + given = ENV['BUNDLE_GEMFILE'] + return given if given && !given.empty? previous = nil current = File.expand_path(Dir.pwd) until !File.directory?(current) || current == previous - # avoid stepping above the tmp directory when testing - return nil if File.file?(File.join(current, 'bundler.gemspec')) + if ENV['BUNDLE_SPEC_RUN'] + # avoid stepping above the tmp directory when testing + return nil if File.file?(File.join(current, 'bundler.gemspec')) + end # otherwise return the Gemfile if it's there filename = File.join(current, 'Gemfile') |