diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-07-02 16:14:58 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-07-02 16:14:58 -0700 |
commit | 1c170188f86d18ba9cb6bc2ac015a280fe4e999e (patch) | |
tree | e96aa9febca3a9efe20c1e233b5c197532ed60ed | |
parent | 48089338b337cdd1af6f07373e9e9ce0a41f90f1 (diff) | |
download | bundler-1c170188f86d18ba9cb6bc2ac015a280fe4e999e.tar.gz |
Tweak bundler's spec creation for the local source
-rw-r--r-- | lib/bundler/source.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index d6aebae5ec..3f4819aaf2 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -146,14 +146,17 @@ module Bundler def installed_specs @installed_specs ||= begin idx = Index.new - have_bundler = false Gem::SourceIndex.from_installed_gems.to_a.reverse.each do |name, spec| - have_bundler = true if name == 'bundler' && spec.version.to_s == VERSION + next if name == 'bundler' spec.source = self idx << spec end # Always have bundler locally - unless have_bundler + unless bundler = Gem.loaded_specs['bundler'] + # We're running bundler directly from the source + # so, let's create a fake gemspec for it (it's a path) + # gemspec + bundler = Gem::Specification.new do |s| s.name = 'bundler' s.version = VERSION @@ -162,8 +165,8 @@ module Bundler # TODO: Remove this s.loaded_from = 'w0t' end - idx << bundler end + idx << bundler idx end end |