bundler 2.2.0 → 2.2.5

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 +67 -20
  3. data/bundler.gemspec +1 -1
  4. data/lib/bundler.rb +8 -2
  5. data/lib/bundler/build_metadata.rb +2 -2
  6. data/lib/bundler/cli.rb +3 -6
  7. data/lib/bundler/cli/gem.rb +2 -0
  8. data/lib/bundler/cli/install.rb +14 -5
  9. data/lib/bundler/cli/outdated.rb +2 -2
  10. data/lib/bundler/cli/update.rb +1 -1
  11. data/lib/bundler/compact_index_client/cache.rb +5 -13
  12. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  13. data/lib/bundler/compact_index_client/updater.rb +0 -8
  14. data/lib/bundler/definition.rb +24 -21
  15. data/lib/bundler/dependency.rb +3 -1
  16. data/lib/bundler/gem_helper.rb +3 -3
  17. data/lib/bundler/gem_helpers.rb +30 -24
  18. data/lib/bundler/lazy_specification.rb +16 -3
  19. data/{man → lib/bundler/man}/bundle-add.1 +0 -0
  20. data/{man → lib/bundler/man}/bundle-binstubs.1 +0 -0
  21. data/{man → lib/bundler/man}/bundle-cache.1 +0 -0
  22. data/{man → lib/bundler/man}/bundle-check.1 +0 -0
  23. data/{man → lib/bundler/man}/bundle-clean.1 +0 -0
  24. data/{man → lib/bundler/man}/bundle-config.1 +0 -0
  25. data/{man → lib/bundler/man}/bundle-doctor.1 +0 -0
  26. data/{man → lib/bundler/man}/bundle-exec.1 +0 -0
  27. data/{man → lib/bundler/man}/bundle-gem.1 +0 -0
  28. data/{man → lib/bundler/man}/bundle-info.1 +0 -0
  29. data/{man → lib/bundler/man}/bundle-init.1 +0 -0
  30. data/{man → lib/bundler/man}/bundle-inject.1 +0 -0
  31. data/{man → lib/bundler/man}/bundle-install.1 +0 -0
  32. data/{man → lib/bundler/man}/bundle-list.1 +0 -0
  33. data/{man → lib/bundler/man}/bundle-lock.1 +0 -0
  34. data/{man → lib/bundler/man}/bundle-open.1 +0 -0
  35. data/{man → lib/bundler/man}/bundle-outdated.1 +0 -0
  36. data/{man → lib/bundler/man}/bundle-platform.1 +0 -0
  37. data/{man → lib/bundler/man}/bundle-pristine.1 +0 -0
  38. data/{man → lib/bundler/man}/bundle-remove.1 +0 -0
  39. data/{man → lib/bundler/man}/bundle-show.1 +0 -0
  40. data/{man → lib/bundler/man}/bundle-update.1 +0 -0
  41. data/{man → lib/bundler/man}/bundle-viz.1 +0 -0
  42. data/{man → lib/bundler/man}/bundle.1 +0 -0
  43. data/{man → lib/bundler/man}/gemfile.5 +0 -0
  44. data/{man → lib/bundler/man}/index.txt +0 -0
  45. data/lib/bundler/resolver.rb +29 -27
  46. data/lib/bundler/resolver/spec_group.rb +19 -25
  47. data/lib/bundler/rubygems_integration.rb +0 -6
  48. data/lib/bundler/source/git.rb +18 -16
  49. data/lib/bundler/source/git/git_proxy.rb +54 -49
  50. data/lib/bundler/source/path/installer.rb +2 -0
  51. data/lib/bundler/source/rubygems.rb +10 -1
  52. data/lib/bundler/spec_set.rb +5 -8
  53. data/lib/bundler/stub_specification.rb +0 -2
  54. data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
  55. data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  56. data/lib/bundler/templates/newgem/rubocop.yml.tt +3 -0
  57. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +8 -1
  58. data/lib/bundler/version.rb +1 -1
  59. metadata +33 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0af01fdf441e83df2f02f7e0028ca485d12bb37986101861fa498f0768763708
4
- data.tar.gz: 319299292a4a3b6e295e8d28bd6c9c7f2f478d686ff6ea733f31271c4f574512
3
+ metadata.gz: 9014f3bd2d636c4436c097ca7320f15602fe63d151839c3e0304dcd90f28d62f
4
+ data.tar.gz: 7eb224ffa516b5f29d11a35de89b64943fb9dea34c60ccdf51fa031ca81d7dbc
5
5
  SHA512:
6
- metadata.gz: cc0d1557b038284fb34953722569b55cfd4541f172a099583d12b53eed299768664df54e032bc9ad7f1c7b379e069ccd2a9e1ad85a7c6bc9afa5087c03da986c
7
- data.tar.gz: de013b518986f6a7fcb8a5e36541e33dfd574aabd662a71f506bf4099c9fc690aeeed6a07b36aee698cac464cf5070b603da1aca3fbe96d796ec59e907d4e5ae
6
+ metadata.gz: 62c02abf9d6d7b4f5e8e28bbeebc364c1154b48ebcfefa7f7f13a2d16b09fa8c14c8f293fb80887666a9e2533d2effc29d6516c10d7433a92a7a953ec3f5a94b
7
+ data.tar.gz: 7db47841661df295e9db0c8861a0fe07129d0e7b5750efd4f987bbe1e223dae8f83733765df2d8f076a18166a624aae1c0361d268a00f9474e81c92c9533e4ac
@@ -1,3 +1,53 @@
1
+ # 2.2.5 (January 11, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Improve rubocop setup in the new gem template [#4220](https://github.com/rubygems/rubygems/pull/4220)
6
+ - Support repositories with default branch not named master [#4224](https://github.com/rubygems/rubygems/pull/4224)
7
+
8
+ ## Bug fixes:
9
+
10
+ - Let Net::HTTP decompress the index instead of doing it manually [#4081](https://github.com/rubygems/rubygems/pull/4081)
11
+ - Workaround for another jruby crash when autoloading a constant [#4252](https://github.com/rubygems/rubygems/pull/4252)
12
+ - Fix another performance regression in the resolver [#4243](https://github.com/rubygems/rubygems/pull/4243)
13
+ - Restore support for old git versions [#4233](https://github.com/rubygems/rubygems/pull/4233)
14
+ - Give a proper error if cache path does not have write access [#4215](https://github.com/rubygems/rubygems/pull/4215)
15
+ - Fix running `rake release` from an ambiguous ref [#4219](https://github.com/rubygems/rubygems/pull/4219)
16
+
17
+ # 2.2.4 (December 31, 2020)
18
+
19
+ ## Bug fixes:
20
+
21
+ - Fix bundle man pages display on truffleruby [#4209](https://github.com/rubygems/rubygems/pull/4209)
22
+ - Fix Windows + JRuby no longer being able to install git sources [#4196](https://github.com/rubygems/rubygems/pull/4196)
23
+
24
+ # 2.2.3 (December 22, 2020)
25
+
26
+ ## Bug fixes:
27
+
28
+ - Restore full compatibility with previous lockfiles [#4179](https://github.com/rubygems/rubygems/pull/4179)
29
+ - Add all matching variants with the same platform specificity to the lockfile [#4180](https://github.com/rubygems/rubygems/pull/4180)
30
+ - Fix bundler installing gems for a different platform when running in frozen mode and current platform not in the lockfile [#4172](https://github.com/rubygems/rubygems/pull/4172)
31
+ - Fix crash when `bundle exec`'ing to bundler [#4175](https://github.com/rubygems/rubygems/pull/4175)
32
+
33
+ # 2.2.2 (December 17, 2020)
34
+
35
+ ## Bug fixes:
36
+
37
+ - Fix resolver crash when a candidate has 0 matching platforms [#4163](https://github.com/rubygems/rubygems/pull/4163)
38
+ - Restore change to copy global with/without config locally upon `bundle install` [#4154](https://github.com/rubygems/rubygems/pull/4154)
39
+
40
+ # 2.2.1 (December 14, 2020)
41
+
42
+ ## Bug fixes:
43
+
44
+ - Ad-hoc fix for platform regression [#4127](https://github.com/rubygems/rubygems/pull/4127)
45
+ - Workaround JRuby + Windows issue with net-http-persistent vendored code [#4138](https://github.com/rubygems/rubygems/pull/4138)
46
+ - Reset also root when in a nested invocation [#4140](https://github.com/rubygems/rubygems/pull/4140)
47
+ - Restore 2.1.4 resolution times [#4134](https://github.com/rubygems/rubygems/pull/4134)
48
+ - Fix `bundle outdated --strict` crash [#4133](https://github.com/rubygems/rubygems/pull/4133)
49
+ - Autoload `Bundler::RemoteSpecification` to workaround crash on jruby [#4114](https://github.com/rubygems/rubygems/pull/4114)
50
+
1
51
  # 2.2.0 (December 7, 2020)
2
52
 
3
53
  ## Enhancements:
@@ -34,7 +84,11 @@
34
84
 
35
85
  # 2.2.0.rc.2 (October 6, 2020)
36
86
 
37
- ## Minor enhancements:
87
+ ## Features:
88
+
89
+ - Add `bundle fund` command [#3390](https://github.com/rubygems/rubygems/pull/3390)
90
+
91
+ ## Enhancements:
38
92
 
39
93
  - Fix ls-files matching regexp [#3845](https://github.com/rubygems/rubygems/pull/3845)
40
94
  - Remove redundant `bundler/setup` require from `spec_helper.rb` generated by `bundle gem` [#3791](https://github.com/rubygems/rubygems/pull/3791)
@@ -67,10 +121,6 @@
67
121
 
68
122
  - Deprecate `bundle cache --all` flag [#3932](https://github.com/rubygems/rubygems/pull/3932)
69
123
 
70
- ## Features:
71
-
72
- - Add `bundle fund` command [#3390](https://github.com/rubygems/rubygems/pull/3390)
73
-
74
124
  ## Documentation:
75
125
 
76
126
  - Correct grammar in Gemfile docs [#3990](https://github.com/rubygems/rubygems/pull/3990)
@@ -81,12 +131,12 @@
81
131
 
82
132
  # 2.2.0.rc.1 (July 2, 2020)
83
133
 
84
- ## Major enhancements:
134
+ ## Features:
85
135
 
86
136
  - Windows support. There's still gotchas and unimplemented features, but a Windows CI is now enforced.
87
137
  - Full multiplatform support. Bundler should now seamlessly handle multiplatform `Gemfile` or `gems.rb` files.
88
138
 
89
- ## Features:
139
+ ## Enhancements:
90
140
 
91
141
  - `bundle info` now includes gem metadata [#7376](https://github.com/rubygems/bundler/pull/7376)
92
142
  - `bundle list --without-group` and `bundle list --only-group` now support space separated list of groups in addition to single groups [#7404](https://github.com/rubygems/bundler/pull/7404)
@@ -97,9 +147,6 @@
97
147
  - Add `bundle plugin uninstall` [#3482](https://github.com/rubygems/rubygems/pull/3482)
98
148
  - `bundle gem` now supports a `--ci` flag and a `gem.ci` configuration that adds CI config files for the main CI providers to the generated gem skeleton [#3667](https://github.com/rubygems/rubygems/pull/3667)
99
149
  - Allow setting a tag prefix to be used by release tasks [#3766](https://github.com/rubygems/rubygems/pull/3766)
100
-
101
- ## Minor enhancements:
102
-
103
150
  - `bundle outdated` now prints output in columns for better readability [#4474](https://github.com/rubygems/bundler/pull/4474)
104
151
  - bundler's `release` rake task now prints a better message when not being logged in and trying to push a gem [#7513](https://github.com/rubygems/bundler/pull/7513)
105
152
  - `BUNDLE_APP_CONFIG` environment variable is now documented [#7563](https://github.com/rubygems/bundler/pull/7563)
@@ -192,7 +239,7 @@
192
239
  - Restore previous `BUNDLE_GEMFILE` in `bundler/inline` [#7418](https://github.com/rubygems/bundler/pull/7418)
193
240
  - Fix error when using `gem` DSL's `:glob` option for selecting gemspecs from a specific source [#7419](https://github.com/rubygems/bundler/pull/7419)
194
241
 
195
- ## Minor enhancements:
242
+ ## Enhancements:
196
243
 
197
244
  - `bundle config` no longer warns when using "old interface" (might be deprecated again in the future) [#7475](https://github.com/rubygems/bundler/pull/7475)
198
245
  - `bundle update` no longer warns when used without arguments (might be deprecated again in the future) [#7475](https://github.com/rubygems/bundler/pull/7475)
@@ -296,7 +343,7 @@
296
343
  - Fix `bundle update` message about exclude groups saying "installed" instead of "updated" ([#7150](https://github.com/rubygems/bundler/pull/7150))
297
344
  - Fix `bundle licenses` not showing correct information about bundler itself ([#7147](https://github.com/rubygems/bundler/pull/7147))
298
345
  - Fix installation path not including ruby scope when `BUNDLE_PATH` was set ([#7163](https://github.com/rubygems/bundler/pull/7163))
299
- - Fix `bundle clean` incorrectly removing git depedencies present in the Gemfile when rubygems 3.0+ was used and path involved a symlink ([#7211](https://github.com/rubygems/bundler/pull/7211))
346
+ - Fix `bundle clean` incorrectly removing git dependencies present in the Gemfile when rubygems 3.0+ was used and path involved a symlink ([#7211](https://github.com/rubygems/bundler/pull/7211))
300
347
  - Fix platform specific gems always being re-resolved when bundler was not running under that platform ([#7212](https://github.com/rubygems/bundler/pull/7212))
301
348
  - Fix `bundle package --all-platforms` causing `bundle install` to ignore `--with` and `--without` ([#6113](https://github.com/rubygems/bundler/pull/6113))
302
349
  - Fix `MissingRevision` git errors to include the specific `git` command that failed under the hood ([#7225](https://github.com/rubygems/bundler/pull/7225))
@@ -321,7 +368,7 @@
321
368
 
322
369
  # 2.0.2 (June 13, 2019)
323
370
 
324
- ## Minor enhancements:
371
+ ## Enhancements:
325
372
 
326
373
  - Fixes for Bundler integration with ruby-src ([#6941](https://github.com/rubygems/bundler/pull/6941), [#6973](https://github.com/bundler/bundler/pull/6973), [#6977](https://github.com/bundler/bundler/pull/6977), [#6315](https://github.com/bundler/bundler/pull/6315), [#7061](https://github.com/bundler/bundler/pull/7061))
327
374
  - Use `__dir__` instead of `__FILE__` when generating a gem with `bundle gem` ([#6503](https://github.com/rubygems/bundler/pull/6503))
@@ -365,7 +412,7 @@
365
412
 
366
413
  - Ruby 2.6 compatibility fixes (@segiddins)
367
414
 
368
- ## Minor enhancements:
415
+ ## Enhancements:
369
416
 
370
417
  - Import changes from Bundler 1.17.3 release
371
418
 
@@ -460,7 +507,7 @@ Changes
460
507
 
461
508
  # 1.16.6 (October 5, 2018)
462
509
 
463
- ## Minor enhancements:
510
+ ## Enhancements:
464
511
 
465
512
  - Add an error message when adding a gem with `bundle add` that's already in the bundle ([#6341](https://github.com/rubygems/bundler/issues/6341), @agrim123)
466
513
  - Add Homepage, Source Code and Changelog URI metadata fields to the `bundle gem` gemspec template (@walf443)
@@ -468,7 +515,7 @@ Changes
468
515
  ## Bug fixes:
469
516
 
470
517
  - Fix issue where updating a gem resulted in the gem's version being downgraded when `BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS` was set ([#6529](https://github.com/rubygems/bundler/issues/6529), @theflow)
471
- - Fix some rescue calls that don't specifiy error type (@utilum)
518
+ - Fix some rescue calls that don't specify error type (@utilum)
472
519
  - Fix an issue when the Lockfile would contain platform-specific gems that it didn't need ([#6491](https://github.com/rubygems/bundler/issues/6491), @segiddins)
473
520
  - Improve handling of adding new gems with only a single group to the Gemfile in `bundle add` (@agrim123)
474
521
  - Refactor check for OpenSSL in `bundle env` (@voxik)
@@ -482,7 +529,7 @@ Changes
482
529
 
483
530
  # 1.16.5 (September 18, 2018)
484
531
 
485
- ## Minor enhancements:
532
+ ## Enhancements:
486
533
 
487
534
  - Add support for TruffleRuby (@eregon)
488
535
 
@@ -498,7 +545,7 @@ Changes
498
545
 
499
546
  # 1.16.4 (August 17, 2018)
500
547
 
501
- ## Minor enhancements:
548
+ ## Enhancements:
502
549
 
503
550
  - Welcome new members to the Bundler core team (@indirect)
504
551
  - Don't mutate original error trees when determining version_conflict_message (@greysteil)
@@ -540,7 +587,7 @@ Changes
540
587
 
541
588
  # 1.16.2 (April 20, 2018)
542
589
 
543
- ## Minor enhancements:
590
+ ## Enhancements:
544
591
 
545
592
  - Include the gem's source in the gem install error message when available (@papanikge)
546
593
  - Remove unnecessary executable bit from gem template (@voxik)
@@ -1519,7 +1566,7 @@ Changes
1519
1566
  - prefer gemspecs closest to the directory root ([#3428](https://github.com/rubygems/bundler/issues/3428), @segiddins)
1520
1567
  - debug log for API request limits ([#3452](https://github.com/rubygems/bundler/issues/3452), @neerfri)
1521
1568
 
1522
- ## Minor enhancements:
1569
+ ## Enhancements:
1523
1570
 
1524
1571
  - Molinillo resolver, shared with CocoaPods (@segiddins)
1525
1572
  - updated Thor to v0.19.1 (@segiddins)
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.required_ruby_version = ">= 2.3.0"
35
35
  s.required_rubygems_version = ">= 2.5.2"
36
36
 
37
- s.files = Dir.glob("{lib,man,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
37
+ s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
38
38
 
39
39
  # Include the CHANGELOG.md, LICENSE.md, README.md manually
40
40
  s.files += %w[CHANGELOG.md LICENSE.md README.md]
@@ -63,7 +63,6 @@ module Bundler
63
63
  autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
64
64
  autoload :Retry, File.expand_path("bundler/retry", __dir__)
65
65
  autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
66
- autoload :RubyGemsGemInstaller, File.expand_path("bundler/rubygems_gem_installer", __dir__)
67
66
  autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
68
67
  autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
69
68
  autoload :Settings, File.expand_path("bundler/settings", __dir__)
@@ -212,6 +211,12 @@ module Bundler
212
211
  end
213
212
  end
214
213
 
214
+ def most_specific_locked_platform?(platform)
215
+ return false unless defined?(@definition) && @definition
216
+
217
+ definition.most_specific_locked_platform == platform
218
+ end
219
+
215
220
  def ruby_scope
216
221
  "#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}"
217
222
  end
@@ -602,8 +607,9 @@ EOF
602
607
  reset_rubygems!
603
608
  end
604
609
 
605
- def reset_settings!
610
+ def reset_settings_and_root!
606
611
  @settings = nil
612
+ @root = nil
607
613
  end
608
614
 
609
615
  def reset_paths!
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2020-12-10".freeze
8
- @git_commit_sha = "d3628e5019".freeze
7
+ @built_at = "2021-01-11".freeze
8
+ @git_commit_sha = "ba867aed7f".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -57,7 +57,7 @@ module Bundler
57
57
  custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
58
58
  if custom_gemfile && !custom_gemfile.empty?
59
59
  Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
60
- Bundler.reset_settings!
60
+ Bundler.reset_settings_and_root!
61
61
  end
62
62
 
63
63
  Bundler.settings.set_command_option_if_given :retry, options[:retry]
@@ -122,9 +122,7 @@ module Bundler
122
122
  else command = "bundle-#{cli}"
123
123
  end
124
124
 
125
- man_path = File.expand_path("../../../man", __FILE__)
126
- # man files are located under ruby's mandir with the default gems of bundler
127
- man_path = RbConfig::CONFIG["mandir"] unless File.directory?(man_path)
125
+ man_path = File.expand_path("man", __dir__)
128
126
  man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
129
127
  [File.basename(f, ".*"), f]
130
128
  end]
@@ -134,8 +132,7 @@ module Bundler
134
132
  if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
135
133
  Kernel.exec "man #{man_page}"
136
134
  else
137
- fallback_man_path = File.expand_path("../man", __FILE__)
138
- puts File.read("#{fallback_man_path}/#{File.basename(man_page)}.ronn")
135
+ puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
139
136
  end
140
137
  elsif command_path = Bundler.which("bundler-#{cli}")
141
138
  Kernel.exec(command_path, "--help")
@@ -59,6 +59,7 @@ module Bundler
59
59
  :exe => options[:exe],
60
60
  :bundler_version => bundler_dependency_version,
61
61
  :github_username => github_username.empty? ? "[USERNAME]" : github_username,
62
+ :required_ruby_version => Gem.ruby_version < Gem::Version.new("2.4.a") ? "2.3.0" : "2.4.0",
62
63
  }
63
64
  ensure_safe_gem_name(name, constant_array)
64
65
 
@@ -147,6 +148,7 @@ module Bundler
147
148
  "For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
148
149
  "and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
149
150
  config[:rubocop] = true
151
+ config[:rubocop_version] = Gem.ruby_version < Gem::Version.new("2.4.a") ? "0.81.0" : "1.7"
150
152
  Bundler.ui.info "RuboCop enabled in config"
151
153
  templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
152
154
  end
@@ -152,18 +152,27 @@ module Bundler
152
152
 
153
153
  check_for_group_conflicts_in_cli_options
154
154
 
155
+ Bundler.settings.set_command_option :with, nil if options[:with] == []
156
+ Bundler.settings.set_command_option :without, nil if options[:without] == []
157
+
155
158
  with = options.fetch(:with, [])
156
159
  with |= Bundler.settings[:with].map(&:to_s)
157
160
  with -= options[:without] if options[:without]
158
- with = nil if options[:with] == []
159
161
 
160
162
  without = options.fetch(:without, [])
161
163
  without |= Bundler.settings[:without].map(&:to_s)
162
164
  without -= options[:with] if options[:with]
163
- without = nil if options[:without] == []
164
165
 
165
- Bundler.settings.set_command_option :without, without
166
- Bundler.settings.set_command_option :with, with
166
+ options[:with] = with
167
+ options[:without] = without
168
+
169
+ unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
170
+ # need to nil them out first to get around validation for backwards compatibility
171
+ Bundler.settings.set_command_option :without, nil
172
+ Bundler.settings.set_command_option :with, nil
173
+ Bundler.settings.set_command_option :without, options[:without] - options[:with]
174
+ Bundler.settings.set_command_option :with, options[:with]
175
+ end
167
176
  end
168
177
 
169
178
  def normalize_settings
@@ -190,7 +199,7 @@ module Bundler
190
199
 
191
200
  Bundler.settings.set_command_option_if_given :clean, options["clean"]
192
201
 
193
- normalize_groups if options[:without] || options[:with]
202
+ normalize_groups
194
203
 
195
204
  options[:force] = options[:redownload]
196
205
  end
@@ -76,6 +76,8 @@ module Bundler
76
76
  next unless gems.empty? || gems.include?(current_spec.name)
77
77
 
78
78
  active_spec = retrieve_active_spec(definition, current_spec)
79
+ next unless active_spec
80
+
79
81
  next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
80
82
 
81
83
  gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
@@ -229,8 +231,6 @@ module Bundler
229
231
  end
230
232
 
231
233
  def update_present_via_semver_portions(current_spec, active_spec, options)
232
- return false if active_spec.nil?
233
-
234
234
  current_major = current_spec.version.segments.first
235
235
  active_major = active_spec.version.segments.first
236
236
 
@@ -82,7 +82,7 @@ module Bundler
82
82
  locked_spec = locked_info[:spec]
83
83
  new_spec = Bundler.definition.specs[name].first
84
84
  unless new_spec
85
- if Bundler.rubygems.platforms.none? {|p| locked_spec.match_platform(p) }
85
+ unless locked_spec.match_platform(Bundler.local_platform)
86
86
  Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one"
87
87
  end
88
88
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "gem_parser"
4
+
3
5
  module Bundler
4
6
  class CompactIndexClient
5
7
  class Cache
@@ -92,19 +94,9 @@ module Bundler
92
94
  header ? lines[header + 1..-1] : lines
93
95
  end
94
96
 
95
- def parse_gem(string)
96
- version_and_platform, rest = string.split(" ", 2)
97
- version, platform = version_and_platform.split("-", 2)
98
- dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
99
- dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
100
- requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
101
- [version, platform, dependencies, requirements]
102
- end
103
-
104
- def parse_dependency(string)
105
- dependency = string.split(":")
106
- dependency[-1] = dependency[-1].split("&") if dependency.size > 1
107
- dependency
97
+ def parse_gem(line)
98
+ @dependency_parser ||= GemParser.new
99
+ @dependency_parser.parse(line)
108
100
  end
109
101
 
110
102
  def info_roots
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CompactIndexClient
5
+ if defined?(Gem::Resolver::APISet::GemParser)
6
+ GemParser = Gem::Resolver::APISet::GemParser
7
+ else
8
+ class GemParser
9
+ def parse(line)
10
+ version_and_platform, rest = line.split(" ", 2)
11
+ version, platform = version_and_platform.split("-", 2)
12
+ dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
13
+ dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
14
+ requirements = requirements ? requirements.map {|d| parse_dependency(d) } : []
15
+ [version, platform, dependencies, requirements]
16
+ end
17
+
18
+ private
19
+
20
+ def parse_dependency(string)
21
+ dependency = string.split(":")
22
+ dependency[-1] = dependency[-1].split("&") if dependency.size > 1
23
+ dependency
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../vendored_fileutils"
4
- require "stringio"
5
- require "zlib"
6
4
 
7
5
  module Bundler
8
6
  class CompactIndexClient
@@ -45,18 +43,12 @@ module Bundler
45
43
  else
46
44
  "bytes=#{local_temp_path.size}-"
47
45
  end
48
- else
49
- # Fastly ignores Range when Accept-Encoding: gzip is set
50
- headers["Accept-Encoding"] = "gzip"
51
46
  end
52
47
 
53
48
  response = @fetcher.call(remote_path, headers)
54
49
  return nil if response.is_a?(Net::HTTPNotModified)
55
50
 
56
51
  content = response.body
57
- if response["Content-Encoding"] == "gzip"
58
- content = Zlib::GzipReader.new(StringIO.new(content)).read
59
- end
60
52
 
61
53
  SharedHelpers.filesystem_access(local_temp_path) do
62
54
  if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?