rubygems-update 3.7.2 → 4.0.0.beta2

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 (211) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1431 -1323
  3. data/CODE_OF_CONDUCT.md +7 -129
  4. data/Manifest.txt +5 -11
  5. data/README.md +2 -2
  6. data/bundler/CHANGELOG.md +1011 -917
  7. data/bundler/README.md +4 -4
  8. data/bundler/bundler.gemspec +3 -3
  9. data/bundler/lib/bundler/build_metadata.rb +2 -2
  10. data/bundler/lib/bundler/capistrano.rb +1 -19
  11. data/bundler/lib/bundler/cli/cache.rb +1 -11
  12. data/bundler/lib/bundler/cli/common.rb +20 -3
  13. data/bundler/lib/bundler/cli/config.rb +1 -2
  14. data/bundler/lib/bundler/cli/console.rb +5 -0
  15. data/bundler/lib/bundler/cli/exec.rb +29 -4
  16. data/bundler/lib/bundler/cli/gem.rb +19 -33
  17. data/bundler/lib/bundler/cli/install.rb +9 -82
  18. data/bundler/lib/bundler/cli/issue.rb +2 -2
  19. data/bundler/lib/bundler/cli/list.rb +33 -2
  20. data/bundler/lib/bundler/cli/plugin.rb +5 -1
  21. data/bundler/lib/bundler/cli/show.rb +1 -1
  22. data/bundler/lib/bundler/cli/update.rb +3 -3
  23. data/bundler/lib/bundler/cli.rb +91 -85
  24. data/bundler/lib/bundler/compact_index_client.rb +0 -1
  25. data/bundler/lib/bundler/current_ruby.rb +3 -15
  26. data/bundler/lib/bundler/definition.rb +65 -36
  27. data/bundler/lib/bundler/deployment.rb +1 -64
  28. data/bundler/lib/bundler/digest.rb +1 -1
  29. data/bundler/lib/bundler/dsl.rb +26 -36
  30. data/bundler/lib/bundler/endpoint_specification.rb +0 -22
  31. data/bundler/lib/bundler/environment_preserver.rb +1 -0
  32. data/bundler/lib/bundler/errors.rb +1 -5
  33. data/bundler/lib/bundler/feature_flag.rb +0 -33
  34. data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
  35. data/bundler/lib/bundler/friendly_errors.rb +2 -2
  36. data/bundler/lib/bundler/index.rb +0 -7
  37. data/bundler/lib/bundler/inline.rb +9 -1
  38. data/bundler/lib/bundler/installer/gem_installer.rb +0 -11
  39. data/bundler/lib/bundler/installer.rb +0 -6
  40. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  41. data/bundler/lib/bundler/lockfile_parser.rb +2 -12
  42. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-binstubs.1 +3 -6
  44. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +4 -6
  45. data/bundler/lib/bundler/man/bundle-cache.1 +2 -14
  46. data/bundler/lib/bundler/man/bundle-cache.1.ronn +1 -14
  47. data/bundler/lib/bundler/man/bundle-check.1 +2 -5
  48. data/bundler/lib/bundler/man/bundle-check.1.ronn +0 -5
  49. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-config.1 +9 -33
  51. data/bundler/lib/bundler/man/bundle-config.1.ronn +24 -55
  52. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-env.1 +1 -1
  55. data/bundler/lib/bundler/man/bundle-exec.1 +2 -5
  56. data/bundler/lib/bundler/man/bundle-exec.1.ronn +1 -5
  57. data/bundler/lib/bundler/man/bundle-fund.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-gem.1 +3 -6
  59. data/bundler/lib/bundler/man/bundle-gem.1.ronn +2 -5
  60. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  61. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-install.1 +14 -57
  64. data/bundler/lib/bundler/man/bundle-install.1.ronn +25 -105
  65. data/bundler/lib/bundler/man/bundle-issue.1 +1 -1
  66. data/bundler/lib/bundler/man/bundle-licenses.1 +1 -1
  67. data/bundler/lib/bundler/man/bundle-list.1 +6 -1
  68. data/bundler/lib/bundler/man/bundle-list.1.ronn +5 -0
  69. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  71. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  72. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  73. data/bundler/lib/bundler/man/bundle-plugin.1 +2 -9
  74. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +0 -8
  75. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  76. data/bundler/lib/bundler/man/bundle-remove.1 +2 -8
  77. data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -8
  78. data/bundler/lib/bundler/man/bundle-show.1 +2 -5
  79. data/bundler/lib/bundler/man/bundle-show.1.ronn +0 -4
  80. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  81. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  82. data/bundler/lib/bundler/man/bundle.1 +1 -10
  83. data/bundler/lib/bundler/man/bundle.1.ronn +0 -9
  84. data/bundler/lib/bundler/man/gemfile.5 +32 -1
  85. data/bundler/lib/bundler/man/gemfile.5.ronn +28 -0
  86. data/bundler/lib/bundler/man/index.txt +0 -2
  87. data/bundler/lib/bundler/materialization.rb +1 -1
  88. data/bundler/lib/bundler/plugin/installer.rb +0 -10
  89. data/bundler/lib/bundler/plugin/source_list.rb +1 -1
  90. data/bundler/lib/bundler/plugin.rb +1 -1
  91. data/bundler/lib/bundler/resolver.rb +1 -1
  92. data/bundler/lib/bundler/ruby_dsl.rb +2 -0
  93. data/bundler/lib/bundler/ruby_version.rb +1 -3
  94. data/bundler/lib/bundler/rubygems_ext.rb +1 -1
  95. data/bundler/lib/bundler/rubygems_gem_installer.rb +1 -1
  96. data/bundler/lib/bundler/rubygems_integration.rb +1 -5
  97. data/bundler/lib/bundler/runtime.rb +5 -1
  98. data/bundler/lib/bundler/self_manager.rb +1 -1
  99. data/bundler/lib/bundler/settings.rb +8 -26
  100. data/bundler/lib/bundler/shared_helpers.rb +12 -20
  101. data/bundler/lib/bundler/source/git/git_proxy.rb +3 -11
  102. data/bundler/lib/bundler/source/git.rb +2 -3
  103. data/bundler/lib/bundler/source/path.rb +3 -7
  104. data/bundler/lib/bundler/source/rubygems.rb +11 -17
  105. data/bundler/lib/bundler/source.rb +1 -1
  106. data/bundler/lib/bundler/source_list.rb +4 -45
  107. data/bundler/lib/bundler/source_map.rb +2 -5
  108. data/bundler/lib/bundler/spec_set.rb +6 -15
  109. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
  110. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +5 -0
  111. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  112. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
  113. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
  114. data/bundler/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
  115. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
  116. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
  117. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +6 -0
  118. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  119. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -1
  120. data/bundler/lib/bundler/ui/shell.rb +10 -6
  121. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +26 -23
  122. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  123. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +50 -6
  124. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +57 -52
  125. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +5 -2
  126. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +1 -1
  127. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +57 -15
  128. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +1 -1
  129. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +34 -21
  130. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +12 -0
  131. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
  132. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +2 -2
  133. data/bundler/lib/bundler/version.rb +1 -1
  134. data/bundler/lib/bundler/vlad.rb +1 -14
  135. data/bundler/lib/bundler.rb +6 -28
  136. data/doc/MAINTAINERS.txt +0 -7
  137. data/doc/bundler/UPGRADING.md +11 -5
  138. data/doc/rubygems/CONTRIBUTING.md +1 -1
  139. data/lib/rubygems/basic_specification.rb +3 -9
  140. data/lib/rubygems/bundler_version_finder.rb +38 -3
  141. data/lib/rubygems/command.rb +1 -1
  142. data/lib/rubygems/command_manager.rb +3 -4
  143. data/lib/rubygems/commands/build_command.rb +0 -7
  144. data/lib/rubygems/commands/cert_command.rb +1 -1
  145. data/lib/rubygems/commands/install_command.rb +1 -5
  146. data/lib/rubygems/commands/setup_command.rb +5 -3
  147. data/lib/rubygems/config_file.rb +1 -1
  148. data/lib/rubygems/dependency.rb +1 -1
  149. data/lib/rubygems/dependency_installer.rb +0 -77
  150. data/lib/rubygems/dependency_list.rb +1 -2
  151. data/lib/rubygems/deprecate.rb +74 -72
  152. data/lib/rubygems/doctor.rb +1 -1
  153. data/lib/rubygems/errors.rb +1 -1
  154. data/lib/rubygems/exceptions.rb +2 -3
  155. data/lib/rubygems/ext/builder.rb +6 -2
  156. data/lib/rubygems/ext/cargo_builder.rb +2 -2
  157. data/lib/rubygems/ext/cmake_builder.rb +97 -8
  158. data/lib/rubygems/ext/configure_builder.rb +2 -2
  159. data/lib/rubygems/ext/ext_conf_builder.rb +6 -2
  160. data/lib/rubygems/ext/rake_builder.rb +2 -2
  161. data/lib/rubygems/gem_runner.rb +0 -1
  162. data/lib/rubygems/install_update_options.rb +1 -2
  163. data/lib/rubygems/installer.rb +16 -54
  164. data/lib/rubygems/name_tuple.rb +7 -1
  165. data/lib/rubygems/package/tar_header.rb +4 -4
  166. data/lib/rubygems/package/tar_reader.rb +2 -0
  167. data/lib/rubygems/package/tar_writer.rb +1 -1
  168. data/lib/rubygems/package.rb +21 -12
  169. data/lib/rubygems/platform.rb +31 -11
  170. data/lib/rubygems/remote_fetcher.rb +8 -5
  171. data/lib/rubygems/resolver/conflict.rb +1 -1
  172. data/lib/rubygems/resolver.rb +1 -1
  173. data/lib/rubygems/security/signer.rb +1 -1
  174. data/lib/rubygems/source.rb +2 -2
  175. data/lib/rubygems/spec_fetcher.rb +4 -4
  176. data/lib/rubygems/specification.rb +5 -96
  177. data/lib/rubygems/specification_policy.rb +0 -36
  178. data/lib/rubygems/specification_record.rb +1 -1
  179. data/lib/rubygems/text.rb +1 -1
  180. data/lib/rubygems/uninstaller.rb +17 -6
  181. data/lib/rubygems/user_interaction.rb +6 -9
  182. data/lib/rubygems/util.rb +0 -22
  183. data/lib/rubygems/validator.rb +1 -1
  184. data/lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb +25 -9
  185. data/lib/rubygems/vendor/net-http/lib/net/http/responses.rb +2 -2
  186. data/lib/rubygems/vendor/net-http/lib/net/http.rb +14 -14
  187. data/lib/rubygems/vendor/optparse/lib/optparse.rb +82 -41
  188. data/lib/rubygems/vendor/resolv/lib/resolv.rb +1 -1
  189. data/lib/rubygems/vendor/timeout/lib/timeout.rb +4 -1
  190. data/lib/rubygems/vendor/uri/lib/uri/common.rb +57 -15
  191. data/lib/rubygems/vendor/uri/lib/uri/file.rb +1 -1
  192. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +34 -21
  193. data/lib/rubygems/vendor/uri/lib/uri/http.rb +12 -0
  194. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
  195. data/lib/rubygems/vendor/uri/lib/uri/version.rb +2 -2
  196. data/lib/rubygems/version.rb +8 -20
  197. data/lib/rubygems/win_platform.rb +31 -0
  198. data/lib/rubygems.rb +12 -40
  199. data/rubygems-update.gemspec +6 -4
  200. metadata +10 -18
  201. data/bundler/lib/bundler/cli/inject.rb +0 -60
  202. data/bundler/lib/bundler/cli/viz.rb +0 -31
  203. data/bundler/lib/bundler/graph.rb +0 -152
  204. data/bundler/lib/bundler/man/bundle-inject.1 +0 -31
  205. data/bundler/lib/bundler/man/bundle-inject.1.ronn +0 -32
  206. data/bundler/lib/bundler/man/bundle-viz.1 +0 -30
  207. data/bundler/lib/bundler/man/bundle-viz.1.ronn +0 -36
  208. data/bundler/lib/bundler/similarity_detector.rb +0 -63
  209. data/lib/rubygems/commands/query_command.rb +0 -43
  210. data/lib/rubygems/compatibility.rb +0 -41
  211. data/lib/rubygems/install_default_message.rb +0 -13
@@ -76,9 +76,6 @@ We divide `bundle` subcommands into primary commands and utilities:
76
76
  * [`bundle lock(1)`](bundle-lock.1.html):
77
77
  Generate a lockfile for your dependencies
78
78
 
79
- * [`bundle viz(1)`](bundle-viz.1.html) (deprecated):
80
- Generate a visual representation of your dependencies
81
-
82
79
  * [`bundle init(1)`](bundle-init.1.html):
83
80
  Generate a simple `Gemfile`, placed in the current directory
84
81
 
@@ -108,9 +105,3 @@ We divide `bundle` subcommands into primary commands and utilities:
108
105
  When running a command that isn't listed in PRIMARY COMMANDS or UTILITIES,
109
106
  Bundler will try to find an executable on your path named `bundler-<command>`
110
107
  and execute it, passing down any extra arguments to it.
111
-
112
- ## OBSOLETE
113
-
114
- These commands are obsolete and should no longer be used:
115
-
116
- * `bundle inject(1)`
@@ -1,6 +1,6 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "GEMFILE" "5" "August 2025" ""
3
+ .TH "GEMFILE" "5" "September 2025" ""
4
4
  .SH "NAME"
5
5
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
6
6
  .SH "SYNOPSIS"
@@ -469,4 +469,35 @@ For implicit gems (dependencies of explicit gems), any source, git, or path repo
469
469
  .IP "3." 4
470
470
  If neither of the above conditions are met, the global source will be used\. If multiple global sources are specified, they will be prioritized from last to first, but this is deprecated since Bundler 1\.13, so Bundler prints a warning and will abort with an error in the future\.
471
471
  .IP "" 0
472
+ .SH "LOCKFILE"
473
+ By default, Bundler will create a lockfile by adding \fB\.lock\fR to the end of the Gemfile name\. To change this, use the \fBlockfile\fR method:
474
+ .IP "" 4
475
+ .nf
476
+ lockfile "/path/to/lockfile\.lock"
477
+ .fi
478
+ .IP "" 0
479
+ .P
480
+ This is useful when you want to use different lockfiles per ruby version or platform\.
481
+ .P
482
+ To avoid writing a lock file, use \fBfalse\fR as the argument:
483
+ .IP "" 4
484
+ .nf
485
+ lockfile false
486
+ .fi
487
+ .IP "" 0
488
+ .P
489
+ This is useful for library development and other situations where the code is expected to work with a range of dependency versions\.
490
+ .SS "LOCKFILE PRECEDENCE"
491
+ When determining path to the lockfile or whether to create a lockfile, the following precedence is used:
492
+ .IP "1." 4
493
+ The \fBbundle install\fR \fB\-\-no\-lock\fR option (which disables lockfile creation)\.
494
+ .IP "2." 4
495
+ The \fBbundle install\fR \fB\-\-lockfile\fR option\.
496
+ .IP "3." 4
497
+ The \fBlockfile\fR method in the Gemfile\.
498
+ .IP "4." 4
499
+ The \fBBUNDLE_LOCKFILE\fR environment variable\.
500
+ .IP "5." 4
501
+ The default behavior of adding \fB\.lock\fR to the end of the Gemfile name\.
502
+ .IP "" 0
472
503
 
@@ -556,3 +556,31 @@ bundler uses the following priority order:
556
556
  If multiple global sources are specified, they will be prioritized from
557
557
  last to first, but this is deprecated since Bundler 1.13, so Bundler prints
558
558
  a warning and will abort with an error in the future.
559
+
560
+ ## LOCKFILE
561
+
562
+ By default, Bundler will create a lockfile by adding `.lock` to the end of the
563
+ Gemfile name. To change this, use the `lockfile` method:
564
+
565
+ lockfile "/path/to/lockfile.lock"
566
+
567
+ This is useful when you want to use different lockfiles per ruby version or
568
+ platform.
569
+
570
+ To avoid writing a lock file, use `false` as the argument:
571
+
572
+ lockfile false
573
+
574
+ This is useful for library development and other situations where the code is
575
+ expected to work with a range of dependency versions.
576
+
577
+ ### LOCKFILE PRECEDENCE
578
+
579
+ When determining path to the lockfile or whether to create a lockfile, the
580
+ following precedence is used:
581
+
582
+ 1. The `bundle install` `--no-lock` option (which disables lockfile creation).
583
+ 1. The `bundle install` `--lockfile` option.
584
+ 1. The `lockfile` method in the Gemfile.
585
+ 1. The `BUNDLE_LOCKFILE` environment variable.
586
+ 1. The default behavior of adding `.lock` to the end of the Gemfile name.
@@ -15,7 +15,6 @@ bundle-gem(1) bundle-gem.1
15
15
  bundle-help(1) bundle-help.1
16
16
  bundle-info(1) bundle-info.1
17
17
  bundle-init(1) bundle-init.1
18
- bundle-inject(1) bundle-inject.1
19
18
  bundle-install(1) bundle-install.1
20
19
  bundle-issue(1) bundle-issue.1
21
20
  bundle-licenses(1) bundle-licenses.1
@@ -30,4 +29,3 @@ bundle-remove(1) bundle-remove.1
30
29
  bundle-show(1) bundle-show.1
31
30
  bundle-update(1) bundle-update.1
32
31
  bundle-version(1) bundle-version.1
33
- bundle-viz(1) bundle-viz.1
@@ -29,7 +29,7 @@ module Bundler
29
29
  end
30
30
 
31
31
  def dependencies
32
- specs.first.runtime_dependencies.map {|d| [d, platform] }
32
+ (materialized_spec || specs.first).runtime_dependencies.map {|d| [d, platform] }
33
33
  end
34
34
 
35
35
  def materialized_spec
@@ -43,16 +43,6 @@ module Bundler
43
43
  private
44
44
 
45
45
  def check_sources_consistency!(options)
46
- if options.key?(:git) && options.key?(:local_git)
47
- raise InvalidOption, "Remote and local plugin git sources can't be both specified"
48
- end
49
-
50
- # back-compat; local_git is an alias for git
51
- if options.key?(:local_git)
52
- Bundler::SharedHelpers.major_deprecation(2, "--local_git is deprecated, use --git")
53
- options[:git] = options.delete(:local_git)
54
- end
55
-
56
46
  if (options.keys & [:source, :git, :path]).length > 1
57
47
  raise InvalidOption, "Only one of --source, --git, or --path may be specified"
58
48
  end
@@ -23,7 +23,7 @@ module Bundler
23
23
 
24
24
  private
25
25
 
26
- def rubygems_aggregate_class
26
+ def source_class
27
27
  Plugin::Installer::Rubygems
28
28
  end
29
29
  end
@@ -220,7 +220,7 @@ module Bundler
220
220
  #
221
221
  # @param [String] event
222
222
  def hook(event, *args, &arg_blk)
223
- return unless Bundler.feature_flag.plugins?
223
+ return unless Bundler.settings[:plugins]
224
224
  unless Events.defined_event?(event)
225
225
  raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
226
226
  end
@@ -165,7 +165,7 @@ module Bundler
165
165
  PubGrub::VersionConstraint.new(package, range: range)
166
166
  end
167
167
 
168
- def versions_for(package, range=VersionRange.any)
168
+ def versions_for(package, range = VersionRange.any)
169
169
  range.select_versions(@sorted_versions[package])
170
170
  end
171
171
 
@@ -57,6 +57,8 @@ module Bundler
57
57
  else
58
58
  file_content.strip
59
59
  end
60
+ rescue Errno::ENOENT
61
+ raise GemfileError, "Could not find version file #{filename}"
60
62
  end
61
63
  end
62
64
  end
@@ -43,7 +43,6 @@ module Bundler
43
43
 
44
44
  def to_s(versions = self.versions)
45
45
  output = String.new("ruby #{versions_string(versions)}")
46
- output << "p#{patchlevel}" if patchlevel && patchlevel != "-1"
47
46
  output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
48
47
 
49
48
  output
@@ -72,8 +71,7 @@ module Bundler
72
71
  def ==(other)
73
72
  versions == other.versions &&
74
73
  engine == other.engine &&
75
- engine_versions == other.engine_versions &&
76
- patchlevel == other.patchlevel
74
+ engine_versions == other.engine_versions
77
75
  end
78
76
 
79
77
  def host
@@ -417,7 +417,7 @@ module Gem
417
417
  unless Gem::NameTuple.new("a", Gem::Version.new("1"), Gem::Platform.new("x86_64-linux")).platform.is_a?(String)
418
418
  alias_method :initialize_with_platform, :initialize
419
419
 
420
- def initialize(name, version, platform=Gem::Platform::RUBY)
420
+ def initialize(name, version, platform = Gem::Platform::RUBY)
421
421
  if Gem::Platform === platform
422
422
  initialize_with_platform(name, version, platform.to_s)
423
423
  else
@@ -69,7 +69,7 @@ module Bundler
69
69
  end
70
70
 
71
71
  def generate_plugins
72
- return unless Gem::Installer.instance_methods(false).include?(:generate_plugins)
72
+ return unless Gem::Installer.method_defined?(:generate_plugins, false)
73
73
 
74
74
  latest = Gem::Specification.stubs_for(spec.name).first
75
75
  return if latest && latest.version > spec.version
@@ -416,11 +416,7 @@ module Bundler
416
416
  end
417
417
 
418
418
  def all_specs
419
- SharedHelpers.major_deprecation 2, "Bundler.rubygems.all_specs has been removed in favor of Bundler.rubygems.installed_specs"
420
-
421
- Gem::Specification.stubs.map do |stub|
422
- StubSpecification.from_stub(stub)
423
- end
419
+ SharedHelpers.feature_removed! "Bundler.rubygems.all_specs has been removed in favor of Bundler.rubygems.installed_specs"
424
420
  end
425
421
 
426
422
  def installed_specs
@@ -240,7 +240,11 @@ module Bundler
240
240
 
241
241
  cached.each do |path|
242
242
  Bundler.ui.info " * #{File.basename(path)}"
243
- File.delete(path)
243
+
244
+ begin
245
+ File.delete(path)
246
+ rescue Errno::ENOENT
247
+ end
244
248
  end
245
249
  end
246
250
  end
@@ -97,7 +97,7 @@ module Bundler
97
97
  end
98
98
 
99
99
  def autoswitching_applies?
100
- ENV["BUNDLER_VERSION"].nil? &&
100
+ (ENV["BUNDLER_VERSION"].nil? || ENV["BUNDLER_VERSION"].empty?) &&
101
101
  ruby_can_restart_with_same_arguments? &&
102
102
  lockfile_version
103
103
  end
@@ -7,7 +7,6 @@ module Bundler
7
7
  autoload :Validator, File.expand_path("settings/validator", __dir__)
8
8
 
9
9
  BOOL_KEYS = %w[
10
- allow_offline_install
11
10
  auto_install
12
11
  cache_all
13
12
  cache_all_platforms
@@ -20,7 +19,6 @@ module Bundler
20
19
  disable_shared_gems
21
20
  disable_version_check
22
21
  force_ruby_platform
23
- forget_cli_options
24
22
  frozen
25
23
  gem.changelog
26
24
  gem.coc
@@ -43,20 +41,6 @@ module Bundler
43
41
  verbose
44
42
  ].freeze
45
43
 
46
- REMEMBERED_KEYS = %w[
47
- bin
48
- cache_all
49
- clean
50
- deployment
51
- frozen
52
- no_prune
53
- path
54
- shebang
55
- path.system
56
- without
57
- with
58
- ].freeze
59
-
60
44
  NUMBER_KEYS = %w[
61
45
  jobs
62
46
  redirect
@@ -81,6 +65,7 @@ module Bundler
81
65
  gem.rubocop
82
66
  gem.test
83
67
  gemfile
68
+ lockfile
84
69
  path
85
70
  shebang
86
71
  simulate_version
@@ -97,6 +82,11 @@ module Bundler
97
82
  "BUNDLE_RETRY" => 3,
98
83
  "BUNDLE_TIMEOUT" => 10,
99
84
  "BUNDLE_VERSION" => "lockfile",
85
+ "BUNDLE_LOCKFILE_CHECKSUMS" => true,
86
+ "BUNDLE_CACHE_ALL" => true,
87
+ "BUNDLE_PLUGINS" => true,
88
+ "BUNDLE_GLOBAL_GEM_CACHE" => false,
89
+ "BUNDLE_UPDATE_REQUIRES_ALL_FLAG" => false,
100
90
  }.freeze
101
91
 
102
92
  def initialize(root = nil)
@@ -128,12 +118,8 @@ module Bundler
128
118
  end
129
119
 
130
120
  def set_command_option(key, value)
131
- if !is_remembered(key) || Bundler.feature_flag.forget_cli_options?
132
- temporary(key => value)
133
- value
134
- else
135
- set_local(key, value)
136
- end
121
+ temporary(key => value)
122
+ value
137
123
  end
138
124
 
139
125
  def set_command_option_if_given(key, value)
@@ -387,10 +373,6 @@ module Bundler
387
373
  ARRAY_KEYS.include?(self.class.key_to_s(key))
388
374
  end
389
375
 
390
- def is_remembered(key)
391
- REMEMBERED_KEYS.include?(self.class.key_to_s(key))
392
- end
393
-
394
376
  def is_credential(key)
395
377
  key == "gem.push_key"
396
378
  end
@@ -4,8 +4,6 @@ require_relative "version"
4
4
  require_relative "rubygems_integration"
5
5
  require_relative "current_ruby"
6
6
 
7
- autoload :Pathname, "pathname"
8
-
9
7
  module Bundler
10
8
  autoload :WINDOWS, File.expand_path("constants", __dir__)
11
9
  autoload :FREEBSD, File.expand_path("constants", __dir__)
@@ -25,6 +23,9 @@ module Bundler
25
23
  end
26
24
 
27
25
  def default_lockfile
26
+ given = ENV["BUNDLE_LOCKFILE"]
27
+ return Pathname.new(given) if given && !given.empty?
28
+
28
29
  gemfile = default_gemfile
29
30
 
30
31
  case gemfile.basename.to_s
@@ -57,7 +58,7 @@ module Bundler
57
58
 
58
59
  def pwd
59
60
  Bundler.rubygems.ext_lock.synchronize do
60
- Pathname.pwd
61
+ Dir.pwd
61
62
  end
62
63
  end
63
64
 
@@ -125,27 +126,17 @@ module Bundler
125
126
  raise GenericSystemCallError.new(e, "There was an error #{[:create, :write].include?(action) ? "creating" : "accessing"} `#{path}`.")
126
127
  end
127
128
 
128
- def major_deprecation(major_version, message, removed_message: nil, print_caller_location: false)
129
- if print_caller_location
130
- caller_location = caller_locations(2, 2).first
131
- suffix = " (called at #{caller_location.path}:#{caller_location.lineno})"
132
- message += suffix
133
- removed_message += suffix if removed_message
134
- end
135
-
136
- require_relative "../bundler"
137
-
138
- feature_flag = Bundler.feature_flag
129
+ def feature_deprecated!(message)
130
+ return unless prints_major_deprecations?
139
131
 
140
- if feature_flag.removed_major?(major_version)
141
- require_relative "errors"
142
- raise DeprecatedError, "[REMOVED] #{removed_message || message}"
143
- end
144
-
145
- return unless feature_flag.deprecated_major?(major_version) && prints_major_deprecations?
146
132
  Bundler.ui.warn("[DEPRECATED] #{message}")
147
133
  end
148
134
 
135
+ def feature_removed!(message)
136
+ require_relative "errors"
137
+ raise RemovedError, "[REMOVED] #{message}"
138
+ end
139
+
149
140
  def print_major_deprecations!
150
141
  multiple_gemfiles = search_up(".") do |dir|
151
142
  gemfiles = gemfile_names.select {|gf| File.file? File.expand_path(gf, dir) }
@@ -309,6 +300,7 @@ module Bundler
309
300
  def set_bundle_variables
310
301
  Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", bundle_bin_path
311
302
  Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", find_gemfile.to_s
303
+ Bundler::SharedHelpers.set_env "BUNDLE_LOCKFILE", default_lockfile.to_s
312
304
  Bundler::SharedHelpers.set_env "BUNDLER_VERSION", Bundler::VERSION
313
305
  Bundler::SharedHelpers.set_env "BUNDLER_SETUP", File.expand_path("setup", __dir__)
314
306
  end
@@ -16,7 +16,7 @@ module Bundler
16
16
  def initialize(command)
17
17
  msg = String.new
18
18
  msg << "Bundler is trying to run `#{command}` at runtime. You probably need to run `bundle install`. However, "
19
- msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md "
19
+ msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/ruby/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md "
20
20
  msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
21
21
  super msg
22
22
  end
@@ -121,7 +121,7 @@ module Bundler
121
121
  FileUtils.rm_rf(p)
122
122
  end
123
123
  git "clone", "--no-checkout", "--quiet", path.to_s, destination.to_s
124
- File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination)
124
+ File.chmod((File.stat(destination).mode | 0o777) & ~File.umask, destination)
125
125
  rescue Errno::EEXIST => e
126
126
  file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1]
127
127
  raise GitError, "Bundler could not install a gem because it needs to " \
@@ -408,11 +408,7 @@ module Bundler
408
408
  def capture3_args_for(cmd, dir)
409
409
  return ["git", *cmd] unless dir
410
410
 
411
- if Bundler.feature_flag.bundler_4_mode? || supports_minus_c?
412
- ["git", "-C", dir.to_s, *cmd]
413
- else
414
- ["git", *cmd, { chdir: dir.to_s }]
415
- end
411
+ ["git", "-C", dir.to_s, *cmd]
416
412
  end
417
413
 
418
414
  def extra_clone_args
@@ -451,10 +447,6 @@ module Bundler
451
447
  depth.nil?
452
448
  end
453
449
 
454
- def supports_minus_c?
455
- @supports_minus_c ||= Gem::Version.new(version) >= Gem::Version.new("1.8.5")
456
- end
457
-
458
450
  def needs_allow_any_sha1_in_want?
459
451
  @needs_allow_any_sha1_in_want ||= Gem::Version.new(version) <= Gem::Version.new("2.13.7")
460
452
  end
@@ -238,7 +238,7 @@ module Bundler
238
238
  # across different projects, this cache will be shared.
239
239
  # When using local git repos, this is set to the local repo.
240
240
  def cache_path
241
- @cache_path ||= if Bundler.feature_flag.global_gem_cache?
241
+ @cache_path ||= if Bundler.settings[:global_gem_cache]
242
242
  Bundler.user_cache
243
243
  else
244
244
  Bundler.bundle_path.join("cache", "bundler")
@@ -268,7 +268,7 @@ module Bundler
268
268
  private
269
269
 
270
270
  def cache_to(custom_path, try_migrate: false)
271
- return unless Bundler.feature_flag.cache_all?
271
+ return unless Bundler.settings[:cache_all]
272
272
 
273
273
  app_cache_path = app_cache_path(custom_path)
274
274
 
@@ -416,7 +416,6 @@ module Bundler
416
416
  def fetch
417
417
  git_proxy.checkout
418
418
  rescue GitError => e
419
- raise unless Bundler.feature_flag.allow_offline_install?
420
419
  Bundler.ui.warn "Using cached git data because of network errors:\n#{e}"
421
420
  end
422
421
 
@@ -24,7 +24,7 @@ module Bundler
24
24
  @path = Pathname.new(options["path"])
25
25
  expanded_path = expand(@path)
26
26
  @path = if @path.relative?
27
- expanded_path.relative_path_from(root_path.expand_path)
27
+ expanded_path.relative_path_from(File.expand_path(root_path))
28
28
  else
29
29
  expanded_path
30
30
  end
@@ -83,7 +83,7 @@ module Bundler
83
83
 
84
84
  def cache(spec, custom_path = nil)
85
85
  app_cache_path = app_cache_path(custom_path)
86
- return unless Bundler.feature_flag.cache_all?
86
+ return unless Bundler.settings[:cache_all]
87
87
  return if expand(@original_path).to_s.index(root_path.to_s + "/") == 0
88
88
 
89
89
  unless @original_path.exist?
@@ -126,11 +126,7 @@ module Bundler
126
126
  end
127
127
 
128
128
  def expand(somepath)
129
- if Bundler.current_ruby.jruby? # TODO: Unify when https://github.com/rubygems/bundler/issues/7598 fixed upstream and all supported jrubies include the fix
130
- somepath.expand_path(root_path).expand_path
131
- else
132
- somepath.expand_path(root_path)
133
- end
129
+ somepath.expand_path(root_path)
134
130
  rescue ArgumentError => e
135
131
  Bundler.ui.debug(e)
136
132
  raise PathError, "There was an error while trying to use the path " \
@@ -8,7 +8,7 @@ module Bundler
8
8
  autoload :Remote, File.expand_path("rubygems/remote", __dir__)
9
9
 
10
10
  # Ask for X gems per API request
11
- API_REQUEST_SIZE = 50
11
+ API_REQUEST_SIZE = 100
12
12
 
13
13
  attr_accessor :remotes
14
14
 
@@ -168,12 +168,6 @@ module Bundler
168
168
  return nil # no post-install message
169
169
  end
170
170
 
171
- if spec.remote
172
- # Check for this spec from other sources
173
- uris = [spec.remote, *remotes_for_spec(spec)].map(&:anonymized_uri).uniq
174
- Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
175
- end
176
-
177
171
  path = fetch_gem_if_possible(spec, options[:previous_spec])
178
172
  raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
179
173
 
@@ -217,7 +211,11 @@ module Bundler
217
211
  message += " with native extensions" if spec.extensions.any?
218
212
  Bundler.ui.confirm message
219
213
 
220
- installed_spec = installer.install
214
+ installed_spec = nil
215
+
216
+ Gem.time("Installed #{spec.name} in", 0, true) do
217
+ installed_spec = installer.install
218
+ end
221
219
 
222
220
  spec.full_gem_path = installed_spec.full_gem_path
223
221
  spec.loaded_from = installed_spec.loaded_from
@@ -332,13 +330,6 @@ module Bundler
332
330
  remotes.map(&method(:remove_auth))
333
331
  end
334
332
 
335
- def remotes_for_spec(spec)
336
- specs.search_all(spec.name).inject([]) do |uris, s|
337
- uris << s.remote if s.remote
338
- uris
339
- end
340
- end
341
-
342
333
  def cached_gem(spec)
343
334
  global_cache_path = download_cache_path(spec)
344
335
  caches << global_cache_path if global_cache_path
@@ -491,7 +482,10 @@ module Bundler
491
482
  uri = spec.remote.uri
492
483
  Bundler.ui.confirm("Fetching #{version_message(spec, previous_spec)}")
493
484
  gem_remote_fetcher = remote_fetchers.fetch(spec.remote).gem_remote_fetcher
494
- Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher)
485
+
486
+ Gem.time("Downloaded #{spec.name} in", 0, true) do
487
+ Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher)
488
+ end
495
489
  end
496
490
 
497
491
  # Returns the global cache path of the calling Rubygems::Source object.
@@ -506,7 +500,7 @@ module Bundler
506
500
  # @return [Pathname] The global cache path.
507
501
  #
508
502
  def download_cache_path(spec)
509
- return unless Bundler.feature_flag.global_gem_cache?
503
+ return unless Bundler.settings[:global_gem_cache]
510
504
  return unless remote = spec.remote
511
505
  return unless cache_slug = remote.cache_slug
512
506
 
@@ -79,7 +79,7 @@ module Bundler
79
79
  end
80
80
 
81
81
  def extension_cache_path(spec)
82
- return unless Bundler.feature_flag.global_gem_cache?
82
+ return unless Bundler.settings[:global_gem_cache]
83
83
  return unless source_slug = extension_cache_slug(spec)
84
84
  Bundler.user_cache.join(
85
85
  "extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,