summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Tognazzini <donnie.tognazzini@appfolio.com>2016-01-27 13:11:11 -0800
committerDonnie Tognazzini <donnie.tognazzini@appfolio.com>2016-01-27 14:48:23 -0800
commit9963054247e6592e15f2ca9972a2f2843cd491b5 (patch)
tree1845fc24c5e3d295f65408804801657ba688c5c2
parent033fc4eda64916b02956fafa627faf68f2aa3a37 (diff)
downloadbundler-9963054247e6592e15f2ca9972a2f2843cd491b5.tar.gz
Fix the path to the Gemfile during evaluation.
`Bundler.default_gemfile` was being used instead of the explicitly passed Gemfile path. From: https://github.com/bundler/bundler/commit/ea3ded94a6f44dea237142b6b200e902cdd4d6ba
-rw-r--r--lib/bundler/dsl.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index b09a838fbb..3308f85bbb 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -28,10 +28,12 @@ module Bundler
@env = nil
@ruby_version = nil
@gemspecs = []
+ @gemfile = nil
add_git_sources
end
def eval_gemfile(gemfile, contents = nil)
+ @gemfile = Pathname.new(gemfile)
contents ||= Bundler.read_file(gemfile.to_s)
instance_eval(contents, gemfile.to_s, 1)
rescue Exception => e
@@ -47,7 +49,8 @@ module Bundler
glob = opts && opts[:glob]
name = opts && opts[:name] || "{,*}"
development_group = opts && opts[:development_group] || :development
- expanded_path = File.expand_path(path, Bundler.default_gemfile.dirname)
+ gemfile = @gemfile || Bundler.default_gemfile
+ expanded_path = File.expand_path(path, gemfile.dirname)
gemspecs = Dir[File.join(expanded_path, "#{name}.gemspec")]