bundler 2.5.22 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +83 -0
  3. data/bundler.gemspec +2 -2
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli/add.rb +2 -0
  6. data/lib/bundler/cli/check.rb +2 -2
  7. data/lib/bundler/cli/console.rb +0 -4
  8. data/lib/bundler/cli/doctor.rb +4 -4
  9. data/lib/bundler/cli/exec.rb +1 -0
  10. data/lib/bundler/cli/gem.rb +1 -1
  11. data/lib/bundler/cli/info.rb +2 -2
  12. data/lib/bundler/cli/inject.rb +1 -1
  13. data/lib/bundler/cli/install.rb +4 -0
  14. data/lib/bundler/cli/lock.rb +20 -1
  15. data/lib/bundler/cli/pristine.rb +1 -1
  16. data/lib/bundler/cli/show.rb +2 -2
  17. data/lib/bundler/cli.rb +23 -53
  18. data/lib/bundler/compact_index_client/cache_file.rb +0 -5
  19. data/lib/bundler/compact_index_client/updater.rb +0 -11
  20. data/lib/bundler/definition.rb +143 -76
  21. data/lib/bundler/dependency.rb +1 -1
  22. data/lib/bundler/dsl.rb +33 -28
  23. data/lib/bundler/endpoint_specification.rb +10 -1
  24. data/lib/bundler/errors.rb +10 -0
  25. data/lib/bundler/feature_flag.rb +1 -0
  26. data/lib/bundler/fetcher/compact_index.rb +1 -1
  27. data/lib/bundler/fetcher.rb +10 -3
  28. data/lib/bundler/gem_helpers.rb +21 -5
  29. data/lib/bundler/injector.rb +2 -2
  30. data/lib/bundler/inline.rb +12 -8
  31. data/lib/bundler/installer/standalone.rb +2 -2
  32. data/lib/bundler/installer.rb +4 -38
  33. data/lib/bundler/lazy_specification.rb +74 -26
  34. data/lib/bundler/lockfile_generator.rb +1 -1
  35. data/lib/bundler/lockfile_parser.rb +9 -1
  36. data/lib/bundler/man/bundle-add.1 +17 -11
  37. data/lib/bundler/man/bundle-add.1.ronn +16 -10
  38. data/lib/bundler/man/bundle-binstubs.1 +7 -4
  39. data/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  40. data/lib/bundler/man/bundle-cache.1 +30 -2
  41. data/lib/bundler/man/bundle-cache.1.ronn +31 -2
  42. data/lib/bundler/man/bundle-check.1 +3 -3
  43. data/lib/bundler/man/bundle-check.1.ronn +4 -2
  44. data/lib/bundler/man/bundle-clean.1 +1 -1
  45. data/lib/bundler/man/bundle-config.1 +3 -5
  46. data/lib/bundler/man/bundle-config.1.ronn +2 -7
  47. data/lib/bundler/man/bundle-console.1 +2 -4
  48. data/lib/bundler/man/bundle-console.1.ronn +2 -7
  49. data/lib/bundler/man/bundle-doctor.1 +2 -2
  50. data/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  51. data/lib/bundler/man/bundle-env.1 +9 -0
  52. data/lib/bundler/man/bundle-env.1.ronn +10 -0
  53. data/lib/bundler/man/bundle-exec.1 +5 -2
  54. data/lib/bundler/man/bundle-exec.1.ronn +4 -1
  55. data/lib/bundler/man/bundle-fund.1 +22 -0
  56. data/lib/bundler/man/bundle-fund.1.ronn +25 -0
  57. data/lib/bundler/man/bundle-gem.1 +17 -5
  58. data/lib/bundler/man/bundle-gem.1.ronn +27 -6
  59. data/lib/bundler/man/bundle-help.1 +1 -1
  60. data/lib/bundler/man/bundle-info.1 +5 -2
  61. data/lib/bundler/man/bundle-info.1.ronn +6 -2
  62. data/lib/bundler/man/bundle-init.1 +3 -3
  63. data/lib/bundler/man/bundle-init.1.ronn +3 -2
  64. data/lib/bundler/man/bundle-inject.1 +10 -2
  65. data/lib/bundler/man/bundle-inject.1.ronn +9 -1
  66. data/lib/bundler/man/bundle-install.1 +15 -12
  67. data/lib/bundler/man/bundle-install.1.ronn +22 -18
  68. data/lib/bundler/man/bundle-issue.1 +45 -0
  69. data/lib/bundler/man/bundle-issue.1.ronn +37 -0
  70. data/lib/bundler/man/bundle-licenses.1 +9 -0
  71. data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  72. data/lib/bundler/man/bundle-list.1 +1 -1
  73. data/lib/bundler/man/bundle-list.1.ronn +4 -1
  74. data/lib/bundler/man/bundle-lock.1 +21 -6
  75. data/lib/bundler/man/bundle-lock.1.ronn +25 -4
  76. data/lib/bundler/man/bundle-open.1 +2 -2
  77. data/lib/bundler/man/bundle-open.1.ronn +2 -1
  78. data/lib/bundler/man/bundle-outdated.1 +8 -5
  79. data/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  80. data/lib/bundler/man/bundle-platform.1 +1 -1
  81. data/lib/bundler/man/bundle-plugin.1 +1 -1
  82. data/lib/bundler/man/bundle-pristine.1 +1 -1
  83. data/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  84. data/lib/bundler/man/bundle-remove.1 +1 -1
  85. data/lib/bundler/man/bundle-remove.1.ronn +1 -1
  86. data/lib/bundler/man/bundle-show.1 +5 -2
  87. data/lib/bundler/man/bundle-show.1.ronn +4 -0
  88. data/lib/bundler/man/bundle-update.1 +13 -7
  89. data/lib/bundler/man/bundle-update.1.ronn +14 -6
  90. data/lib/bundler/man/bundle-version.1 +1 -1
  91. data/lib/bundler/man/bundle-viz.1 +4 -4
  92. data/lib/bundler/man/bundle-viz.1.ronn +7 -3
  93. data/lib/bundler/man/bundle.1 +1 -1
  94. data/lib/bundler/man/gemfile.5 +1 -1
  95. data/lib/bundler/man/index.txt +4 -0
  96. data/lib/bundler/materialization.rb +59 -0
  97. data/lib/bundler/plugin/events.rb +24 -0
  98. data/lib/bundler/plugin/installer.rb +1 -1
  99. data/lib/bundler/plugin.rb +20 -1
  100. data/lib/bundler/process_lock.rb +10 -14
  101. data/lib/bundler/remote_specification.rb +6 -1
  102. data/lib/bundler/resolver/base.rb +6 -6
  103. data/lib/bundler/resolver/candidate.rb +2 -2
  104. data/lib/bundler/resolver/spec_group.rb +4 -3
  105. data/lib/bundler/resolver.rb +5 -5
  106. data/lib/bundler/rubygems_ext.rb +30 -27
  107. data/lib/bundler/rubygems_gem_installer.rb +3 -2
  108. data/lib/bundler/rubygems_integration.rb +23 -40
  109. data/lib/bundler/runtime.rb +27 -7
  110. data/lib/bundler/self_manager.rb +2 -3
  111. data/lib/bundler/settings.rb +6 -1
  112. data/lib/bundler/shared_helpers.rb +29 -17
  113. data/lib/bundler/source/git/git_proxy.rb +0 -6
  114. data/lib/bundler/source/git.rb +56 -31
  115. data/lib/bundler/source/metadata.rb +2 -3
  116. data/lib/bundler/source/path.rb +2 -2
  117. data/lib/bundler/source_list.rb +1 -1
  118. data/lib/bundler/spec_set.rb +81 -56
  119. data/lib/bundler/stub_specification.rb +8 -0
  120. data/lib/bundler/templates/newgem/Gemfile.tt +0 -3
  121. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  122. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +15 -15
  123. data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -4
  124. data/lib/bundler/uri_credentials_filter.rb +1 -1
  125. data/lib/bundler/vendor/fileutils/COPYING +56 -0
  126. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  127. data/lib/bundler/vendor/securerandom/COPYING +56 -0
  128. data/lib/bundler/vendor/securerandom/lib/securerandom.rb +5 -5
  129. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  130. data/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  131. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  132. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  133. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  134. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  135. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  136. data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  137. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  138. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  139. data/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  140. data/lib/bundler/vendor/uri/COPYING +56 -0
  141. data/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
  142. data/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  143. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  144. data/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
  145. data/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  146. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  147. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  148. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  149. data/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  150. data/lib/bundler/vendored_securerandom.rb +0 -2
  151. data/lib/bundler/version.rb +1 -1
  152. data/lib/bundler.rb +38 -14
  153. metadata +18 -12
  154. data/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
  155. data/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
  156. data/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
  157. data/lib/bundler/vendor/uri/LICENSE.txt +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc7261a0b8dc5361d73ec05037b3ceb245a228a8e5e068928fd8db3fc68e6fb3
4
- data.tar.gz: '049390d33cb5586ed405378073f30bb45e0f0e3127ee6b857cf79574dfe2d415'
3
+ metadata.gz: 7e5040339545260efa41ad3b7bd4201dfdc9275e322b970ed3c768a45ec01e06
4
+ data.tar.gz: 6d8271cc5fd5a98f98637ef49a597ff4edc8ce78e2fcb2f504b21c29b6f4b0a1
5
5
  SHA512:
6
- metadata.gz: 977e79ef6df50d6fa48909d74b9867621ba7f7883d4e438e9f4f658ec49030dd4752c3926dfea84be23da1e7964599d93adafbc3458df90f34380208cb810d84
7
- data.tar.gz: ebd1d89e12a3d56c653cf90ef0bcb90d4cbc3b739f7ebbd5033505b367ee17c4320defc8c5810d4bb762ff482425c9326385bb6044bf012e397dc3f7d12eaa65
6
+ metadata.gz: 1cfdf00dc9e185a6af93c187a55b2c4d2c61f0f21edcfd0b5e213f1b00026e010815c7b1ea4ea2efd96c199b514061b3b183257a4e7aa6b25bd1bce2b6e7404e
7
+ data.tar.gz: b32951d8312bb7d65fabd06c269ca6ec6e2114f9f2836aeb74aa72a73a2b219c56a173f0383f7e917072fe9ab78c7a0fa9c31a58aca24d9faf078490145e9dfa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,86 @@
1
+ # 2.6.0 (December 16, 2024)
2
+
3
+ ## Security:
4
+
5
+ - Fix gemfury credentials written to logs in verbose mode [#8283](https://github.com/rubygems/rubygems/pull/8283)
6
+ - Fix private registry credentials being written to logs [#8222](https://github.com/rubygems/rubygems/pull/8222)
7
+
8
+ ## Breaking changes:
9
+
10
+ - Drop ruby 3.0 support [#8091](https://github.com/rubygems/rubygems/pull/8091)
11
+ - Remove client-side MD5 ETag transition from compact index client [#7677](https://github.com/rubygems/rubygems/pull/7677)
12
+
13
+ ## Deprecations:
14
+
15
+ - Cancel `bundle console` deprecation [#8218](https://github.com/rubygems/rubygems/pull/8218)
16
+ - Warn when platform of installed gem differs from platform in the lockfile [#8029](https://github.com/rubygems/rubygems/pull/8029)
17
+ - Cancel deprecation of Gemfiles without a global source [#8213](https://github.com/rubygems/rubygems/pull/8213)
18
+
19
+ ## Features:
20
+
21
+ - Add a `lockfile_checksums` configuration to include checksums in fresh lockfiles [#8219](https://github.com/rubygems/rubygems/pull/8219)
22
+ - Add `bundle lock --add-checksums` to add checksums to an existing lockfile [#8214](https://github.com/rubygems/rubygems/pull/8214)
23
+
24
+ ## Performance:
25
+
26
+ - Enable a couple of performance cops [#8261](https://github.com/rubygems/rubygems/pull/8261)
27
+ - Remove override of worker jobs for `bundle install --local` [#8248](https://github.com/rubygems/rubygems/pull/8248)
28
+
29
+ ## Enhancements:
30
+
31
+ - Support `bundle exec <relative-path-to-script>` when `Kernel.exec` is used under the hood [#8294](https://github.com/rubygems/rubygems/pull/8294)
32
+ - Improve working with different rubies using the same lockfile [#8251](https://github.com/rubygems/rubygems/pull/8251)
33
+ - Define a few `inspect` methods to help debugging [#8266](https://github.com/rubygems/rubygems/pull/8266)
34
+ - Include original error when openssl fails to load [#8232](https://github.com/rubygems/rubygems/pull/8232)
35
+ - Automatically fix lockfile when it's missing dependencies [#8103](https://github.com/rubygems/rubygems/pull/8103)
36
+ - Fix some JRuby warnings when using `bundler/setup` with Ruby's -w flag [#8205](https://github.com/rubygems/rubygems/pull/8205)
37
+ - Add a `--normalize-platforms` flag to `bundle lock` [#7896](https://github.com/rubygems/rubygems/pull/7896)
38
+ - Add plugin hooks for Bundler.require [#3439](https://github.com/rubygems/rubygems/pull/3439)
39
+
40
+ ## Bug fixes:
41
+
42
+ - Fix restarting with locked version when `$PROGRAM_NAME` has been changed [#8320](https://github.com/rubygems/rubygems/pull/8320)
43
+ - Restore the previous cache format for git sources [#8296](https://github.com/rubygems/rubygems/pull/8296)
44
+ - Fix installs of subdependencies of unlocked dependencies to be conservative [#8281](https://github.com/rubygems/rubygems/pull/8281)
45
+ - Fix test task name on generated readme when using test-unit [#8291](https://github.com/rubygems/rubygems/pull/8291)
46
+ - Fix `bundle exec` executable detection on windows [#8276](https://github.com/rubygems/rubygems/pull/8276)
47
+ - Fix `bundle remove` sometimes not removing gems [#8278](https://github.com/rubygems/rubygems/pull/8278)
48
+ - Fix issue with git gems locking incorrect specs sometimes [#8269](https://github.com/rubygems/rubygems/pull/8269)
49
+
50
+ ## Documentation:
51
+
52
+ - Normalize command flag documentation and make sure all flags are documented [#8313](https://github.com/rubygems/rubygems/pull/8313)
53
+ - Add missing man pages for `bundle env` and `bundle licenses` [#8315](https://github.com/rubygems/rubygems/pull/8315)
54
+ - Add man page for 'bundle issue' command [#8271](https://github.com/rubygems/rubygems/pull/8271)
55
+ - Add man page for 'bundle fund' command [#8258](https://github.com/rubygems/rubygems/pull/8258)
56
+ - Move pry-related contents to `debugging.md` [#8263](https://github.com/rubygems/rubygems/pull/8263)
57
+ - Add debugging instruction on Windows [#8236](https://github.com/rubygems/rubygems/pull/8236)
58
+ - Unify rubygems and bundler docs directory [#8159](https://github.com/rubygems/rubygems/pull/8159)
59
+
60
+ # 2.5.23 (November 5, 2024)
61
+
62
+ ## Enhancements:
63
+
64
+ - Add useful error message for plugin load [#7639](https://github.com/rubygems/rubygems/pull/7639)
65
+ - Indent github workflow steps for generated gems [#8193](https://github.com/rubygems/rubygems/pull/8193)
66
+ - Improve several permission errors [#8168](https://github.com/rubygems/rubygems/pull/8168)
67
+ - Add `bundle add` `--quiet` option [#8157](https://github.com/rubygems/rubygems/pull/8157)
68
+
69
+ ## Bug fixes:
70
+
71
+ - Fix incompatible encodings error when paths with UTF-8 characters are involved [#8196](https://github.com/rubygems/rubygems/pull/8196)
72
+ - Update `--ext=rust` to support compiling the native extension from source [#7610](https://github.com/rubygems/rubygems/pull/7610)
73
+ - Print a proper error when there's a previous empty installation path with bad permissions [#8169](https://github.com/rubygems/rubygems/pull/8169)
74
+ - Fix running `bundler` (with a final `r`) in a `bundle exec` context [#8165](https://github.com/rubygems/rubygems/pull/8165)
75
+ - Handle two `gemspec` usages in same Gemfile with same dep and compatible requirements [#7999](https://github.com/rubygems/rubygems/pull/7999)
76
+ - Fix `bundle check` sometimes locking gems under the wrong source [#8148](https://github.com/rubygems/rubygems/pull/8148)
77
+
78
+ ## Documentation:
79
+
80
+ - Remove confusing `bundle config` documentation [#8177](https://github.com/rubygems/rubygems/pull/8177)
81
+ - Rename bundler inline's `install` parameter and clarify docs [#8170](https://github.com/rubygems/rubygems/pull/8170)
82
+ - Clarify `bundle install --quiet` documentation [#8163](https://github.com/rubygems/rubygems/pull/8163)
83
+
1
84
  # 2.5.22 (October 16, 2024)
2
85
 
3
86
  ## Enhancements:
data/bundler.gemspec CHANGED
@@ -29,10 +29,10 @@ Gem::Specification.new do |s|
29
29
  "source_code_uri" => "https://github.com/rubygems/rubygems/tree/master/bundler",
30
30
  }
31
31
 
32
- s.required_ruby_version = ">= 3.0.0"
32
+ s.required_ruby_version = ">= 3.1.0"
33
33
 
34
34
  # It should match the RubyGems version shipped with `required_ruby_version` above
35
- s.required_rubygems_version = ">= 3.2.3"
35
+ s.required_rubygems_version = ">= 3.3.3"
36
36
 
37
37
  s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
38
38
 
@@ -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 = "2024-10-16".freeze
8
- @git_commit_sha = "342d4542fda".freeze
7
+ @built_at = "2024-12-16".freeze
8
+ @git_commit_sha = "d6be0319aaf".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -12,6 +12,8 @@ module Bundler
12
12
  end
13
13
 
14
14
  def run
15
+ Bundler.ui.level = "warn" if options[:quiet]
16
+
15
17
  validate_options!
16
18
  inject_dependencies
17
19
  perform_bundle_install unless options["skip-install"]
@@ -15,7 +15,7 @@ module Bundler
15
15
  definition.validate_runtime!
16
16
 
17
17
  begin
18
- definition.resolve_only_locally!
18
+ definition.check!
19
19
  not_installed = definition.missing_specs
20
20
  rescue GemNotFound, GitError, SolveFailure
21
21
  Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
@@ -32,7 +32,7 @@ module Bundler
32
32
  Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
33
33
  exit 1
34
34
  else
35
- Bundler.load.lock(preserve_unknown_sections: true) unless options[:"dry-run"]
35
+ definition.lock(true) unless options[:"dry-run"]
36
36
  Bundler.ui.info "The Gemfile's dependencies are satisfied"
37
37
  end
38
38
  end
@@ -9,10 +9,6 @@ module Bundler
9
9
  end
10
10
 
11
11
  def run
12
- message = "bundle console will be replaced by `bin/console` generated by `bundle gem <name>`"
13
- removed_message = "bundle console has been replaced by `bin/console` generated by `bundle gem <name>`"
14
- Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
15
-
16
12
  group ? Bundler.require(:default, *group.split(" ").map!(&:to_sym)) : Bundler.require
17
13
  ARGV.clear
18
14
 
@@ -32,11 +32,11 @@ module Bundler
32
32
 
33
33
  def dylibs_ldd(path)
34
34
  output = `/usr/bin/ldd #{path.shellescape}`.chomp
35
- output.split("\n").map do |l|
35
+ output.split("\n").filter_map do |l|
36
36
  match = l.match(LDD_REGEX)
37
37
  next if match.nil?
38
38
  match.captures[0]
39
- end.compact
39
+ end
40
40
  end
41
41
 
42
42
  def dylibs(path)
@@ -89,11 +89,11 @@ module Bundler
89
89
 
90
90
  if broken_links.any?
91
91
  message = "The following gems are missing OS dependencies:"
92
- broken_links.map do |spec, paths|
92
+ broken_links.flat_map do |spec, paths|
93
93
  paths.uniq.map do |path|
94
94
  "\n * #{spec.name}: #{path}"
95
95
  end
96
- end.flatten.sort.each {|m| message += m }
96
+ end.sort.each {|m| message += m }
97
97
  raise ProductionError, message
98
98
  elsif !permissions_valid
99
99
  Bundler.ui.info "No issues found with the installed bundle"
@@ -22,6 +22,7 @@ module Bundler
22
22
  if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
23
23
  return kernel_load(bin_path, *args)
24
24
  end
25
+ bin_path = "./" + bin_path unless File.absolute_path?(bin_path)
25
26
  kernel_exec(bin_path, *args)
26
27
  else
27
28
  # exec using the given command
@@ -446,7 +446,7 @@ module Bundler
446
446
  end
447
447
 
448
448
  def required_ruby_version
449
- "3.0.0"
449
+ "3.1.0"
450
450
  end
451
451
 
452
452
  def rubocop_version
@@ -73,11 +73,11 @@ module Bundler
73
73
  end
74
74
 
75
75
  def gem_dependencies
76
- @gem_dependencies ||= Bundler.definition.specs.map do |spec|
76
+ @gem_dependencies ||= Bundler.definition.specs.filter_map do |spec|
77
77
  dependency = spec.dependencies.find {|dep| dep.name == gem_name }
78
78
  next unless dependency
79
79
  "#{spec.name} (#{spec.version}) depends on #{gem_name} (#{dependency.requirements_list.join(", ")})"
80
- end.compact.sort
80
+ end.sort
81
81
  end
82
82
  end
83
83
  end
@@ -48,7 +48,7 @@ module Bundler
48
48
 
49
49
  def last_version_number
50
50
  definition = Bundler.definition(true)
51
- definition.resolve_remotely!
51
+ definition.remotely!
52
52
  specs = definition.index[name].sort_by(&:version)
53
53
  unless options[:pre]
54
54
  specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
@@ -23,6 +23,10 @@ module Bundler
23
23
  # Disable color in deployment mode
24
24
  Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
25
25
 
26
+ if target_rbconfig_path = options[:"target-rbconfig"]
27
+ Bundler.rubygems.set_target_rbconfig(target_rbconfig_path)
28
+ end
29
+
26
30
  check_for_options_conflicts
27
31
 
28
32
  check_trust_policy
@@ -14,6 +14,8 @@ module Bundler
14
14
  exit 1
15
15
  end
16
16
 
17
+ check_for_conflicting_options
18
+
17
19
  print = options[:print]
18
20
  previous_output_stream = Bundler.ui.output_stream
19
21
  Bundler.ui.output_stream = :stderr if print
@@ -38,6 +40,7 @@ module Bundler
38
40
 
39
41
  Bundler.settings.temporary(frozen: false) do
40
42
  definition = Bundler.definition(update, file)
43
+ definition.add_checksums if options["add-checksums"]
41
44
 
42
45
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
43
46
 
@@ -58,7 +61,11 @@ module Bundler
58
61
  raise InvalidOption, "Removing all platforms from the bundle is not allowed"
59
62
  end
60
63
 
61
- definition.resolve_remotely! unless options[:local]
64
+ definition.remotely! unless options[:local]
65
+
66
+ if options["normalize-platforms"]
67
+ definition.normalize_platforms
68
+ end
62
69
 
63
70
  if print
64
71
  puts definition.to_lock
@@ -70,5 +77,17 @@ module Bundler
70
77
 
71
78
  Bundler.ui.output_stream = previous_output_stream
72
79
  end
80
+
81
+ private
82
+
83
+ def check_for_conflicting_options
84
+ if options["normalize-platforms"] && options["add-platform"].any?
85
+ raise InvalidOption, "--normalize-platforms can't be used with --add-platform"
86
+ end
87
+
88
+ if options["normalize-platforms"] && options["remove-platform"].any?
89
+ raise InvalidOption, "--normalize-platforms can't be used with --remove-platform"
90
+ end
91
+ end
73
92
  end
74
93
  end
@@ -49,7 +49,7 @@ module Bundler
49
49
  true
50
50
  end.map(&:name)
51
51
 
52
- jobs = installer.send(:installation_parallelization, {})
52
+ jobs = installer.send(:installation_parallelization)
53
53
  pristine_count = definition.specs.count - installed_specs.count
54
54
  # allow a pristining a single gem to skip the parallel worker
55
55
  jobs = [jobs, pristine_count].min
@@ -59,9 +59,9 @@ module Bundler
59
59
  definition = Bundler.definition(true)
60
60
  if options[:outdated]
61
61
  Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
62
- Bundler.ui.silence { definition.resolve_remotely! }
62
+ Bundler.ui.silence { definition.remotely! }
63
63
  else
64
- definition.resolve_with_cache!
64
+ definition.with_cache!
65
65
  end
66
66
  Bundler.reset!
67
67
  definition.specs
data/lib/bundler/cli.rb CHANGED
@@ -217,7 +217,7 @@ module Bundler
217
217
  method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
218
218
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
219
219
  method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
220
- method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
220
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
221
221
  method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
222
222
  method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
223
223
  method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
@@ -227,8 +227,8 @@ module Bundler
227
227
  method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
228
228
  method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
229
229
  method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
230
- method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of " +
231
- Bundler.rubygems.security_policy_keys.join("|")
230
+ method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
231
+ method_option "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform"
232
232
  method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
233
233
  method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
234
234
  def install
@@ -286,10 +286,8 @@ module Bundler
286
286
  Show lists the names and versions of all gems that are required by your Gemfile.
287
287
  Calling show with [GEM] will list the exact location of that gem on your machine.
288
288
  D
289
- method_option "paths", type: :boolean,
290
- banner: "List the paths of all gems that are required by your Gemfile."
291
- method_option "outdated", type: :boolean,
292
- banner: "Show verbose output including whether gems are outdated."
289
+ method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
290
+ method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
293
291
  def show(gem_name = nil)
294
292
  if ARGV.include?("--outdated")
295
293
  message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
@@ -351,6 +349,7 @@ module Bundler
351
349
  method_option "branch", type: :string
352
350
  method_option "ref", type: :string
353
351
  method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
352
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
354
353
  method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
355
354
  method_option "optimistic", type: :boolean, banner: "Adds optimistic declaration of version to gem"
356
355
  method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"
@@ -397,9 +396,7 @@ module Bundler
397
396
  end
398
397
 
399
398
  desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
400
- method_option "all", type: :boolean,
401
- default: Bundler.feature_flag.cache_all?,
402
- banner: "Include all sources (including path and git)."
399
+ method_option "all", type: :boolean, default: Bundler.feature_flag.cache_all?, banner: "Include all sources (including path and git)."
403
400
  method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
404
401
  method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
405
402
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
@@ -437,8 +434,8 @@ module Bundler
437
434
  map aliases_for("cache")
438
435
 
439
436
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
440
- method_option :keep_file_descriptors, type: :boolean, default: true
441
- method_option :gemfile, type: :string, required: false
437
+ method_option :keep_file_descriptors, type: :boolean, default: true, banner: "Passes all file descriptors to the new processes. Default is true, and setting it to false is deprecated"
438
+ method_option :gemfile, type: :string, required: false, banner: "Use the specified gemfile instead of Gemfile"
442
439
  long_desc <<-D
443
440
  Exec runs a command, providing it access to the gems in the bundle. While using
444
441
  bundle exec you can require and call the bundled gems as if they were installed
@@ -479,12 +476,10 @@ module Bundler
479
476
  Open.new(options, name).run
480
477
  end
481
478
 
482
- unless Bundler.feature_flag.bundler_3_mode?
483
- desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
484
- def console(group = nil)
485
- require_relative "cli/console"
486
- Console.new(options, group).run
487
- end
479
+ desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
480
+ def console(group = nil)
481
+ require_relative "cli/console"
482
+ Console.new(options, group).run
488
483
  end
489
484
 
490
485
  desc "version", "Prints Bundler version information"
@@ -536,55 +531,28 @@ module Bundler
536
531
  end
537
532
  end
538
533
 
539
- old_gem = instance_method(:gem)
540
-
541
534
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
542
535
  method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
543
536
  method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
544
- method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR",
545
- lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
546
- desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
537
+ method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR", lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
547
538
  method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
548
539
  method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
549
540
  method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
550
541
  method_option :rubocop, type: :boolean, desc: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
551
542
  method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
552
- method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library",
553
- enum: %w[rspec minitest test-unit],
554
- desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
555
- method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "",
556
- enum: %w[github gitlab circle],
557
- desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
558
- method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "",
559
- enum: %w[rubocop standard],
560
- desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
543
+ method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
544
+ method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
545
+ method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
561
546
  method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
562
547
 
563
548
  def gem(name)
564
- end
549
+ require_relative "cli/gem"
550
+ cmd_args = args + [self]
551
+ cmd_args.unshift(options)
565
552
 
566
- commands["gem"].tap do |gem_command|
567
- def gem_command.run(instance, args = [])
568
- arity = 1 # name
569
-
570
- require_relative "cli/gem"
571
- cmd_args = args + [instance]
572
- cmd_args.unshift(instance.options)
573
-
574
- cmd = begin
575
- Gem.new(*cmd_args)
576
- rescue ArgumentError => e
577
- instance.class.handle_argument_error(self, e, args, arity)
578
- end
579
-
580
- cmd.run
581
- end
553
+ Gem.new(*cmd_args).run
582
554
  end
583
555
 
584
- undef_method(:gem)
585
- define_method(:gem, old_gem)
586
- private :gem
587
-
588
556
  def self.source_root
589
557
  File.expand_path("templates", __dir__)
590
558
  end
@@ -620,8 +588,10 @@ module Bundler
620
588
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
621
589
  method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
622
590
  method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
591
+ method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
623
592
  method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
624
593
  method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
594
+ method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
625
595
  method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
626
596
  method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
627
597
  method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
@@ -86,11 +86,6 @@ module Bundler
86
86
  end
87
87
  end
88
88
 
89
- # remove this method when we stop generating md5 digests for legacy etags
90
- def md5
91
- @digests && @digests["md5"]
92
- end
93
-
94
89
  def digests?
95
90
  @digests&.any?
96
91
  end
@@ -28,7 +28,6 @@ module Bundler
28
28
 
29
29
  CacheFile.copy(local_path) do |file|
30
30
  etag = etag_path.read.tap(&:chomp!) if etag_path.file?
31
- etag ||= generate_etag(etag_path, file) # Remove this after 2.5.0 has been out for a while.
32
31
 
33
32
  # Subtract a byte to ensure the range won't be empty.
34
33
  # Avoids 416 (Range Not Satisfiable) responses.
@@ -67,16 +66,6 @@ module Bundler
67
66
  etag_path.read.tap(&:chomp!) if etag_path.file?
68
67
  end
69
68
 
70
- # When first releasing this opaque etag feature, we want to generate the old MD5 etag
71
- # based on the content of the file. After that it will always use the saved opaque etag.
72
- # This transparently saves existing users with good caches from updating a bunch of files.
73
- # Remove this behavior after 2.5.0 has been out for a while.
74
- def generate_etag(etag_path, file)
75
- etag = file.md5.hexdigest
76
- CacheFile.write(etag_path, etag)
77
- etag
78
- end
79
-
80
69
  def etag_from_response(response)
81
70
  return unless response["ETag"]
82
71
  etag = response["ETag"].delete_prefix("W/")