summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2018-11-16 02:44:32 +0000
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2018-11-16 20:07:02 +0900
commit02cd16945342a5a74051c04d208337f170464f34 (patch)
tree0546f87c842e25e14d17f7bb451d3e696f9ba9b7 /lib
parent2dd5d81402bbeb17f31fc371513033753daf4a10 (diff)
downloadbundler-02cd16945342a5a74051c04d208337f170464f34.tar.gz
Merge #6743
6743: Support file structure of ruby core repository. r=hsbt a=hsbt In the ruby core repository, I put bundler executable and bundler libraries under the `bin` and `lib` directories. It breaks the current behavior. Support the structure of ruby core repository. Co-authored-by: SHIBATA Hiroshi <hsbt@ruby-lang.org> (cherry picked from commit 172ec59db53ec05a91c0d9eb72e2d715ae82f3c0)
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/shared_helpers.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index f0f576f931..50214901c5 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -274,7 +274,15 @@ module Bundler
until !File.directory?(current) || current == previous
if ENV["BUNDLE_SPEC_RUN"]
# avoid stepping above the tmp directory when testing
- return nil if File.file?(File.join(current, "bundler.gemspec"))
+ 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|
@@ -303,10 +311,12 @@ module Bundler
unless File.exist?(exe_file)
exe_file = File.expand_path("../../../exe/bundle", __FILE__)
end
-
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
rescue Gem::GemNotFoundException
- Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", File.expand_path("../../../exe/bundle", __FILE__)
+ exe_file = File.expand_path("../../../exe/bundle", __FILE__)
+ # for Ruby core repository
+ exe_file = File.expand_path("../../../../bin/bundle", __FILE__) unless File.exist?(exe_file)
+ Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
end
# Set BUNDLE_GEMFILE