rubygems-update 3.4.6 → 3.4.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +77 -1
  3. data/Manifest.txt +3 -1
  4. data/POLICIES.md +5 -5
  5. data/README.md +17 -4
  6. data/bundler/CHANGELOG.md +74 -0
  7. data/bundler/README.md +1 -4
  8. data/bundler/lib/bundler/build_metadata.rb +2 -2
  9. data/bundler/lib/bundler/cli/init.rb +2 -2
  10. data/bundler/lib/bundler/cli.rb +1 -0
  11. data/bundler/lib/bundler/current_ruby.rb +2 -0
  12. data/bundler/lib/bundler/definition.rb +5 -1
  13. data/bundler/lib/bundler/dependency.rb +1 -1
  14. data/bundler/lib/bundler/endpoint_specification.rb +0 -4
  15. data/bundler/lib/bundler/environment_preserver.rb +2 -2
  16. data/bundler/lib/bundler/fetcher/dependency.rb +1 -5
  17. data/bundler/lib/bundler/fetcher.rb +2 -2
  18. data/bundler/lib/bundler/index.rb +2 -2
  19. data/bundler/lib/bundler/injector.rb +1 -1
  20. data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
  21. data/bundler/lib/bundler/installer/standalone.rb +1 -1
  22. data/bundler/lib/bundler/lazy_specification.rb +4 -8
  23. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  24. data/bundler/lib/bundler/lockfile_parser.rb +11 -11
  25. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-init.1 +5 -1
  38. data/bundler/lib/bundler/man/bundle-init.1.ronn +2 -0
  39. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle.1 +1 -1
  54. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  55. data/bundler/lib/bundler/plugin/installer.rb +5 -2
  56. data/bundler/lib/bundler/plugin.rb +1 -1
  57. data/bundler/lib/bundler/remote_specification.rb +2 -6
  58. data/bundler/lib/bundler/resolver/base.rb +36 -4
  59. data/bundler/lib/bundler/resolver.rb +6 -9
  60. data/bundler/lib/bundler/rubygems_integration.rb +1 -1
  61. data/bundler/lib/bundler/settings.rb +1 -1
  62. data/bundler/lib/bundler/setup.rb +4 -1
  63. data/bundler/lib/bundler/shared_helpers.rb +1 -1
  64. data/bundler/lib/bundler/source/git/git_proxy.rb +27 -8
  65. data/bundler/lib/bundler/source/git.rb +2 -1
  66. data/bundler/lib/bundler/source/path.rb +1 -1
  67. data/bundler/lib/bundler/source/rubygems.rb +1 -2
  68. data/bundler/lib/bundler/spec_set.rb +13 -3
  69. data/bundler/lib/bundler/templates/Executable.bundler +1 -1
  70. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -1
  71. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +10 -0
  72. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +1 -1
  73. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  74. data/bundler/lib/bundler/uri_normalizer.rb +23 -0
  75. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +6 -7
  76. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +8 -1
  77. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +5 -4
  78. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +4 -2
  79. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +4 -1
  80. data/bundler/lib/bundler/version.rb +1 -1
  81. data/bundler/lib/bundler.rb +10 -9
  82. data/lib/rubygems/bundler_version_finder.rb +1 -1
  83. data/lib/rubygems/command.rb +10 -6
  84. data/lib/rubygems/command_manager.rb +1 -0
  85. data/lib/rubygems/commands/exec_command.rb +248 -0
  86. data/lib/rubygems/commands/help_command.rb +3 -3
  87. data/lib/rubygems/commands/pristine_command.rb +9 -0
  88. data/lib/rubygems/commands/uninstall_command.rb +3 -0
  89. data/lib/rubygems/core_ext/kernel_require.rb +0 -10
  90. data/lib/rubygems/defaults.rb +2 -2
  91. data/lib/rubygems/dependency.rb +1 -1
  92. data/lib/rubygems/deprecate.rb +2 -2
  93. data/lib/rubygems/ext/builder.rb +17 -0
  94. data/lib/rubygems/ext/ext_conf_builder.rb +1 -2
  95. data/lib/rubygems/ext/rake_builder.rb +1 -1
  96. data/lib/rubygems/package/tar_header.rb +1 -1
  97. data/lib/rubygems/package/tar_reader/entry.rb +88 -7
  98. data/lib/rubygems/package/tar_reader.rb +0 -28
  99. data/lib/rubygems/platform.rb +2 -2
  100. data/lib/rubygems/request_set/gem_dependency_api.rb +0 -1
  101. data/lib/rubygems/requirement.rb +1 -1
  102. data/lib/rubygems/resolver/stats.rb +1 -1
  103. data/lib/rubygems/source/git.rb +1 -1
  104. data/lib/rubygems/specification.rb +9 -1
  105. data/lib/rubygems/specification_policy.rb +5 -0
  106. data/lib/rubygems/stub_specification.rb +7 -7
  107. data/lib/rubygems/text.rb +1 -1
  108. data/lib/rubygems/util/licenses.rb +2 -2
  109. data/lib/rubygems/version.rb +2 -2
  110. data/lib/rubygems.rb +3 -3
  111. data/rubygems-update.gemspec +1 -1
  112. data/test/rubygems/helper.rb +2 -3
  113. data/test/rubygems/package/tar_test_case.rb +50 -15
  114. data/test/rubygems/simple_gem.rb +1 -1
  115. data/test/rubygems/test_gem.rb +29 -0
  116. data/test/rubygems/test_gem_bundler_version_finder.rb +2 -2
  117. data/test/rubygems/test_gem_command_manager.rb +25 -0
  118. data/test/rubygems/test_gem_commands_exec_command.rb +851 -0
  119. data/test/rubygems/test_gem_commands_install_command.rb +1 -1
  120. data/test/rubygems/test_gem_commands_pristine_command.rb +48 -0
  121. data/test/rubygems/test_gem_commands_setup_command.rb +1 -1
  122. data/test/rubygems/test_gem_commands_uninstall_command.rb +31 -14
  123. data/test/rubygems/test_gem_ext_builder.rb +3 -5
  124. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +20 -6
  125. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  126. data/test/rubygems/test_gem_ext_cargo_builder.rb +1 -1
  127. data/test/rubygems/test_gem_gem_runner.rb +6 -1
  128. data/test/rubygems/test_gem_package.rb +0 -25
  129. data/test/rubygems/test_gem_package_tar_reader.rb +48 -1
  130. data/test/rubygems/test_gem_package_tar_reader_entry.rb +151 -6
  131. data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
  132. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +10 -10
  133. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +2 -2
  134. data/test/rubygems/test_gem_resolver_git_set.rb +9 -9
  135. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
  136. data/test/rubygems/test_gem_source.rb +1 -1
  137. data/test/rubygems/test_gem_source_git.rb +13 -12
  138. data/test/rubygems/test_gem_source_installed.rb +1 -1
  139. data/test/rubygems/test_gem_source_lock.rb +3 -3
  140. data/test/rubygems/test_gem_source_vendor.rb +1 -1
  141. data/test/rubygems/test_gem_specification.rb +36 -2
  142. data/test/rubygems/test_gem_version.rb +2 -2
  143. data/test/rubygems/test_kernel.rb +0 -8
  144. metadata +6 -4
  145. data/bundler/lib/bundler/templates/gems.rb +0 -5
@@ -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" "January 2023" "" ""
4
+ .TH "BUNDLE\-CONSOLE" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-HELP" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "February 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -18,6 +18,10 @@ Init generates a default [\fBGemfile(5)\fR][Gemfile(5)] in the current working d
18
18
  \fB\-\-gemspec\fR
19
19
  Use the specified \.gemspec to create the [\fBGemfile(5)\fR][Gemfile(5)]
20
20
  .
21
+ .TP
22
+ \fB\-\-gemfile\fR
23
+ Use the specified name for the gemfile instead of \fBGemfile\fR
24
+ .
21
25
  .SH "FILES"
22
26
  Included in the default [\fBGemfile(5)\fR][Gemfile(5)] generated is the line \fB# frozen_string_literal: true\fR\. This is a magic comment supported for the first time in Ruby 2\.3\. The presence of this line results in all string literals in the file being implicitly frozen\.
23
27
  .
@@ -16,6 +16,8 @@ created [`Gemfile(5)`][Gemfile(5)].
16
16
 
17
17
  * `--gemspec`:
18
18
  Use the specified .gemspec to create the [`Gemfile(5)`][Gemfile(5)]
19
+ * `--gemfile`:
20
+ Use the specified name for the gemfile instead of `Gemfile`
19
21
 
20
22
  ## FILES
21
23
 
@@ -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" "January 2023" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-PLUGIN" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-VERSION" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "February 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" "January 2023" "" ""
4
+ .TH "BUNDLE" "1" "February 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" "January 2023" "" ""
4
+ .TH "GEMFILE" "5" "February 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -83,8 +83,11 @@ module Bundler
83
83
 
84
84
  Bundler.configure_gem_home_and_path(Plugin.root)
85
85
 
86
- definition = Definition.new(nil, deps, source_list, true)
87
- install_definition(definition)
86
+ Bundler.settings.temporary(:deployment => false, :frozen => false) do
87
+ definition = Definition.new(nil, deps, source_list, true)
88
+
89
+ install_definition(definition)
90
+ end
88
91
  end
89
92
 
90
93
  # Installs the plugins and deps from the provided specs and returns map of
@@ -15,7 +15,7 @@ module Bundler
15
15
  class UnknownSourceError < PluginError; end
16
16
  class PluginInstallError < PluginError; end
17
17
 
18
- PLUGIN_FILE_NAME = "plugins.rb".freeze
18
+ PLUGIN_FILE_NAME = "plugins.rb"
19
19
 
20
20
  module_function
21
21
 
@@ -29,12 +29,8 @@ module Bundler
29
29
  @platform = _remote_specification.platform
30
30
  end
31
31
 
32
- def identifier
33
- @__identifier ||= [name, version, @platform.to_s]
34
- end
35
-
36
32
  def full_name
37
- if @platform == Gem::Platform::RUBY
33
+ @full_name ||= if @platform == Gem::Platform::RUBY
38
34
  "#{@name}-#{@version}"
39
35
  else
40
36
  "#{@name}-#{@version}-#{@platform}"
@@ -106,7 +102,7 @@ module Bundler
106
102
  def _remote_specification
107
103
  @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @original_platform])
108
104
  @_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \
109
- " missing from the server! Try installing with `--full-index` as a workaround.")
105
+ " missing from the server!")
110
106
  end
111
107
 
112
108
  def method_missing(method, *args, &blk)
@@ -49,10 +49,18 @@ module Bundler
49
49
  end
50
50
 
51
51
  def unlock_names(names)
52
- names.each do |name|
53
- @base.delete_by_name(name)
54
-
55
- @base_requirements.delete(name)
52
+ indirect_pins = indirect_pins(names)
53
+
54
+ if indirect_pins.any?
55
+ loosen_names(indirect_pins)
56
+ else
57
+ pins = pins(names)
58
+
59
+ if pins.any?
60
+ loosen_names(pins)
61
+ else
62
+ unrestrict_names(names)
63
+ end
56
64
  end
57
65
  end
58
66
 
@@ -64,6 +72,30 @@ module Bundler
64
72
 
65
73
  private
66
74
 
75
+ def indirect_pins(names)
76
+ names.select {|name| @base_requirements[name].exact? && @requirements.none? {|dep| dep.name == name } }
77
+ end
78
+
79
+ def pins(names)
80
+ names.select {|name| @base_requirements[name].exact? }
81
+ end
82
+
83
+ def loosen_names(names)
84
+ names.each do |name|
85
+ version = @base_requirements[name].requirements.first[1]
86
+
87
+ @base_requirements[name] = Gem::Requirement.new(">= #{version}")
88
+
89
+ @base.delete_by_name(name)
90
+ end
91
+ end
92
+
93
+ def unrestrict_names(names)
94
+ names.each do |name|
95
+ @base_requirements.delete(name)
96
+ end
97
+ end
98
+
67
99
  def build_base_requirements
68
100
  base_requirements = {}
69
101
  @base.each do |ls|
@@ -37,7 +37,9 @@ module Bundler
37
37
  root_version = Resolver::Candidate.new(0)
38
38
 
39
39
  @all_specs = Hash.new do |specs, name|
40
- specs[name] = source_for(name).specs.search(name).sort_by {|s| [s.version, s.platform.to_s] }
40
+ specs[name] = source_for(name).specs.search(name).reject do |s|
41
+ s.dependencies.any? {|d| d.name == name && !d.requirement.satisfied_by?(s.version) } # ignore versions that depend on themselves incorrectly
42
+ end.sort_by {|s| [s.version, s.platform.to_s] }
41
43
  end
42
44
 
43
45
  @sorted_versions = Hash.new do |candidates, package|
@@ -55,7 +57,7 @@ module Bundler
55
57
  { root_version => root_dependencies }
56
58
  else
57
59
  Hash.new do |versions, version|
58
- versions[version] = to_dependency_hash(version.dependencies, @packages)
60
+ versions[version] = to_dependency_hash(version.dependencies.reject {|d| d.name == package.name }, @packages)
59
61
  end
60
62
  end
61
63
  end
@@ -186,11 +188,6 @@ module Bundler
186
188
  package_deps = @cached_dependencies[package]
187
189
  sorted_versions = @sorted_versions[package]
188
190
  package_deps[version].map do |dep_package, dep_constraint|
189
- if package == dep_package
190
- cause = PubGrub::Incompatibility::CircularDependency.new(dep_package, dep_constraint.constraint_string)
191
- return [PubGrub::Incompatibility.new([PubGrub::Term.new(dep_constraint, true)], :cause => cause)]
192
- end
193
-
194
191
  low = high = sorted_versions.index(version)
195
192
 
196
193
  # find version low such that all >= low share the same dep
@@ -243,7 +240,7 @@ module Bundler
243
240
  ruby_specs = select_best_platform_match(specs, Gem::Platform::RUBY)
244
241
  groups << Resolver::Candidate.new(version, :specs => ruby_specs) if ruby_specs.any?
245
242
 
246
- next groups if platform_specs == ruby_specs
243
+ next groups if platform_specs == ruby_specs || package.force_ruby_platform?
247
244
 
248
245
  groups << Resolver::Candidate.new(version, :specs => platform_specs)
249
246
 
@@ -302,7 +299,7 @@ module Bundler
302
299
  end
303
300
 
304
301
  def filter_prereleases(specs, package)
305
- return specs unless package.ignores_prereleases?
302
+ return specs unless package.ignores_prereleases? && specs.size > 1
306
303
 
307
304
  specs.reject {|s| s.version.prerelease? }
308
305
  end
@@ -453,7 +453,7 @@ module Bundler
453
453
  fetcher = gem_remote_fetcher
454
454
  fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
455
455
  string = fetcher.fetch_path(path)
456
- Bundler.load_marshal(string)
456
+ Bundler.safe_load_marshal(string)
457
457
  rescue Gem::RemoteFetcher::FetchError
458
458
  # it's okay for prerelease to fail
459
459
  raise unless name == "prerelease_specs"
@@ -495,7 +495,7 @@ module Bundler
495
495
  uri = $2
496
496
  suffix = $3
497
497
  end
498
- uri = "#{uri}/" unless uri.end_with?("/")
498
+ uri = URINormalizer.normalize_suffix(uri)
499
499
  require_relative "vendored_uri"
500
500
  uri = Bundler::URI(uri)
501
501
  unless uri.absolute?
@@ -12,7 +12,10 @@ if Bundler::SharedHelpers.in_bundle?
12
12
  Bundler.ui.error e.message
13
13
  Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
14
14
  if e.is_a?(Bundler::GemNotFound)
15
- Bundler.ui.warn "Run `bundle install` to install missing gems."
15
+ suggested_cmd = "bundle install"
16
+ original_gemfile = Bundler.original_env["BUNDLE_GEMFILE"]
17
+ suggested_cmd += " --gemfile #{original_gemfile}" if original_gemfile
18
+ Bundler.ui.warn "Run `#{suggested_cmd}` to install missing gems."
16
19
  end
17
20
  exit e.status_code
18
21
  end
@@ -160,7 +160,7 @@ module Bundler
160
160
  " (was expecting #{old_deps.map(&:to_s)}, but the real spec has #{new_deps.map(&:to_s)})"
161
161
  raise APIResponseMismatchError,
162
162
  "Downloading #{spec.full_name} revealed dependencies not in the API or the lockfile (#{extra_deps.join(", ")})." \
163
- "\nEither installing with `--full-index` or running `bundle update #{spec.name}` should fix the problem."
163
+ "\nRunning `bundle update #{spec.name}` should fix the problem."
164
164
  end
165
165
 
166
166
  def pretty_dependency(dep)
@@ -28,8 +28,9 @@ module Bundler
28
28
  def initialize(command, path, extra_info = nil)
29
29
  @command = command
30
30
 
31
- msg = String.new
32
- msg << "Git error: command `#{command}` in directory #{path} has failed."
31
+ msg = String.new("Git error: command `#{command}`")
32
+ msg << " in directory #{path}" if path
33
+ msg << " has failed."
33
34
  msg << "\n#{extra_info}" if extra_info
34
35
  super msg
35
36
  end
@@ -139,8 +140,8 @@ module Bundler
139
140
  out, err, status = capture(command, path)
140
141
  return out if status.success?
141
142
 
142
- if err.include?("couldn't find remote ref")
143
- raise MissingGitRevisionError.new(command_with_no_credentials, path, explicit_ref, credential_filtered_uri)
143
+ if err.include?("couldn't find remote ref") || err.include?("not our ref")
144
+ raise MissingGitRevisionError.new(command_with_no_credentials, path, commit || explicit_ref, credential_filtered_uri)
144
145
  else
145
146
  raise GitCommandError.new(command_with_no_credentials, path, err)
146
147
  end
@@ -153,9 +154,20 @@ module Bundler
153
154
  SharedHelpers.filesystem_access(path.dirname) do |p|
154
155
  FileUtils.mkdir_p(p)
155
156
  end
156
- git_retry "clone", "--bare", "--no-hardlinks", "--quiet", *extra_clone_args, "--", configured_uri, path.to_s
157
157
 
158
- extra_ref
158
+ command = ["clone", "--bare", "--no-hardlinks", "--quiet", *extra_clone_args, "--", configured_uri, path.to_s]
159
+ command_with_no_credentials = check_allowed(command)
160
+
161
+ Bundler::Retry.new("`#{command_with_no_credentials}`", [MissingGitRevisionError]).attempts do
162
+ _, err, status = capture(command, nil)
163
+ return extra_ref if status.success?
164
+
165
+ if err.include?("Could not find remote branch")
166
+ raise MissingGitRevisionError.new(command_with_no_credentials, nil, explicit_ref, credential_filtered_uri)
167
+ else
168
+ raise GitCommandError.new(command_with_no_credentials, path, err)
169
+ end
170
+ end
159
171
  end
160
172
 
161
173
  def clone_needs_unshallow?
@@ -186,8 +198,6 @@ module Bundler
186
198
  end
187
199
 
188
200
  def refspec
189
- commit = pinned_to_full_sha? ? ref : @revision
190
-
191
201
  if commit
192
202
  @commit_ref = "refs/#{commit}-sha"
193
203
  return "#{commit}:#{@commit_ref}"
@@ -206,6 +216,10 @@ module Bundler
206
216
  "#{reference}:#{reference}"
207
217
  end
208
218
 
219
+ def commit
220
+ @commit ||= pinned_to_full_sha? ? ref : @revision
221
+ end
222
+
209
223
  def fully_qualified_ref
210
224
  if branch
211
225
  "refs/heads/#{branch}"
@@ -352,6 +366,11 @@ module Bundler
352
366
  args += ["--single-branch"]
353
367
  args.unshift("--no-tags") if supports_cloning_with_no_tags?
354
368
 
369
+ # If there's a locked revision, no need to clone any specific branch
370
+ # or tag, since we will end up checking out that locked revision
371
+ # anyways.
372
+ return args if @revision
373
+
355
374
  args += ["--branch", branch || tag] if branch || tag
356
375
  args
357
376
  end
@@ -19,7 +19,7 @@ module Bundler
19
19
  # Stringify options that could be set as symbols
20
20
  %w[ref branch tag revision].each {|k| options[k] = options[k].to_s if options[k] }
21
21
 
22
- @uri = options["uri"] || ""
22
+ @uri = URINormalizer.normalize_suffix(options["uri"] || "", :trailing_slash => false)
23
23
  @safe_uri = URICredentialsFilter.credential_filtered_uri(@uri)
24
24
  @branch = options["branch"]
25
25
  @ref = options["ref"] || options["branch"] || options["tag"]
@@ -173,6 +173,7 @@ module Bundler
173
173
  end
174
174
 
175
175
  def install(spec, options = {})
176
+ return if Bundler.settings[:no_install]
176
177
  force = options[:force]
177
178
 
178
179
  print_using_message "Using #{version_message(spec, options[:previous_spec])} from #{self}"
@@ -11,7 +11,7 @@ module Bundler
11
11
 
12
12
  protected :original_path
13
13
 
14
- DEFAULT_GLOB = "{,*,*/*}.gemspec".freeze
14
+ DEFAULT_GLOB = "{,*,*/*}.gemspec"
15
15
 
16
16
  def initialize(options)
17
17
  @options = options.dup
@@ -337,8 +337,7 @@ module Bundler
337
337
  end
338
338
 
339
339
  def normalize_uri(uri)
340
- uri = uri.to_s
341
- uri = "#{uri}/" unless %r{/$}.match?(uri)
340
+ uri = URINormalizer.normalize_suffix(uri.to_s)
342
341
  require_relative "../vendored_uri"
343
342
  uri = Bundler::URI(uri)
344
343
  raise ArgumentError, "The source must be an absolute URI. For example:\n" \
@@ -24,6 +24,7 @@ module Bundler
24
24
 
25
25
  name = dep[0].name
26
26
  platform = dep[1]
27
+ incomplete = false
27
28
 
28
29
  key = [name, platform]
29
30
  next if handled.key?(key)
@@ -36,14 +37,19 @@ module Bundler
36
37
 
37
38
  specs_for_dep.first.dependencies.each do |d|
38
39
  next if d.type == :development
40
+ incomplete = true if d.name != "bundler" && lookup[d.name].empty?
39
41
  deps << [d, dep[1]]
40
42
  end
41
- elsif check
42
- @incomplete_specs += lookup[name]
43
+ else
44
+ incomplete = true
45
+ end
46
+
47
+ if incomplete && check
48
+ @incomplete_specs += lookup[name].any? ? lookup[name] : [LazySpecification.new(name, nil, nil)]
43
49
  end
44
50
  end
45
51
 
46
- specs
52
+ specs.uniq
47
53
  end
48
54
 
49
55
  def [](key)
@@ -95,6 +101,10 @@ module Bundler
95
101
  end
96
102
 
97
103
  def incomplete_ruby_specs?(deps)
104
+ return false if @specs.empty?
105
+
106
+ @incomplete_specs = []
107
+
98
108
  self.for(deps, true, [Gem::Platform::RUBY])
99
109
 
100
110
  @incomplete_specs.any?
@@ -47,7 +47,7 @@ m = Module.new do
47
47
  def lockfile
48
48
  lockfile =
49
49
  case File.basename(gemfile)
50
- when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
51
51
  else "#{gemfile}.lock"
52
52
  end
53
53
  File.expand_path(lockfile)
@@ -10,7 +10,7 @@ gem "rake", "~> 13.0"
10
10
 
11
11
  gem "rake-compiler"
12
12
  <%- if config[:ext] == 'rust' -%>
13
- gem "rb_sys"
13
+ gem "rb_sys", "~> 0.9.63"
14
14
  <%- end -%>
15
15
  <%- end -%>
16
16
  <%- if config[:test] -%>