summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-07-15 11:37:42 -0700
committerCarl Lerche <carllerche@mac.com>2010-07-15 11:37:42 -0700
commita0082b979c0c60b0ba49fce99c173d80794c3d50 (patch)
tree4a0aea4450a8bfb3a6eeab7673ef59fec4b7fa66
parentaebee5916f3613cfeec2d751d4db503388901a42 (diff)
downloadbundler-a0082b979c0c60b0ba49fce99c173d80794c3d50.tar.gz
Make sure that bundle show bundler shows the correct path
-rw-r--r--lib/bundler/cli.rb3
-rw-r--r--spec/other/show_spec.rb7
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index e468232e4c..786f9eb391 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -297,6 +297,9 @@ module Bundler
def locate_gem(name)
spec = Bundler.load.specs.find{|s| s.name == name }
raise GemNotFound, "Could not find gem '#{name}' in the current bundle." unless spec
+ if spec.name == 'bundler'
+ return File.expand_path('../../../', __FILE__)
+ end
spec.full_gem_path
end
diff --git a/spec/other/show_spec.rb b/spec/other/show_spec.rb
index dcac7c1053..a90a14bee5 100644
--- a/spec/other/show_spec.rb
+++ b/spec/other/show_spec.rb
@@ -13,6 +13,11 @@ describe "bundle show" do
out.should == default_bundle_path('gems', 'rails-2.3.2').to_s
end
+ it "prints the path to the running bundler" do
+ bundle "show bundler"
+ out.should == File.expand_path('../../../../../', __FILE__)
+ end
+
it "complains if gem not in bundle" do
bundle "show missing"
out.should =~ /could not find gem 'missing'/i
@@ -75,4 +80,4 @@ describe "bundle show with a git repo" do
bundle :show
out.should include("foo (1.0 #{sha[0..6]})")
end
-end \ No newline at end of file
+end