diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-01-17 14:10:46 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-02-27 21:21:35 +0100 |
commit | b8da66bf6efde9f995999c2dce7e36603d9c2bb4 (patch) | |
tree | f9cc98205c13a0b3798d76558a814f839806fbb4 /lib | |
parent | 12181a40b1d069b8e862142cf7ee6a4da1b74e7c (diff) | |
download | bundler-b8da66bf6efde9f995999c2dce7e36603d9c2bb4.tar.gz |
Revert "Revert "Add all platforms to lockfile by default""
This reverts commit b5766564fb6ad9c74c3b87ad6b2965f3b9095d08.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli/outdated.rb | 6 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 3d4922f8b5..5f065654b1 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -76,6 +76,8 @@ module Bundler next unless gems.empty? || gems.include?(current_spec.name) active_spec = retrieve_active_spec(definition, current_spec) + next unless active_spec + next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options) gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version) @@ -144,6 +146,8 @@ module Bundler end def retrieve_active_spec(definition, current_spec) + return unless current_spec.match_platform(Bundler.local_platform) + if strict active_spec = definition.find_resolved_spec(current_spec) else @@ -231,8 +235,6 @@ module Bundler end def update_present_via_semver_portions(current_spec, active_spec, options) - return false if active_spec.nil? - current_major = current_spec.version.segments.first active_major = active_spec.version.segments.first diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index efd7618194..d723384189 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -117,7 +117,7 @@ module Bundler end @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version) - add_current_platform unless Bundler.frozen_bundle? + add_platforms unless Bundler.frozen_bundle? converge_path_sources_to_gemspec_sources @path_changes = converge_paths @@ -548,6 +548,12 @@ module Bundler private + def add_platforms + (@dependencies.flat_map(&:expanded_platforms) + current_platforms).uniq.each do |platform| + add_platform(platform) + end + end + def current_platforms current_platform = Bundler.local_platform [].tap do |platforms| |