diff options
author | chrismo <chrismo@clabs.org> | 2016-06-20 01:25:07 -0500 |
---|---|---|
committer | chrismo <chrismo@clabs.org> | 2016-07-08 19:35:57 -0500 |
commit | b26b54cc6f993309512f1a10733f17af49122d67 (patch) | |
tree | 4b9b7e0e809ee7f2745eb1ec958aaefba29d231d /lib/bundler/definition.rb | |
parent | 5f63cad355e7736acaefab3c40266d033f67a4b8 (diff) | |
download | bundler-b26b54cc6f993309512f1a10733f17af49122d67.tar.gz |
GemVersionPromoter refactor
UpdateOptions which was then renamed to DependencySearch is now called
GemVersionPromoter, cuz I can't name this damn class. It's in its own
file now, so there's that.
I took a shot at moving Resolver#search_for into it, but had naively
overlooked a few instance variables and such and it just didn't make as
much sense as I'd first envisioned. Probably some other smaller classes
in between perhaps.
GemVersionPromoter class now caching its results, too, and I moved out
the return from it back into Resolver as it made more sense there. As a
standalone class, it may make sense to have this actually implement
:major sorting, but maybe later.
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r-- | lib/bundler/definition.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index c1d4d18aa6..73e1c009d0 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -7,7 +7,7 @@ module Bundler class Definition include GemHelpers - attr_reader :dependencies, :platforms, :ruby_version, :locked_deps, :dependency_search + attr_reader :dependencies, :platforms, :ruby_version, :locked_deps, :gem_version_promoter # Given a gemfile and lockfile creates a Bundler definition # @@ -94,7 +94,7 @@ module Bundler end @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version) - @dependency_search = Resolver::DependencySearch.new(@locked_specs, @unlock[:gems]) + @gem_version_promoter = GemVersionPromoter.new(@locked_specs, @unlock[:gems]) current_platform = Bundler.rubygems.platforms.map {|p| generic(p) }.compact.last add_platform(current_platform) @@ -223,7 +223,7 @@ module Bundler else # Run a resolve against the locally available gems Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}") - last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, ruby_version, dependency_search) + last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, ruby_version, gem_version_promoter) end end end |