diff options
author | Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2010-06-22 22:17:51 +0200 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-06-22 13:39:48 -0700 |
commit | 374d1ee968fd5081074a370d81531d1fe1d0bbf4 (patch) | |
tree | 305e677b96b322d0d64350ac21309b8427764482 | |
parent | 12f8359d96d2469cb5792345d6f4249428b626d6 (diff) | |
download | bundler-374d1ee968fd5081074a370d81531d1fe1d0bbf4.tar.gz |
Make sure to only split by dashes the final part of the gem path.
This avoids test failure (and bogus information reported by bundler) if the
base path contains random dashes.
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index bf74a60562..c8008274c4 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -26,7 +26,7 @@ module Gem def git_version if @loaded_from && File.exist?(File.join(full_gem_path, ".git")) sha = Dir.chdir(full_gem_path){ `git rev-parse HEAD`.strip } - branch = full_gem_path.split("-")[3] + branch = full_gem_path.match(/gems\/.*/).to_s.split("-")[3] (branch && branch != sha) ? " #{branch}-#{sha[0...6]}" : " #{sha[0...6]}" end end |