bundler 2.6.9 → 4.0.11

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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2229 -1879
  3. data/README.md +11 -11
  4. data/bundler.gemspec +5 -5
  5. data/lib/bundler/build_metadata.rb +10 -11
  6. data/lib/bundler/capistrano.rb +1 -19
  7. data/lib/bundler/checksum.rb +6 -0
  8. data/lib/bundler/cli/add.rb +10 -0
  9. data/lib/bundler/cli/cache.rb +1 -12
  10. data/lib/bundler/cli/common.rb +21 -4
  11. data/lib/bundler/cli/config.rb +1 -2
  12. data/lib/bundler/cli/console.rb +5 -0
  13. data/lib/bundler/cli/exec.rb +29 -4
  14. data/lib/bundler/cli/gem.rb +90 -64
  15. data/lib/bundler/cli/install.rb +15 -90
  16. data/lib/bundler/cli/issue.rb +2 -2
  17. data/lib/bundler/cli/list.rb +33 -2
  18. data/lib/bundler/cli/lock.rb +5 -5
  19. data/lib/bundler/cli/outdated.rb +1 -1
  20. data/lib/bundler/cli/plugin.rb +5 -1
  21. data/lib/bundler/cli/pristine.rb +5 -1
  22. data/lib/bundler/cli/show.rb +3 -7
  23. data/lib/bundler/cli/update.rb +5 -5
  24. data/lib/bundler/cli.rb +162 -127
  25. data/lib/bundler/compact_index_client.rb +1 -6
  26. data/lib/bundler/current_ruby.rb +17 -5
  27. data/lib/bundler/definition.rb +201 -117
  28. data/lib/bundler/dependency.rb +1 -1
  29. data/lib/bundler/deployment.rb +1 -64
  30. data/lib/bundler/digest.rb +1 -1
  31. data/lib/bundler/dsl.rb +48 -48
  32. data/lib/bundler/environment_preserver.rb +1 -0
  33. data/lib/bundler/errors.rb +1 -5
  34. data/lib/bundler/feature_flag.rb +5 -35
  35. data/lib/bundler/fetcher/compact_index.rb +1 -1
  36. data/lib/bundler/fetcher/dependency.rb +9 -2
  37. data/lib/bundler/fetcher/downloader.rb +33 -8
  38. data/lib/bundler/fetcher/gem_remote_fetcher.rb +6 -0
  39. data/lib/bundler/fetcher.rb +49 -19
  40. data/lib/bundler/friendly_errors.rb +4 -3
  41. data/lib/bundler/index.rb +7 -9
  42. data/lib/bundler/injector.rb +1 -2
  43. data/lib/bundler/inline.rb +9 -1
  44. data/lib/bundler/installer/gem_installer.rb +14 -11
  45. data/lib/bundler/installer/parallel_installer.rb +74 -36
  46. data/lib/bundler/installer.rb +6 -19
  47. data/lib/bundler/lazy_specification.rb +47 -20
  48. data/lib/bundler/lockfile_generator.rb +17 -2
  49. data/lib/bundler/lockfile_parser.rb +19 -6
  50. data/lib/bundler/man/bundle-add.1 +1 -1
  51. data/lib/bundler/man/bundle-binstubs.1 +3 -6
  52. data/lib/bundler/man/bundle-binstubs.1.ronn +4 -6
  53. data/lib/bundler/man/bundle-cache.1 +2 -14
  54. data/lib/bundler/man/bundle-cache.1.ronn +1 -14
  55. data/lib/bundler/man/bundle-check.1 +2 -5
  56. data/lib/bundler/man/bundle-check.1.ronn +0 -5
  57. data/lib/bundler/man/bundle-clean.1 +1 -1
  58. data/lib/bundler/man/bundle-config.1 +206 -148
  59. data/lib/bundler/man/bundle-config.1.ronn +136 -119
  60. data/lib/bundler/man/bundle-console.1 +1 -1
  61. data/lib/bundler/man/bundle-doctor.1 +43 -4
  62. data/lib/bundler/man/bundle-doctor.1.ronn +48 -4
  63. data/lib/bundler/man/bundle-env.1 +1 -1
  64. data/lib/bundler/man/bundle-exec.1 +2 -5
  65. data/lib/bundler/man/bundle-exec.1.ronn +1 -5
  66. data/lib/bundler/man/bundle-fund.1 +1 -1
  67. data/lib/bundler/man/bundle-gem.1 +64 -44
  68. data/lib/bundler/man/bundle-gem.1.ronn +10 -9
  69. data/lib/bundler/man/bundle-help.1 +1 -1
  70. data/lib/bundler/man/bundle-info.1 +1 -1
  71. data/lib/bundler/man/bundle-init.1 +1 -1
  72. data/lib/bundler/man/bundle-install.1 +16 -59
  73. data/lib/bundler/man/bundle-install.1.ronn +27 -108
  74. data/lib/bundler/man/bundle-issue.1 +1 -1
  75. data/lib/bundler/man/bundle-licenses.1 +1 -1
  76. data/lib/bundler/man/bundle-list.1 +6 -1
  77. data/lib/bundler/man/bundle-list.1.ronn +5 -0
  78. data/lib/bundler/man/bundle-lock.1 +1 -1
  79. data/lib/bundler/man/bundle-open.1 +1 -1
  80. data/lib/bundler/man/bundle-outdated.1 +1 -1
  81. data/lib/bundler/man/bundle-platform.1 +1 -1
  82. data/lib/bundler/man/bundle-plugin.1 +33 -15
  83. data/lib/bundler/man/bundle-plugin.1.ronn +36 -15
  84. data/lib/bundler/man/bundle-pristine.1 +1 -1
  85. data/lib/bundler/man/bundle-remove.1 +2 -8
  86. data/lib/bundler/man/bundle-remove.1.ronn +1 -8
  87. data/lib/bundler/man/bundle-show.1 +2 -5
  88. data/lib/bundler/man/bundle-show.1.ronn +0 -4
  89. data/lib/bundler/man/bundle-update.1 +5 -5
  90. data/lib/bundler/man/bundle-update.1.ronn +4 -4
  91. data/lib/bundler/man/bundle-version.1 +1 -1
  92. data/lib/bundler/man/bundle.1 +1 -10
  93. data/lib/bundler/man/bundle.1.ronn +0 -9
  94. data/lib/bundler/man/gemfile.5 +32 -1
  95. data/lib/bundler/man/gemfile.5.ronn +28 -0
  96. data/lib/bundler/man/index.txt +0 -2
  97. data/lib/bundler/match_platform.rb +31 -12
  98. data/lib/bundler/materialization.rb +3 -3
  99. data/lib/bundler/plugin/api/source.rb +8 -0
  100. data/lib/bundler/plugin/index.rb +6 -0
  101. data/lib/bundler/plugin/installer.rb +2 -11
  102. data/lib/bundler/plugin/source_list.rb +1 -1
  103. data/lib/bundler/plugin.rb +7 -4
  104. data/lib/bundler/resolver/package.rb +2 -1
  105. data/lib/bundler/resolver/strategy.rb +6 -3
  106. data/lib/bundler/resolver.rb +20 -4
  107. data/lib/bundler/retry.rb +30 -4
  108. data/lib/bundler/ruby_dsl.rb +17 -12
  109. data/lib/bundler/ruby_version.rb +1 -3
  110. data/lib/bundler/rubygems_ext.rb +117 -121
  111. data/lib/bundler/rubygems_gem_installer.rb +5 -4
  112. data/lib/bundler/rubygems_integration.rb +13 -12
  113. data/lib/bundler/runtime.rb +14 -3
  114. data/lib/bundler/self_manager.rb +34 -43
  115. data/lib/bundler/settings/validator.rb +5 -21
  116. data/lib/bundler/settings.rb +17 -32
  117. data/lib/bundler/shared_helpers.rb +12 -18
  118. data/lib/bundler/source/gemspec.rb +4 -0
  119. data/lib/bundler/source/git/git_proxy.rb +55 -29
  120. data/lib/bundler/source/git.rb +2 -3
  121. data/lib/bundler/source/metadata.rb +4 -0
  122. data/lib/bundler/source/path.rb +12 -7
  123. data/lib/bundler/source/rubygems.rb +59 -43
  124. data/lib/bundler/source/rubygems_aggregate.rb +4 -1
  125. data/lib/bundler/source.rb +3 -1
  126. data/lib/bundler/source_list.rb +5 -50
  127. data/lib/bundler/source_map.rb +8 -7
  128. data/lib/bundler/spec_set.rb +9 -14
  129. data/lib/bundler/stub_specification.rb +1 -0
  130. data/lib/bundler/templates/Executable +0 -11
  131. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
  132. data/lib/bundler/templates/newgem/Cargo.toml.tt +6 -0
  133. data/lib/bundler/templates/newgem/Rakefile.tt +5 -0
  134. data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  135. data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +8 -1
  136. data/lib/bundler/templates/newgem/ext/newgem/build.rs.tt +5 -0
  137. data/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
  138. data/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
  139. data/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
  140. data/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
  141. data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +13 -2
  142. data/lib/bundler/templates/newgem/github/workflows/build-gems.yml.tt +69 -0
  143. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +12 -1
  144. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  145. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -1
  146. data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -11
  147. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +8 -0
  148. data/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +6 -0
  149. data/lib/bundler/ui/shell.rb +12 -8
  150. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +26 -23
  151. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  152. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +50 -6
  153. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +57 -52
  154. data/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  155. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
  156. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +84 -42
  157. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
  158. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
  159. data/lib/bundler/vendor/thor/lib/thor/runner.rb +2 -2
  160. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
  161. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  162. data/lib/bundler/vendor/thor/lib/thor.rb +1 -1
  163. data/lib/bundler/vendor/uri/lib/uri/common.rb +57 -15
  164. data/lib/bundler/vendor/uri/lib/uri/file.rb +1 -1
  165. data/lib/bundler/vendor/uri/lib/uri/generic.rb +34 -21
  166. data/lib/bundler/vendor/uri/lib/uri/http.rb +12 -0
  167. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
  168. data/lib/bundler/vendor/uri/lib/uri/version.rb +2 -2
  169. data/lib/bundler/version.rb +10 -2
  170. data/lib/bundler/vlad.rb +1 -14
  171. data/lib/bundler/worker.rb +12 -4
  172. data/lib/bundler.rb +20 -40
  173. metadata +13 -25
  174. data/lib/bundler/cli/inject.rb +0 -60
  175. data/lib/bundler/cli/viz.rb +0 -31
  176. data/lib/bundler/gem_helpers.rb +0 -144
  177. data/lib/bundler/graph.rb +0 -152
  178. data/lib/bundler/man/bundle-inject.1 +0 -31
  179. data/lib/bundler/man/bundle-inject.1.ronn +0 -32
  180. data/lib/bundler/man/bundle-viz.1 +0 -30
  181. data/lib/bundler/man/bundle-viz.1.ronn +0 -36
  182. data/lib/bundler/similarity_detector.rb +0 -63
  183. data/lib/bundler/templates/Executable.bundler +0 -109
  184. data/lib/bundler/vendor/connection_pool/.document +0 -1
  185. data/lib/bundler/vendor/fileutils/.document +0 -1
  186. data/lib/bundler/vendor/net-http-persistent/.document +0 -1
  187. data/lib/bundler/vendor/pub_grub/.document +0 -1
  188. data/lib/bundler/vendor/securerandom/.document +0 -1
  189. data/lib/bundler/vendor/thor/.document +0 -1
  190. data/lib/bundler/vendor/tsort/.document +0 -1
  191. data/lib/bundler/vendor/uri/.document +0 -1
data/lib/bundler.rb CHANGED
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "bundler/rubygems_ext"
3
4
  require_relative "bundler/vendored_fileutils"
4
- require "pathname"
5
+ autoload :Pathname, "pathname" unless defined?(Pathname)
5
6
  require "rbconfig"
6
7
 
7
8
  require_relative "bundler/errors"
8
9
  require_relative "bundler/environment_preserver"
9
10
  require_relative "bundler/plugin"
10
- require_relative "bundler/rubygems_ext"
11
11
  require_relative "bundler/rubygems_integration"
12
12
  require_relative "bundler/version"
13
13
  require_relative "bundler/current_ruby"
@@ -53,9 +53,7 @@ module Bundler
53
53
  autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
54
54
  autoload :FREEBSD, File.expand_path("bundler/constants", __dir__)
55
55
  autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
56
- autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
57
56
  autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
58
- autoload :Graph, File.expand_path("bundler/graph", __dir__)
59
57
  autoload :Index, File.expand_path("bundler/index", __dir__)
60
58
  autoload :Injector, File.expand_path("bundler/injector", __dir__)
61
59
  autoload :Installer, File.expand_path("bundler/installer", __dir__)
@@ -114,13 +112,13 @@ module Bundler
114
112
  end
115
113
 
116
114
  def configured_bundle_path
117
- @configured_bundle_path ||= settings.path.tap(&:validate!)
115
+ @configured_bundle_path ||= Bundler.settings.path.tap(&:validate!)
118
116
  end
119
117
 
120
118
  # Returns absolute location of where binstubs are installed to.
121
119
  def bin_path
122
120
  @bin_path ||= begin
123
- path = settings[:bin] || "bin"
121
+ path = Bundler.settings[:bin] || "bin"
124
122
  path = Pathname.new(path).expand_path(root).expand_path
125
123
  mkdir_p(path)
126
124
  path
@@ -174,14 +172,14 @@ module Bundler
174
172
  self_manager.restart_with_locked_bundler_if_needed
175
173
  end
176
174
 
177
- # Automatically install dependencies if Bundler.settings[:auto_install] exists.
175
+ # Automatically install dependencies if <tt>settings[:auto_install]</tt> exists.
178
176
  # This is set through config cmd `bundle config set --global auto_install 1`.
179
177
  #
180
178
  # Note that this method `nil`s out the global Definition object, so it
181
179
  # should be called first, before you instantiate anything like an
182
180
  # `Installer` that'll keep a reference to the old one instead.
183
181
  def auto_install
184
- return unless settings[:auto_install]
182
+ return unless Bundler.settings[:auto_install]
185
183
 
186
184
  begin
187
185
  definition.specs
@@ -220,8 +218,7 @@ module Bundler
220
218
  end
221
219
 
222
220
  def environment
223
- SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load", print_caller_location: true
224
- load
221
+ SharedHelpers.feature_removed! "Bundler.environment has been removed in favor of Bundler.load"
225
222
  end
226
223
 
227
224
  # Returns an instance of Bundler::Definition for given Gemfile and lockfile
@@ -239,10 +236,10 @@ module Bundler
239
236
  end
240
237
 
241
238
  def frozen_bundle?
242
- frozen = settings[:frozen]
239
+ frozen = Bundler.settings[:frozen]
243
240
  return frozen unless frozen.nil?
244
241
 
245
- settings[:deployment]
242
+ Bundler.settings[:deployment]
246
243
  end
247
244
 
248
245
  def locked_gems
@@ -343,7 +340,7 @@ module Bundler
343
340
 
344
341
  def app_cache(custom_path = nil)
345
342
  path = custom_path || root
346
- Pathname.new(path).join(settings.app_cache_path)
343
+ Pathname.new(path).join(Bundler.settings.app_cache_path)
347
344
  end
348
345
 
349
346
  def tmp(name = Process.pid.to_s)
@@ -366,16 +363,11 @@ module Bundler
366
363
  ORIGINAL_ENV.clone
367
364
  end
368
365
 
369
- # @deprecated Use `unbundled_env` instead
370
366
  def clean_env
371
- message =
372
- "`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
373
- "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
374
367
  removed_message =
375
368
  "`Bundler.clean_env` has been removed in favor of `Bundler.unbundled_env`. " \
376
369
  "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
377
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
378
- unbundled_env
370
+ Bundler::SharedHelpers.feature_removed!(removed_message)
379
371
  end
380
372
 
381
373
  # @return [Hash] Environment with all bundler-related variables removed
@@ -393,16 +385,11 @@ module Bundler
393
385
  with_env(original_env) { yield }
394
386
  end
395
387
 
396
- # @deprecated Use `with_unbundled_env` instead
397
388
  def with_clean_env
398
- message =
399
- "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
400
- "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
401
389
  removed_message =
402
390
  "`Bundler.with_clean_env` has been removed in favor of `Bundler.with_unbundled_env`. " \
403
391
  "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
404
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
405
- with_env(unbundled_env) { yield }
392
+ Bundler::SharedHelpers.feature_removed!(removed_message)
406
393
  end
407
394
 
408
395
  # Run block with all bundler-related variables removed
@@ -415,16 +402,11 @@ module Bundler
415
402
  with_original_env { Kernel.system(*args) }
416
403
  end
417
404
 
418
- # @deprecated Use `unbundled_system` instead
419
405
  def clean_system(*args)
420
- message =
421
- "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \
422
- "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`"
423
406
  removed_message =
424
407
  "`Bundler.clean_system` has been removed in favor of `Bundler.unbundled_system`. " \
425
408
  "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`"
426
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
427
- with_env(unbundled_env) { Kernel.system(*args) }
409
+ Bundler::SharedHelpers.feature_removed!(removed_message)
428
410
  end
429
411
 
430
412
  # Run subcommand in an environment with all bundler related variables removed
@@ -437,16 +419,11 @@ module Bundler
437
419
  with_original_env { Kernel.exec(*args) }
438
420
  end
439
421
 
440
- # @deprecated Use `unbundled_exec` instead
441
422
  def clean_exec(*args)
442
- message =
443
- "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \
444
- "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`"
445
423
  removed_message =
446
424
  "`Bundler.clean_exec` has been removed in favor of `Bundler.unbundled_exec`. " \
447
425
  "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`"
448
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
449
- with_env(unbundled_env) { Kernel.exec(*args) }
426
+ Bundler::SharedHelpers.feature_removed!(removed_message)
450
427
  end
451
428
 
452
429
  # Run a `Kernel.exec` to a subcommand in an environment with all bundler related variables removed
@@ -455,10 +432,14 @@ module Bundler
455
432
  end
456
433
 
457
434
  def local_platform
458
- return Gem::Platform::RUBY if settings[:force_ruby_platform]
435
+ return Gem::Platform::RUBY if Bundler.settings[:force_ruby_platform]
459
436
  Gem::Platform.local
460
437
  end
461
438
 
439
+ def generic_local_platform
440
+ Gem::Platform.generic(local_platform)
441
+ end
442
+
462
443
  def default_gemfile
463
444
  SharedHelpers.default_gemfile
464
445
  end
@@ -564,7 +545,7 @@ module Bundler
564
545
  end
565
546
 
566
547
  def feature_flag
567
- @feature_flag ||= FeatureFlag.new(VERSION)
548
+ @feature_flag ||= FeatureFlag.new(Bundler.settings[:simulate_version] || VERSION)
568
549
  end
569
550
 
570
551
  def reset!
@@ -580,7 +561,6 @@ module Bundler
580
561
 
581
562
  def reset_paths!
582
563
  @bin_path = nil
583
- @bundler_major_version = nil
584
564
  @bundle_path = nil
585
565
  @configure = nil
586
566
  @configured_bundle_path = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.9
4
+ version: 4.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -62,7 +62,6 @@ files:
62
62
  - lib/bundler/cli/gem.rb
63
63
  - lib/bundler/cli/info.rb
64
64
  - lib/bundler/cli/init.rb
65
- - lib/bundler/cli/inject.rb
66
65
  - lib/bundler/cli/install.rb
67
66
  - lib/bundler/cli/issue.rb
68
67
  - lib/bundler/cli/list.rb
@@ -75,7 +74,6 @@ files:
75
74
  - lib/bundler/cli/remove.rb
76
75
  - lib/bundler/cli/show.rb
77
76
  - lib/bundler/cli/update.rb
78
- - lib/bundler/cli/viz.rb
79
77
  - lib/bundler/compact_index_client.rb
80
78
  - lib/bundler/compact_index_client/cache.rb
81
79
  - lib/bundler/compact_index_client/cache_file.rb
@@ -104,10 +102,8 @@ files:
104
102
  - lib/bundler/force_platform.rb
105
103
  - lib/bundler/friendly_errors.rb
106
104
  - lib/bundler/gem_helper.rb
107
- - lib/bundler/gem_helpers.rb
108
105
  - lib/bundler/gem_tasks.rb
109
106
  - lib/bundler/gem_version_promoter.rb
110
- - lib/bundler/graph.rb
111
107
  - lib/bundler/index.rb
112
108
  - lib/bundler/injector.rb
113
109
  - lib/bundler/inline.rb
@@ -149,8 +145,6 @@ files:
149
145
  - lib/bundler/man/bundle-info.1.ronn
150
146
  - lib/bundler/man/bundle-init.1
151
147
  - lib/bundler/man/bundle-init.1.ronn
152
- - lib/bundler/man/bundle-inject.1
153
- - lib/bundler/man/bundle-inject.1.ronn
154
148
  - lib/bundler/man/bundle-install.1
155
149
  - lib/bundler/man/bundle-install.1.ronn
156
150
  - lib/bundler/man/bundle-issue.1
@@ -179,8 +173,6 @@ files:
179
173
  - lib/bundler/man/bundle-update.1.ronn
180
174
  - lib/bundler/man/bundle-version.1
181
175
  - lib/bundler/man/bundle-version.1.ronn
182
- - lib/bundler/man/bundle-viz.1
183
- - lib/bundler/man/bundle-viz.1.ronn
184
176
  - lib/bundler/man/bundle.1
185
177
  - lib/bundler/man/bundle.1.ronn
186
178
  - lib/bundler/man/gemfile.5
@@ -225,7 +217,6 @@ files:
225
217
  - lib/bundler/settings/validator.rb
226
218
  - lib/bundler/setup.rb
227
219
  - lib/bundler/shared_helpers.rb
228
- - lib/bundler/similarity_detector.rb
229
220
  - lib/bundler/source.rb
230
221
  - lib/bundler/source/gemspec.rb
231
222
  - lib/bundler/source/git.rb
@@ -242,7 +233,6 @@ files:
242
233
  - lib/bundler/stub_specification.rb
243
234
  - lib/bundler/templates/.document
244
235
  - lib/bundler/templates/Executable
245
- - lib/bundler/templates/Executable.bundler
246
236
  - lib/bundler/templates/Executable.standalone
247
237
  - lib/bundler/templates/Gemfile
248
238
  - lib/bundler/templates/newgem/CHANGELOG.md.tt
@@ -257,11 +247,17 @@ files:
257
247
  - lib/bundler/templates/newgem/circleci/config.yml.tt
258
248
  - lib/bundler/templates/newgem/exe/newgem.tt
259
249
  - lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt
250
+ - lib/bundler/templates/newgem/ext/newgem/build.rs.tt
260
251
  - lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt
252
+ - lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt
261
253
  - lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt
254
+ - lib/bundler/templates/newgem/ext/newgem/go.mod.tt
255
+ - lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt
262
256
  - lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
257
+ - lib/bundler/templates/newgem/ext/newgem/newgem.go.tt
263
258
  - lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
264
259
  - lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt
260
+ - lib/bundler/templates/newgem/github/workflows/build-gems.yml.tt
265
261
  - lib/bundler/templates/newgem/github/workflows/main.yml.tt
266
262
  - lib/bundler/templates/newgem/gitignore.tt
267
263
  - lib/bundler/templates/newgem/gitlab-ci.yml.tt
@@ -285,22 +281,18 @@ files:
285
281
  - lib/bundler/uri_credentials_filter.rb
286
282
  - lib/bundler/uri_normalizer.rb
287
283
  - lib/bundler/vendor/.document
288
- - lib/bundler/vendor/connection_pool/.document
289
284
  - lib/bundler/vendor/connection_pool/LICENSE
290
285
  - lib/bundler/vendor/connection_pool/lib/connection_pool.rb
291
286
  - lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb
292
287
  - lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb
293
288
  - lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
294
- - lib/bundler/vendor/fileutils/.document
295
289
  - lib/bundler/vendor/fileutils/COPYING
296
290
  - lib/bundler/vendor/fileutils/lib/fileutils.rb
297
- - lib/bundler/vendor/net-http-persistent/.document
298
291
  - lib/bundler/vendor/net-http-persistent/README.rdoc
299
292
  - lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
300
293
  - lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
301
294
  - lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb
302
295
  - lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb
303
- - lib/bundler/vendor/pub_grub/.document
304
296
  - lib/bundler/vendor/pub_grub/LICENSE.txt
305
297
  - lib/bundler/vendor/pub_grub/lib/pub_grub.rb
306
298
  - lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb
@@ -319,10 +311,8 @@ files:
319
311
  - lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb
320
312
  - lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb
321
313
  - lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb
322
- - lib/bundler/vendor/securerandom/.document
323
314
  - lib/bundler/vendor/securerandom/COPYING
324
315
  - lib/bundler/vendor/securerandom/lib/securerandom.rb
325
- - lib/bundler/vendor/thor/.document
326
316
  - lib/bundler/vendor/thor/LICENSE.md
327
317
  - lib/bundler/vendor/thor/lib/thor.rb
328
318
  - lib/bundler/vendor/thor/lib/thor/actions.rb
@@ -359,10 +349,8 @@ files:
359
349
  - lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb
360
350
  - lib/bundler/vendor/thor/lib/thor/util.rb
361
351
  - lib/bundler/vendor/thor/lib/thor/version.rb
362
- - lib/bundler/vendor/tsort/.document
363
352
  - lib/bundler/vendor/tsort/LICENSE.txt
364
353
  - lib/bundler/vendor/tsort/lib/tsort.rb
365
- - lib/bundler/vendor/uri/.document
366
354
  - lib/bundler/vendor/uri/COPYING
367
355
  - lib/bundler/vendor/uri/lib/uri.rb
368
356
  - lib/bundler/vendor/uri/lib/uri/common.rb
@@ -396,10 +384,10 @@ homepage: https://bundler.io
396
384
  licenses:
397
385
  - MIT
398
386
  metadata:
399
- bug_tracker_uri: https://github.com/rubygems/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler
400
- changelog_uri: https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md
387
+ bug_tracker_uri: https://github.com/ruby/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler
388
+ changelog_uri: https://github.com/ruby/rubygems/blob/master/bundler/CHANGELOG.md
401
389
  homepage_uri: https://bundler.io/
402
- source_code_uri: https://github.com/rubygems/rubygems/tree/master/bundler
390
+ source_code_uri: https://github.com/ruby/rubygems/tree/master/bundler
403
391
  rdoc_options: []
404
392
  require_paths:
405
393
  - lib
@@ -407,14 +395,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
407
395
  requirements:
408
396
  - - ">="
409
397
  - !ruby/object:Gem::Version
410
- version: 3.1.0
398
+ version: 3.2.0
411
399
  required_rubygems_version: !ruby/object:Gem::Requirement
412
400
  requirements:
413
401
  - - ">="
414
402
  - !ruby/object:Gem::Version
415
- version: 3.3.3
403
+ version: 3.4.1
416
404
  requirements: []
417
- rubygems_version: 3.6.9
405
+ rubygems_version: 4.0.6
418
406
  specification_version: 4
419
407
  summary: The best way to manage your application's dependencies
420
408
  test_files: []
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bundler
4
- class CLI::Inject
5
- attr_reader :options, :name, :version, :group, :source, :gems
6
- def initialize(options, name, version)
7
- @options = options
8
- @name = name
9
- @version = version || last_version_number
10
- @group = options[:group].split(",") unless options[:group].nil?
11
- @source = options[:source]
12
- @gems = []
13
- end
14
-
15
- def run
16
- # The required arguments allow Thor to give useful feedback when the arguments
17
- # are incorrect. This adds those first two arguments onto the list as a whole.
18
- gems.unshift(source).unshift(group).unshift(version).unshift(name)
19
-
20
- # Build an array of Dependency objects out of the arguments
21
- deps = []
22
- # when `inject` support addition of more than one gem, then this loop will
23
- # help. Currently this loop is running once.
24
- gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
25
- ops = Gem::Requirement::OPS.map {|key, _val| key }
26
- has_op = ops.any? {|op| gem_version.start_with? op }
27
- gem_version = "~> #{gem_version}" unless has_op
28
- deps << Bundler::Dependency.new(gem_name, gem_version, "group" => gem_group, "source" => gem_source)
29
- end
30
-
31
- added = Injector.inject(deps, options)
32
-
33
- if added.any?
34
- Bundler.ui.confirm "Added to Gemfile:"
35
- Bundler.ui.confirm(added.map do |d|
36
- name = "'#{d.name}'"
37
- requirement = ", '#{d.requirement}'"
38
- group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
39
- source = ", source: '#{d.source}'" unless d.source.nil?
40
- %(gem #{name}#{requirement}#{group}#{source})
41
- end.join("\n"))
42
- else
43
- Bundler.ui.confirm "All gems were already present in the Gemfile"
44
- end
45
- end
46
-
47
- private
48
-
49
- def last_version_number
50
- definition = Bundler.definition(true)
51
- definition.remotely!
52
- specs = definition.index[name].sort_by(&:version)
53
- unless options[:pre]
54
- specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
55
- end
56
- spec = specs.last
57
- spec.version.to_s
58
- end
59
- end
60
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bundler
4
- class CLI::Viz
5
- attr_reader :options, :gem_name
6
- def initialize(options)
7
- @options = options
8
- end
9
-
10
- def run
11
- # make sure we get the right `graphviz`. There is also a `graphviz`
12
- # gem we're not built to support
13
- gem "ruby-graphviz"
14
- require "graphviz"
15
-
16
- options[:without] = options[:without].join(":").tr(" ", ":").split(":")
17
- output_file = File.expand_path(options[:file])
18
-
19
- graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
20
- graph.viz
21
- rescue LoadError => e
22
- Bundler.ui.error e.inspect
23
- Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:"
24
- Bundler.ui.warn "`gem install ruby-graphviz`"
25
- rescue StandardError => e
26
- raise unless e.message.to_s.include?("GraphViz not installed or dot not in PATH")
27
- Bundler.ui.error e.message
28
- Bundler.ui.warn "Please install GraphViz. On a Mac with Homebrew, you can run `brew install graphviz`."
29
- end
30
- end
31
- end
@@ -1,144 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bundler
4
- module GemHelpers
5
- GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant
6
- GENERICS = [
7
- Gem::Platform::JAVA,
8
- *Gem::Platform::WINDOWS,
9
- ].freeze
10
-
11
- def generic(p)
12
- GENERIC_CACHE[p] ||= begin
13
- found = GENERICS.find do |match|
14
- p === match
15
- end
16
- found || Gem::Platform::RUBY
17
- end
18
- end
19
- module_function :generic
20
-
21
- def generic_local_platform
22
- generic(local_platform)
23
- end
24
- module_function :generic_local_platform
25
-
26
- def local_platform
27
- Bundler.local_platform
28
- end
29
- module_function :local_platform
30
-
31
- def generic_local_platform_is_ruby?
32
- generic_local_platform == Gem::Platform::RUBY
33
- end
34
- module_function :generic_local_platform_is_ruby?
35
-
36
- def platform_specificity_match(spec_platform, user_platform)
37
- spec_platform = Gem::Platform.new(spec_platform)
38
-
39
- PlatformMatch.specificity_score(spec_platform, user_platform)
40
- end
41
- module_function :platform_specificity_match
42
-
43
- def select_all_platform_match(specs, platform, force_ruby: false, prefer_locked: false)
44
- matching = if force_ruby
45
- specs.select {|spec| spec.match_platform(Gem::Platform::RUBY) && spec.force_ruby_platform! }
46
- else
47
- specs.select {|spec| spec.match_platform(platform) }
48
- end
49
-
50
- if prefer_locked
51
- locked_originally = matching.select {|spec| spec.is_a?(LazySpecification) }
52
- return locked_originally if locked_originally.any?
53
- end
54
-
55
- matching
56
- end
57
- module_function :select_all_platform_match
58
-
59
- def select_best_platform_match(specs, platform, force_ruby: false, prefer_locked: false)
60
- matching = select_all_platform_match(specs, platform, force_ruby: force_ruby, prefer_locked: prefer_locked)
61
-
62
- sort_and_filter_best_platform_match(matching, platform)
63
- end
64
- module_function :select_best_platform_match
65
-
66
- def select_best_local_platform_match(specs, force_ruby: false)
67
- matching = select_all_platform_match(specs, local_platform, force_ruby: force_ruby).filter_map(&:materialized_for_installation)
68
-
69
- sort_best_platform_match(matching, local_platform)
70
- end
71
- module_function :select_best_local_platform_match
72
-
73
- def sort_and_filter_best_platform_match(matching, platform)
74
- return matching if matching.one?
75
-
76
- exact = matching.select {|spec| spec.platform == platform }
77
- return exact if exact.any?
78
-
79
- sorted_matching = sort_best_platform_match(matching, platform)
80
- exemplary_spec = sorted_matching.first
81
-
82
- sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
83
- end
84
- module_function :sort_and_filter_best_platform_match
85
-
86
- def sort_best_platform_match(matching, platform)
87
- matching.sort_by {|spec| platform_specificity_match(spec.platform, platform) }
88
- end
89
- module_function :sort_best_platform_match
90
-
91
- class PlatformMatch
92
- def self.specificity_score(spec_platform, user_platform)
93
- return -1 if spec_platform == user_platform
94
- return 1_000_000 if spec_platform.nil? || spec_platform == Gem::Platform::RUBY || user_platform == Gem::Platform::RUBY
95
-
96
- os_match(spec_platform, user_platform) +
97
- cpu_match(spec_platform, user_platform) * 10 +
98
- platform_version_match(spec_platform, user_platform) * 100
99
- end
100
-
101
- def self.os_match(spec_platform, user_platform)
102
- if spec_platform.os == user_platform.os
103
- 0
104
- else
105
- 1
106
- end
107
- end
108
-
109
- def self.cpu_match(spec_platform, user_platform)
110
- if spec_platform.cpu == user_platform.cpu
111
- 0
112
- elsif spec_platform.cpu == "arm" && user_platform.cpu.to_s.start_with?("arm")
113
- 0
114
- elsif spec_platform.cpu.nil? || spec_platform.cpu == "universal"
115
- 1
116
- else
117
- 2
118
- end
119
- end
120
-
121
- def self.platform_version_match(spec_platform, user_platform)
122
- if spec_platform.version == user_platform.version
123
- 0
124
- elsif spec_platform.version.nil?
125
- 1
126
- else
127
- 2
128
- end
129
- end
130
- end
131
-
132
- def same_specificity(platform, spec, exemplary_spec)
133
- platform_specificity_match(spec.platform, platform) == platform_specificity_match(exemplary_spec.platform, platform)
134
- end
135
- module_function :same_specificity
136
-
137
- def same_deps(spec, exemplary_spec)
138
- same_runtime_deps = spec.dependencies.sort == exemplary_spec.dependencies.sort
139
- same_metadata_deps = spec.required_ruby_version == exemplary_spec.required_ruby_version && spec.required_rubygems_version == exemplary_spec.required_rubygems_version
140
- same_runtime_deps && same_metadata_deps
141
- end
142
- module_function :same_deps
143
- end
144
- end