diff options
author | Carl Lerche <carllerche@mac.com> | 2010-02-10 21:33:17 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-02-10 21:40:08 -0800 |
commit | fc55262bc6183baefb329b9088a2d5966a7e33be (patch) | |
tree | d3842881f2530f00bed61ea3cfefe4cd6df8edea | |
parent | 3d82929cf9330b1e25e29d312c8c26ac48ad2db2 (diff) | |
parent | 34182ef4c41e47805cc92988d088d0abb439e27a (diff) | |
download | bundler-fc55262bc6183baefb329b9088a2d5966a7e33be.tar.gz |
Merge remote branch 'bluehavana/master'
-rw-r--r-- | lib/bundler/source.rb | 3 | ||||
-rw-r--r-- | spec/install/path_spec.rb | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 7f98f08469..7dd16ef3f9 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -160,9 +160,10 @@ module Bundler if File.directory?(path) Dir["#{path}/#{@glob}"].each do |file| file = Pathname.new(file) + relative_path = file.relative_path_from(Pathname.new(path)) # Do it in the root of the repo in case they do # assume being in the root - if spec = Dir.chdir(path) { eval(File.read(file)) } + if spec = Dir.chdir(path) { eval(File.read(relative_path)) } spec = Specification.from_gemspec(spec) spec.loaded_from = file spec.source = self diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index 83114122ca..0e77485cec 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -21,6 +21,18 @@ describe "gemfile install with explicit source paths" do should_be_installed("foo 1.0") end + + it "supports relative paths" do + build_lib "foo" + + relative_path = lib_path('foo-1.0').relative_path_from(Pathname.new(Dir.pwd)) + + install_gemfile <<-G + gem 'foo', :path => "#{relative_path}" + G + + should_be_installed("foo 1.0") + end it "installs dependencies from the path even if a newer gem is available elsewhere" do system_gems "rack-1.0.0" @@ -50,7 +62,7 @@ describe "gemfile install with explicit source paths" do build_lib "omg", "1.0", :path => lib_path("omg") do |s| s.add_dependency "foo" end - + build_lib "foo", "1.0.0", :path => lib_path("omg/foo") install_gemfile <<-G |