bundler 2.2.20 → 2.2.24

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +56 -0
  3. data/lib/bundler.rb +5 -6
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli.rb +1 -0
  6. data/lib/bundler/cli/doctor.rb +11 -1
  7. data/lib/bundler/cli/install.rb +7 -8
  8. data/lib/bundler/cli/lock.rb +5 -1
  9. data/lib/bundler/cli/update.rb +8 -3
  10. data/lib/bundler/current_ruby.rb +4 -4
  11. data/lib/bundler/definition.rb +46 -85
  12. data/lib/bundler/dsl.rb +11 -22
  13. data/lib/bundler/feature_flag.rb +0 -2
  14. data/lib/bundler/fetcher/compact_index.rb +1 -1
  15. data/lib/bundler/fetcher/downloader.rb +1 -2
  16. data/lib/bundler/index.rb +1 -5
  17. data/lib/bundler/installer.rb +5 -12
  18. data/lib/bundler/installer/standalone.rb +1 -1
  19. data/lib/bundler/lockfile_parser.rb +2 -20
  20. data/lib/bundler/man/bundle-add.1 +1 -1
  21. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  22. data/lib/bundler/man/bundle-cache.1 +1 -1
  23. data/lib/bundler/man/bundle-check.1 +1 -1
  24. data/lib/bundler/man/bundle-clean.1 +1 -1
  25. data/lib/bundler/man/bundle-config.1 +1 -4
  26. data/lib/bundler/man/bundle-config.1.ronn +0 -3
  27. data/lib/bundler/man/bundle-doctor.1 +1 -1
  28. data/lib/bundler/man/bundle-exec.1 +1 -1
  29. data/lib/bundler/man/bundle-gem.1 +1 -1
  30. data/lib/bundler/man/bundle-info.1 +1 -1
  31. data/lib/bundler/man/bundle-init.1 +1 -1
  32. data/lib/bundler/man/bundle-inject.1 +1 -1
  33. data/lib/bundler/man/bundle-install.1 +1 -1
  34. data/lib/bundler/man/bundle-list.1 +1 -1
  35. data/lib/bundler/man/bundle-lock.1 +1 -1
  36. data/lib/bundler/man/bundle-open.1 +1 -1
  37. data/lib/bundler/man/bundle-outdated.1 +1 -1
  38. data/lib/bundler/man/bundle-platform.1 +1 -1
  39. data/lib/bundler/man/bundle-pristine.1 +1 -1
  40. data/lib/bundler/man/bundle-remove.1 +1 -1
  41. data/lib/bundler/man/bundle-show.1 +1 -1
  42. data/lib/bundler/man/bundle-update.1 +4 -4
  43. data/lib/bundler/man/bundle-update.1.ronn +3 -3
  44. data/lib/bundler/man/bundle-viz.1 +1 -1
  45. data/lib/bundler/man/bundle.1 +1 -1
  46. data/lib/bundler/man/gemfile.5 +1 -1
  47. data/lib/bundler/plugin.rb +2 -0
  48. data/lib/bundler/plugin/index.rb +4 -1
  49. data/lib/bundler/plugin/installer.rb +1 -1
  50. data/lib/bundler/resolver.rb +3 -1
  51. data/lib/bundler/rubygems_ext.rb +22 -6
  52. data/lib/bundler/runtime.rb +1 -3
  53. data/lib/bundler/settings.rb +9 -8
  54. data/lib/bundler/source/rubygems.rb +4 -17
  55. data/lib/bundler/source_list.rb +40 -21
  56. data/lib/bundler/spec_set.rb +5 -10
  57. data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  58. data/lib/bundler/version.rb +1 -1
  59. metadata +3 -3
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "May 2021" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "June 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "May 2021" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "June 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "May 2021" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "June 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -79,7 +79,7 @@ Do not allow any gem to be updated past latest \fB\-\-patch\fR | \fB\-\-minor\fR
79
79
  .
80
80
  .TP
81
81
  \fB\-\-conservative\fR
82
- Use bundle install conservative update behavior and do not allow shared dependencies to be updated\.
82
+ Use bundle install conservative update behavior and do not allow indirect dependencies to be updated\.
83
83
  .
84
84
  .SH "UPDATING ALL GEMS"
85
85
  If you run \fBbundle update \-\-all\fR, bundler will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources\.
@@ -208,13 +208,13 @@ In this case, the two gems have their own set of dependencies, but they share \f
208
208
  In short, by default, when you update a gem using \fBbundle update\fR, bundler will update all dependencies of that gem, including those that are also dependencies of another gem\.
209
209
  .
210
210
  .P
211
- To prevent updating shared dependencies, prior to version 1\.14 the only option was the \fBCONSERVATIVE UPDATING\fR behavior in bundle install(1) \fIbundle\-install\.1\.html\fR:
211
+ To prevent updating indirect dependencies, prior to version 1\.14 the only option was the \fBCONSERVATIVE UPDATING\fR behavior in bundle install(1) \fIbundle\-install\.1\.html\fR:
212
212
  .
213
213
  .P
214
214
  In this scenario, updating the \fBthin\fR version manually in the Gemfile(5), and then running bundle install(1) \fIbundle\-install\.1\.html\fR will only update \fBdaemons\fR and \fBeventmachine\fR, but not \fBrack\fR\. For more information, see the \fBCONSERVATIVE UPDATING\fR section of bundle install(1) \fIbundle\-install\.1\.html\fR\.
215
215
  .
216
216
  .P
217
- Starting with 1\.14, specifying the \fB\-\-conservative\fR option will also prevent shared dependencies from being updated\.
217
+ Starting with 1\.14, specifying the \fB\-\-conservative\fR option will also prevent indirect dependencies from being updated\.
218
218
  .
219
219
  .SH "PATCH LEVEL OPTIONS"
220
220
  Version 1\.14 introduced 4 patch\-level options that will influence how gem versions are resolved\. One of the following options can be used: \fB\-\-patch\fR, \fB\-\-minor\fR or \fB\-\-major\fR\. \fB\-\-strict\fR can be added to further influence resolution\.
@@ -80,7 +80,7 @@ gem.
80
80
  Do not allow any gem to be updated past latest `--patch` | `--minor` | `--major`.
81
81
 
82
82
  * `--conservative`:
83
- Use bundle install conservative update behavior and do not allow shared dependencies to be updated.
83
+ Use bundle install conservative update behavior and do not allow indirect dependencies to be updated.
84
84
 
85
85
  ## UPDATING ALL GEMS
86
86
 
@@ -195,7 +195,7 @@ In short, by default, when you update a gem using `bundle update`, bundler will
195
195
  update all dependencies of that gem, including those that are also dependencies
196
196
  of another gem.
197
197
 
198
- To prevent updating shared dependencies, prior to version 1.14 the only option
198
+ To prevent updating indirect dependencies, prior to version 1.14 the only option
199
199
  was the `CONSERVATIVE UPDATING` behavior in [bundle install(1)](bundle-install.1.html):
200
200
 
201
201
  In this scenario, updating the `thin` version manually in the Gemfile(5),
@@ -203,7 +203,7 @@ and then running [bundle install(1)](bundle-install.1.html) will only update `da
203
203
  but not `rack`. For more information, see the `CONSERVATIVE UPDATING` section
204
204
  of [bundle install(1)](bundle-install.1.html).
205
205
 
206
- Starting with 1.14, specifying the `--conservative` option will also prevent shared
206
+ Starting with 1.14, specifying the `--conservative` option will also prevent indirect
207
207
  dependencies from being updated.
208
208
 
209
209
  ## PATCH LEVEL OPTIONS
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "May 2021" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "June 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "May 2021" "" ""
4
+ .TH "BUNDLE" "1" "June 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "May 2021" "" ""
4
+ .TH "GEMFILE" "5" "June 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -309,6 +309,8 @@ module Bundler
309
309
  #
310
310
  # @param [String] name of the plugin
311
311
  def load_plugin(name)
312
+ return unless name && !name.empty?
313
+
312
314
  # Need to ensure before this that plugin root where the rest of gems
313
315
  # are installed to be on load path to support plugin deps. Currently not
314
316
  # done to avoid conflicts
@@ -74,7 +74,10 @@ module Bundler
74
74
  def unregister_plugin(name)
75
75
  @commands.delete_if {|_, v| v == name }
76
76
  @sources.delete_if {|_, v| v == name }
77
- @hooks.each {|_, plugin_names| plugin_names.delete(name) }
77
+ @hooks.each do |hook, names|
78
+ names.delete(name)
79
+ @hooks.delete(hook) if names.empty?
80
+ end
78
81
  @plugin_paths.delete(name)
79
82
  @load_paths.delete(name)
80
83
  save_index
@@ -77,7 +77,7 @@ module Bundler
77
77
  source_list = SourceList.new
78
78
 
79
79
  source_list.add_git_source(git_source_options) if git_source_options
80
- source_list.global_rubygems_source = rubygems_source if rubygems_source
80
+ Array(rubygems_source).each {|remote| source_list.add_global_rubygems_remote(remote) } if rubygems_source
81
81
 
82
82
  deps = names.map {|name| Dependency.new name, version }
83
83
 
@@ -21,7 +21,7 @@ module Bundler
21
21
  base = SpecSet.new(base) unless base.is_a?(SpecSet)
22
22
  resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
23
23
  result = resolver.start(requirements)
24
- SpecSet.new(result).for(requirements.reject{|dep| dep.name.end_with?("\0") })
24
+ SpecSet.new(SpecSet.new(result).for(requirements.reject{|dep| dep.name.end_with?("\0") }))
25
25
  end
26
26
 
27
27
  def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
@@ -30,8 +30,10 @@ module Bundler
30
30
  @resolver = Molinillo::Resolver.new(self, self)
31
31
  @search_for = {}
32
32
  @base_dg = Molinillo::DependencyGraph.new
33
+ aggregate_global_source = @source_requirements[:default].is_a?(Source::RubygemsAggregate)
33
34
  @base.each do |ls|
34
35
  dep = Dependency.new(ls.name, ls.version)
36
+ ls.source = source_for(ls.name) unless aggregate_global_source
35
37
  @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
36
38
  end
37
39
  additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
@@ -174,20 +174,36 @@ module Gem
174
174
  end
175
175
  end
176
176
 
177
+ require "rubygems/platform"
178
+
177
179
  class Platform
178
180
  JAVA = Gem::Platform.new("java") unless defined?(JAVA)
179
181
  MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
180
182
  MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
181
183
  MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
182
184
  X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
185
+ end
183
186
 
184
- undef_method :hash if method_defined? :hash
185
- def hash
186
- @cpu.hash ^ @os.hash ^ @version.hash
187
- end
187
+ Platform.singleton_class.module_eval do
188
+ unless Platform.singleton_methods.include?(:match_spec?)
189
+ def match_spec?(spec)
190
+ match_gem?(spec.platform, spec.name)
191
+ end
188
192
 
189
- undef_method :eql? if method_defined? :eql?
190
- alias_method :eql?, :==
193
+ def match_gem?(platform, gem_name)
194
+ match_platforms?(platform, Gem.platforms)
195
+ end
196
+
197
+ private
198
+
199
+ def match_platforms?(platform, platforms)
200
+ platforms.any? do |local_platform|
201
+ platform.nil? ||
202
+ local_platform == platform ||
203
+ (local_platform != Gem::Platform::RUBY && local_platform =~ platform)
204
+ end
205
+ end
206
+ end
191
207
  end
192
208
 
193
209
  require "rubygems/util"
@@ -12,12 +12,10 @@ module Bundler
12
12
  def setup(*groups)
13
13
  @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen_bundle?
14
14
 
15
- groups.map!(&:to_sym)
16
-
17
15
  # Has to happen first
18
16
  clean_load_path
19
17
 
20
- specs = groups.any? ? @definition.specs_for(groups) : requested_specs
18
+ specs = @definition.specs_for(groups)
21
19
 
22
20
  SharedHelpers.set_bundle_environment
23
21
  Bundler.rubygems.replace_entrypoints(specs)
@@ -16,7 +16,6 @@ module Bundler
16
16
  clean
17
17
  default_install_uses_path
18
18
  deployment
19
- deployment_means_frozen
20
19
  disable_checksum_validation
21
20
  disable_exec_load
22
21
  disable_local_branch_check
@@ -45,7 +44,6 @@ module Bundler
45
44
  silence_deprecations
46
45
  silence_root_warning
47
46
  suppress_install_using_messages
48
- unlock_source_unlocks_spec
49
47
  update_requires_all_flag
50
48
  use_gem_version_promoter_for_major_updates
51
49
  ].freeze
@@ -210,6 +208,13 @@ module Bundler
210
208
  locations
211
209
  end
212
210
 
211
+ def processor_count
212
+ require "etc"
213
+ Etc.nprocessors
214
+ rescue StandardError
215
+ 1
216
+ end
217
+
213
218
  # for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
214
219
  def path
215
220
  configs.each do |_level, settings|
@@ -423,12 +428,8 @@ module Bundler
423
428
  def global_config_file
424
429
  if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
425
430
  Pathname.new(ENV["BUNDLE_CONFIG"])
426
- else
427
- begin
428
- Bundler.user_bundle_path("config")
429
- rescue PermissionError, GenericSystemCallError
430
- nil
431
- end
431
+ elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
432
+ Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
432
433
  end
433
434
  end
434
435
 
@@ -67,13 +67,13 @@ module Bundler
67
67
  o.is_a?(Rubygems) && (o.credless_remotes - credless_remotes).empty?
68
68
  end
69
69
 
70
- def disable_multisource?
71
- @remotes.size <= 1
70
+ def multiple_remotes?
71
+ @remotes.size > 1
72
72
  end
73
73
 
74
74
  def can_lock?(spec)
75
- return super if disable_multisource?
76
- spec.source.is_a?(Rubygems)
75
+ return super unless multiple_remotes?
76
+ include?(spec.source)
77
77
  end
78
78
 
79
79
  def options
@@ -252,19 +252,6 @@ module Bundler
252
252
  other_remotes.map(&method(:remove_auth)) == @remotes.map(&method(:remove_auth))
253
253
  end
254
254
 
255
- def replace_remotes(other_remotes, allow_equivalent = false)
256
- return false if other_remotes == @remotes
257
-
258
- equivalent = allow_equivalent && equivalent_remotes?(other_remotes)
259
-
260
- @remotes = []
261
- other_remotes.reverse_each do |r|
262
- add_remote r.to_s
263
- end
264
-
265
- !equivalent
266
- end
267
-
268
255
  def spec_names
269
256
  if @allow_remote && dependency_api_available?
270
257
  remote_specs.spec_names
@@ -28,12 +28,13 @@ module Bundler
28
28
  @merged_gem_lockfile_sections
29
29
  end
30
30
 
31
- def merged_gem_lockfile_sections!
31
+ def merged_gem_lockfile_sections!(replacement_source)
32
32
  @merged_gem_lockfile_sections = true
33
+ @global_rubygems_source = replacement_source
33
34
  end
34
35
 
35
- def no_aggregate_global_source?
36
- global_rubygems_source.remotes.size <= 1
36
+ def aggregate_global_source?
37
+ global_rubygems_source.multiple_remotes?
37
38
  end
38
39
 
39
40
  def add_path_source(options = {})
@@ -53,18 +54,17 @@ module Bundler
53
54
  end
54
55
 
55
56
  def add_rubygems_source(options = {})
56
- add_source_to_list Source::Rubygems.new(options), @rubygems_sources
57
+ new_source = Source::Rubygems.new(options)
58
+ return @global_rubygems_source if @global_rubygems_source == new_source
59
+
60
+ add_source_to_list new_source, @rubygems_sources
57
61
  end
58
62
 
59
63
  def add_plugin_source(source, options = {})
60
64
  add_source_to_list Plugin.source(source).new(options), @plugin_sources
61
65
  end
62
66
 
63
- def global_rubygems_source=(uri)
64
- @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri, "allow_local" => true)
65
- end
66
-
67
- def add_rubygems_remote(uri)
67
+ def add_global_rubygems_remote(uri)
68
68
  global_rubygems_source.add_remote(uri)
69
69
  global_rubygems_source
70
70
  end
@@ -109,27 +109,26 @@ module Bundler
109
109
  if merged_gem_lockfile_sections?
110
110
  [combine_rubygems_sources]
111
111
  else
112
- rubygems_sources.sort_by(&:to_s).uniq
112
+ rubygems_sources.sort_by(&:to_s)
113
113
  end
114
114
  end
115
115
 
116
116
  # Returns true if there are changes
117
117
  def replace_sources!(replacement_sources)
118
- return true if replacement_sources.empty?
118
+ return false if replacement_sources.empty?
119
119
 
120
- [path_sources, git_sources, plugin_sources].each do |source_list|
121
- source_list.map! do |source|
122
- replacement_sources.find {|s| s == source } || source
123
- end
124
- end
120
+ @path_sources, @git_sources, @plugin_sources = map_sources(replacement_sources)
125
121
 
126
- replacement_rubygems = merged_gem_lockfile_sections? &&
127
- replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
128
- @global_rubygems_source = replacement_rubygems if replacement_rubygems
122
+ different_sources?(lock_sources, replacement_sources)
123
+ end
129
124
 
130
- return true if !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
125
+ # Returns true if there are changes
126
+ def expired_sources?(replacement_sources)
127
+ return false if replacement_sources.empty?
131
128
 
132
- false
129
+ lock_sources = dup_with_replaced_sources(replacement_sources).lock_sources
130
+
131
+ different_sources?(lock_sources, replacement_sources)
133
132
  end
134
133
 
135
134
  def local_only!
@@ -146,6 +145,24 @@ module Bundler
146
145
 
147
146
  private
148
147
 
148
+ def dup_with_replaced_sources(replacement_sources)
149
+ new_source_list = dup
150
+ new_source_list.replace_sources!(replacement_sources)
151
+ new_source_list
152
+ end
153
+
154
+ def map_sources(replacement_sources)
155
+ [path_sources, git_sources, plugin_sources].map do |sources|
156
+ sources.map do |source|
157
+ replacement_sources.find {|s| s == source } || source
158
+ end
159
+ end
160
+ end
161
+
162
+ def different_sources?(lock_sources, replacement_sources)
163
+ !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
164
+ end
165
+
149
166
  def rubygems_aggregate_class
150
167
  Source::Rubygems
151
168
  end
@@ -185,6 +202,8 @@ module Bundler
185
202
  end
186
203
 
187
204
  def equal_source?(source, other_source)
205
+ return source.include?(other_source) if source.is_a?(Source::Rubygems) && other_source.is_a?(Source::Rubygems) && !merged_gem_lockfile_sections?
206
+
188
207
  source == other_source
189
208
  end
190
209
 
@@ -11,15 +11,14 @@ module Bundler
11
11
  @specs = specs
12
12
  end
13
13
 
14
- def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
14
+ def for(dependencies, check = false, match_current_platform = false, raise_on_missing = true)
15
15
  handled = []
16
16
  deps = dependencies.dup
17
17
  specs = []
18
- skip += ["bundler"]
19
18
 
20
19
  loop do
21
20
  break unless dep = deps.shift
22
- next if handled.include?(dep) || skip.include?(dep.name)
21
+ next if handled.any?{|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"
23
22
 
24
23
  handled << dep
25
24
 
@@ -46,11 +45,7 @@ module Bundler
46
45
  specs << spec
47
46
  end
48
47
 
49
- check ? true : SpecSet.new(specs)
50
- end
51
-
52
- def valid_for?(deps)
53
- self.for(deps, [], true)
48
+ check ? true : specs
54
49
  end
55
50
 
56
51
  def [](key)
@@ -77,7 +72,7 @@ module Bundler
77
72
  end
78
73
 
79
74
  def materialize(deps, missing_specs = nil)
80
- materialized = self.for(deps, [], false, true, !missing_specs).to_a
75
+ materialized = self.for(deps, false, true, !missing_specs)
81
76
 
82
77
  materialized.group_by(&:source).each do |source, specs|
83
78
  next unless specs.any?{|s| s.is_a?(LazySpecification) }
@@ -199,7 +194,7 @@ module Bundler
199
194
  def spec_for_dependency(dep, match_current_platform)
200
195
  specs_for_platforms = lookup[dep.name]
201
196
  if match_current_platform
202
- GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform)
197
+ GemHelpers.select_best_platform_match(specs_for_platforms.select{|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
203
198
  else
204
199
  GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
205
200
  end