rubygems-update 3.4.0 → 3.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/bundler/CHANGELOG.md +21 -0
  4. data/bundler/exe/bundle +1 -1
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  7. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  8. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  9. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  10. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  11. data/bundler/lib/bundler/man/bundle-config.1 +2 -2
  12. data/bundler/lib/bundler/man/bundle-config.1.ronn +1 -1
  13. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  14. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  15. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  16. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  17. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  18. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  19. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  20. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  21. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle.1 +1 -1
  35. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  36. data/bundler/lib/bundler/resolver.rb +10 -1
  37. data/bundler/lib/bundler/source/git/git_proxy.rb +17 -14
  38. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +4 -0
  39. data/bundler/lib/bundler/version.rb +1 -1
  40. data/lib/rubygems/command.rb +5 -1
  41. data/lib/rubygems/command_manager.rb +17 -4
  42. data/lib/rubygems/commands/build_command.rb +3 -0
  43. data/lib/rubygems.rb +1 -1
  44. data/rubygems-update.gemspec +1 -1
  45. data/test/rubygems/test_gem_command_manager.rb +40 -0
  46. data/test/rubygems/test_gem_commands_build_command.rb +10 -0
  47. data/test/rubygems/test_gem_installer.rb +1 -1
  48. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: defa5f3855c57554726a4a03c00cffbe64a1ba06e3c4c95f9f9841c5bc7317bd
4
- data.tar.gz: 242f793a3af341087dabd3a38fba0271b56a89c01c912b5f35246e5356982956
3
+ metadata.gz: 315bca7b295e6cfebcf797ed7c5a990d67ad9c5cc34bf31be185ce9619225c52
4
+ data.tar.gz: 0dc3d94e2489d5baba85309a61ce9701de37c0f164b8601892b69b3af287f7c1
5
5
  SHA512:
6
- metadata.gz: 27c0065f1c65feb271ad19465d846e67d70781be9e34511c4e5c394f767a83f1bd2b05c76b93101f7f3dcfcc00ee8c8c8e45ae33b36184e65430a1382f2d508f
7
- data.tar.gz: 45b3105bbef280a6203a7d852e7cf53b501669833b053b5a747b898a6740fd82a7cb40cd55e643509b316bae89e6b90cb27a371aa68aba2d6c505e183694629c
6
+ metadata.gz: b8ac8e366afdd66d7ffe5813bfd43c3f3e7502cc0ece3c6a848c7eae2614fedac9e8f9a82a232ef5f37bdeb3a3010785febf4286a5de2d46fd2fdd0eba897dae
7
+ data.tar.gz: ddb4c87e1c284243814bab308356a00ddc42e0818078c5abd467d18cd183d3bbc89414e7b1053184427a832d59ef67b70512e845870cc4bd4a19178a624f46c4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # 3.4.2 / 2023-01-01
2
+
3
+ ## Enhancements:
4
+
5
+ * Add global flag (`-C`) to change execution directory. Pull request #6180
6
+ by gustavothecoder
7
+ * Installs bundler 2.4.2 as a default gem.
8
+
9
+ # 3.4.1 / 2022-12-24
10
+
11
+ ## Enhancements:
12
+
13
+ * Installs bundler 2.4.1 as a default gem.
14
+
1
15
  # 3.4.0 / 2022-12-24
2
16
 
3
17
  ## Breaking changes:
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # 2.4.2 (January 1, 2023)
2
+
3
+ ## Performance:
4
+
5
+ - Speed up resolution by properly merging incompatibility ranges [#6215](https://github.com/rubygems/rubygems/pull/6215)
6
+
7
+ ## Documentation:
8
+
9
+ - Remove stray word in `bundle config` man page [#6220](https://github.com/rubygems/rubygems/pull/6220)
10
+
11
+ # 2.4.1 (December 24, 2022)
12
+
13
+ ## Enhancements:
14
+
15
+ - Allow Bundler to run on old RubyGems + Ruby 2.7 without warnings [#6187](https://github.com/rubygems/rubygems/pull/6187)
16
+
17
+ ## Bug fixes:
18
+
19
+ - Fix dependencies scoped to other platforms making resolver fail [#6189](https://github.com/rubygems/rubygems/pull/6189)
20
+ - Restore annotated git tag support [#6186](https://github.com/rubygems/rubygems/pull/6186)
21
+
1
22
  # 2.4.0 (December 24, 2022)
2
23
 
3
24
  ## Security:
data/bundler/exe/bundle CHANGED
@@ -15,7 +15,7 @@ else
15
15
  require "bundler"
16
16
  end
17
17
 
18
- if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("3.0.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
18
+ if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
19
19
  Bundler.ui.warn \
20
20
  "Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
21
21
  "`required_ruby_version` from working for Bundler. Any scripts that use " \
@@ -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 = "2022-12-24".freeze
8
- @git_commit_sha = "e67004d0fe".freeze
7
+ @built_at = "2023-01-01".freeze
8
+ @git_commit_sha = "2cd3ed45bf".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -39,7 +39,7 @@ Bundler default config
39
39
  .IP "" 0
40
40
  .
41
41
  .P
42
- Executing \fBbundle config list\fR with will print a list of all bundler configuration for the current bundle, and where that configuration was set\.
42
+ Executing \fBbundle config list\fR will print a list of all bundler configuration for the current bundle, and where that configuration was set\.
43
43
  .
44
44
  .P
45
45
  Executing \fBbundle config get <name>\fR will print the value of that configuration setting, and where it was set\.
@@ -19,7 +19,7 @@ Bundler loads configuration settings in this order:
19
19
  3. Global config (`~/.bundle/config`)
20
20
  4. Bundler default config
21
21
 
22
- Executing `bundle config list` with will print a list of all bundler
22
+ Executing `bundle config list` will print a list of all bundler
23
23
  configuration for the current bundle, and where that configuration
24
24
  was set.
25
25
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONSOLE" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-CONSOLE" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-EXEC" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-GEM" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-HELP" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-HELP" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INFO" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INIT" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INJECT" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INSTALL" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LIST" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LOCK" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OPEN" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OUTDATED" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLATFORM" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLUGIN" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-PLUGIN" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-plugin\fR \- Manage Bundler plugins
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PRISTINE" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VERSION" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-VERSION" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-version\fR \- Prints Bundler version information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "December 2022" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "December 2022" "" ""
4
+ .TH "BUNDLE" "1" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "December 2022" "" ""
4
+ .TH "GEMFILE" "5" "January 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -311,7 +311,16 @@ module Bundler
311
311
  def prepare_dependencies(requirements, packages)
312
312
  to_dependency_hash(requirements, packages).map do |dep_package, dep_constraint|
313
313
  name = dep_package.name
314
- next if dep_package.platforms.empty?
314
+
315
+ # If a dependency is scoped to a platform different from the current
316
+ # one, we ignore it. However, it may reappear during resolution as a
317
+ # transitive dependency of another package, so we need to reset the
318
+ # package so the proper versions are considered if reintroduced later.
319
+ if dep_package.platforms.empty?
320
+ @packages.delete(name)
321
+ next
322
+ end
323
+
315
324
  next [dep_package, dep_constraint] if name == "bundler"
316
325
  next [dep_package, dep_constraint] unless versions_for(dep_package, dep_constraint.range).empty?
317
326
  next unless dep_package.current_platform?
@@ -58,6 +58,7 @@ module Bundler
58
58
  @explicit_ref = branch || tag || ref
59
59
  @revision = revision
60
60
  @git = git
61
+ @commit_ref = nil
61
62
  end
62
63
 
63
64
  def revision
@@ -116,7 +117,7 @@ module Bundler
116
117
  end
117
118
  end
118
119
 
119
- git "fetch", "--force", "--quiet", *extra_fetch_args, :dir => destination
120
+ git "fetch", "--force", "--quiet", *extra_fetch_args, :dir => destination if @commit_ref
120
121
 
121
122
  git "reset", "--hard", @revision, :dir => destination
122
123
 
@@ -185,11 +186,16 @@ module Bundler
185
186
  end
186
187
 
187
188
  def refspec
188
- return ref if pinned_to_full_sha?
189
+ commit = pinned_to_full_sha? ? ref : @revision
189
190
 
190
- ref_to_fetch = @revision || fully_qualified_ref
191
+ if commit
192
+ @commit_ref = "refs/#{commit}-sha"
193
+ return "#{commit}:#{@commit_ref}"
194
+ end
195
+
196
+ reference = fully_qualified_ref
191
197
 
192
- ref_to_fetch ||= if ref.include?("~")
198
+ reference ||= if ref.include?("~")
193
199
  ref.split("~").first
194
200
  elsif ref.start_with?("refs/")
195
201
  ref
@@ -197,7 +203,7 @@ module Bundler
197
203
  "refs/*"
198
204
  end
199
205
 
200
- "#{ref_to_fetch}:#{ref_to_fetch}"
206
+ "#{reference}:#{reference}"
201
207
  end
202
208
 
203
209
  def fully_qualified_ref
@@ -218,10 +224,6 @@ module Bundler
218
224
  ref =~ /\A\h{40}\z/
219
225
  end
220
226
 
221
- def legacy_locked_revision?
222
- !@revision.nil? && @revision =~ /\A\h{7}\z/
223
- end
224
-
225
227
  def git_null(*command, dir: nil)
226
228
  check_allowed(command)
227
229
 
@@ -241,9 +243,9 @@ module Bundler
241
243
 
242
244
  out, err, status = capture(command, dir)
243
245
 
244
- Bundler.ui.warn err unless err.empty?
246
+ raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, err) unless status.success?
245
247
 
246
- raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, out) unless status.success?
248
+ Bundler.ui.warn err unless err.empty?
247
249
 
248
250
  out
249
251
  end
@@ -344,9 +346,10 @@ module Bundler
344
346
  end
345
347
 
346
348
  def extra_clone_args
347
- return [] if full_clone?
349
+ args = depth_args
350
+ return [] if args.empty?
348
351
 
349
- args = ["--depth", depth.to_s, "--single-branch"]
352
+ args += ["--single-branch"]
350
353
  args.unshift("--no-tags") if supports_cloning_with_no_tags?
351
354
 
352
355
  args += ["--branch", branch || tag] if branch || tag
@@ -361,7 +364,7 @@ module Bundler
361
364
 
362
365
  def extra_fetch_args
363
366
  extra_args = [path.to_s, *depth_args]
364
- extra_args.push(revision) unless legacy_locked_revision?
367
+ extra_args.push(@commit_ref)
365
368
  extra_args
366
369
  end
367
370
 
@@ -20,6 +20,10 @@ module Bundler::PubGrub
20
20
  range.eql?(other.range)
21
21
  end
22
22
 
23
+ def ==(other)
24
+ package == other.package && range == other.range
25
+ end
26
+
23
27
  class << self
24
28
  def exact(package, version)
25
29
  range = VersionRange.new(min: version, max: version, include_min: true, include_max: true)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.0".freeze
4
+ VERSION = "2.4.2".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -630,7 +630,11 @@ RubyGems is a package manager for Ruby.
630
630
  Usage:
631
631
  gem -h/--help
632
632
  gem -v/--version
633
- gem command [arguments...] [options...]
633
+ gem [global options...] command [arguments...] [options...]
634
+
635
+ Global options:
636
+ -C PATH run as if gem was started in <PATH>
637
+ instead of the current working directory
634
638
 
635
639
  Examples:
636
640
  gem install rake
@@ -175,14 +175,20 @@ class Gem::CommandManager
175
175
  when "-v", "--version" then
176
176
  say Gem::VERSION
177
177
  terminate_interaction 0
178
+ when "-C" then
179
+ args.shift
180
+ start_point = args.shift
181
+ if Dir.exist?(start_point)
182
+ Dir.chdir(start_point) { invoke_command(args, build_args) }
183
+ else
184
+ alert_error clean_text("#{start_point} isn't a directory.")
185
+ terminate_interaction 1
186
+ end
178
187
  when /^-/ then
179
188
  alert_error clean_text("Invalid option: #{args.first}. See 'gem --help'.")
180
189
  terminate_interaction 1
181
190
  else
182
- cmd_name = args.shift.downcase
183
- cmd = find_command cmd_name
184
- cmd.deprecation_warning if cmd.deprecated?
185
- cmd.invoke_with_build_args args, build_args
191
+ invoke_command(args, build_args)
186
192
  end
187
193
  end
188
194
 
@@ -237,4 +243,11 @@ class Gem::CommandManager
237
243
  ui.backtrace e
238
244
  end
239
245
  end
246
+
247
+ def invoke_command(args, build_args)
248
+ cmd_name = args.shift.downcase
249
+ cmd = find_command cmd_name
250
+ cmd.deprecation_warning if cmd.deprecated?
251
+ cmd.invoke_with_build_args args, build_args
252
+ end
240
253
  end
@@ -26,6 +26,9 @@ class Gem::Commands::BuildCommand < Gem::Command
26
26
  add_option "-C PATH", "Run as if gem build was started in <PATH> instead of the current working directory." do |value, options|
27
27
  options[:build_path] = value
28
28
  end
29
+ deprecate_option "-C",
30
+ version: "4.0",
31
+ extra_msg: "-C is a global flag now. Use `gem -C PATH build GEMSPEC_FILE [options]` instead"
29
32
  end
30
33
 
31
34
  def arguments # :nodoc:
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require "rbconfig"
9
9
 
10
10
  module Gem
11
- VERSION = "3.4.0".freeze
11
+ VERSION = "3.4.2".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.4.0"
5
+ s.version = "3.4.2"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
@@ -126,6 +126,46 @@ class TestGemCommandManager < Gem::TestCase
126
126
  @command_manager.unregister_command :crash
127
127
  end
128
128
 
129
+ def test_process_args_with_c_flag
130
+ custom_start_point = File.join @tempdir, "nice_folder"
131
+ FileUtils.mkdir_p custom_start_point
132
+
133
+ execution_path = nil
134
+ use_ui @ui do
135
+ @command_manager[:install].when_invoked do
136
+ execution_path = Dir.pwd
137
+ true
138
+ end
139
+ @command_manager.process_args %W[-C #{custom_start_point} install net-scp-4.0.0.gem --local]
140
+ end
141
+
142
+ assert_equal custom_start_point, execution_path
143
+ end
144
+
145
+ def test_process_args_with_c_flag_without_path
146
+ use_ui @ui do
147
+ assert_raise Gem::MockGemUi::TermError do
148
+ @command_manager.process_args %w[-C install net-scp-4.0.0.gem --local]
149
+ end
150
+ end
151
+
152
+ assert_match(/install isn't a directory./i, @ui.error)
153
+ end
154
+
155
+ def test_process_args_with_c_flag_path_not_found
156
+ custom_start_point = File.join @tempdir, "nice_folder"
157
+ FileUtils.mkdir_p custom_start_point
158
+ custom_start_point.tr!("_", "-")
159
+
160
+ use_ui @ui do
161
+ assert_raise Gem::MockGemUi::TermError do
162
+ @command_manager.process_args %W[-C #{custom_start_point} install net-scp-4.0.0.gem --local]
163
+ end
164
+ end
165
+
166
+ assert_match(/#{custom_start_point} isn't a directory./i, @ui.error)
167
+ end
168
+
129
169
  def test_process_args_bad_arg
130
170
  use_ui @ui do
131
171
  assert_raise Gem::MockGemUi::TermError do
@@ -41,6 +41,16 @@ class TestGemCommandsBuildCommand < Gem::TestCase
41
41
  assert_includes Gem.platforms, Gem::Platform.local
42
42
  end
43
43
 
44
+ def test_handle_deprecated_options
45
+ use_ui @ui do
46
+ @cmd.handle_options %w[-C ./test/dir]
47
+ end
48
+
49
+ assert_equal "WARNING: The \"-C\" option has been deprecated and will be removed in Rubygems 4.0. " \
50
+ "-C is a global flag now. Use `gem -C PATH build GEMSPEC_FILE [options]` instead\n",
51
+ @ui.error
52
+ end
53
+
44
54
  def test_options_filename
45
55
  gemspec_file = File.join(@tempdir, @gem.spec_name)
46
56
 
@@ -1828,7 +1828,7 @@ gem 'other', version
1828
1828
 
1829
1829
  installer = Gem::Installer.at(
1830
1830
  gem_with_ill_formated_platform,
1831
- :install_dir => @gem_home,
1831
+ :install_dir => @gemhome,
1832
1832
  :user_install => false,
1833
1833
  :force => true
1834
1834
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2022-12-24 00:00:00.000000000 Z
19
+ date: 2023-01-01 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality
@@ -834,7 +834,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
834
834
  - !ruby/object:Gem::Version
835
835
  version: '0'
836
836
  requirements: []
837
- rubygems_version: 3.4.0
837
+ rubygems_version: 3.4.2
838
838
  signing_key:
839
839
  specification_version: 4
840
840
  summary: RubyGems is a package management framework for Ruby.