diff options
author | Andre Arko <andre@arko.net> | 2010-04-21 17:39:59 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-04-23 10:18:24 -0700 |
commit | d215ddb47bf08d7cc4901af5e5f2ffc379486022 (patch) | |
tree | 6ab6f130aedb7077e2ead1175039ac63aecc2b18 /lib | |
parent | 6817ba53f0d004fc1ca2f9c611e3de710560bcbf (diff) | |
download | bundler-d215ddb47bf08d7cc4901af5e5f2ffc379486022.tar.gz |
When Bundler is being bundled, bundle the current version of bundler
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/resolver.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index a1371bd9..fddae444 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -98,8 +98,15 @@ module Bundler debug { "Requirements:\n" + reqs.map { |r| " #{r.name} (#{r.requirement})"}.join("\n") } activated = activated.dup - # Pull off the first requirement so that we can resolve it - current = reqs.shift + + if reqs.first.name == "bundler" && !activated["bundler"] + # activate the current version of bundler before other versions + bundler_version = ENV["BUNDLER_VERSION"] || Bundler::VERSION + current = Gem::Dependency.new("bundler", bundler_version, reqs.first.type) + else + # Pull off the first requirement so that we can resolve it + current = reqs.shift + end debug { "Attempting:\n #{current.name} (#{current.requirement})"} |