rubygems-update 3.3.26 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/CONTRIBUTING.md +24 -1
  4. data/Manifest.txt +30 -27
  5. data/POLICIES.md +10 -8
  6. data/README.md +2 -2
  7. data/bin/gem +1 -4
  8. data/bin/update_rubygems +1 -1
  9. data/bundler/CHANGELOG.md +59 -0
  10. data/bundler/README.md +2 -2
  11. data/bundler/bundler.gemspec +2 -2
  12. data/bundler/exe/bundle +1 -4
  13. data/bundler/lib/bundler/build_metadata.rb +2 -2
  14. data/bundler/lib/bundler/cli/add.rb +1 -1
  15. data/bundler/lib/bundler/cli/check.rb +1 -1
  16. data/bundler/lib/bundler/cli/common.rb +1 -0
  17. data/bundler/lib/bundler/cli/console.rb +2 -2
  18. data/bundler/lib/bundler/cli/doctor.rb +4 -6
  19. data/bundler/lib/bundler/cli/gem.rb +62 -40
  20. data/bundler/lib/bundler/cli/install.rb +2 -3
  21. data/bundler/lib/bundler/cli/lock.rb +8 -5
  22. data/bundler/lib/bundler/cli/outdated.rb +1 -3
  23. data/bundler/lib/bundler/cli/viz.rb +1 -1
  24. data/bundler/lib/bundler/cli.rb +43 -2
  25. data/bundler/lib/bundler/compact_index_client/cache.rb +1 -1
  26. data/bundler/lib/bundler/compact_index_client/updater.rb +40 -39
  27. data/bundler/lib/bundler/constants.rb +1 -1
  28. data/bundler/lib/bundler/definition.rb +61 -31
  29. data/bundler/lib/bundler/dependency.rb +12 -11
  30. data/bundler/lib/bundler/digest.rb +1 -1
  31. data/bundler/lib/bundler/dsl.rb +1 -1
  32. data/bundler/lib/bundler/env.rb +1 -1
  33. data/bundler/lib/bundler/environment_preserver.rb +1 -0
  34. data/bundler/lib/bundler/errors.rb +1 -11
  35. data/bundler/lib/bundler/fetcher/compact_index.rb +9 -11
  36. data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
  37. data/bundler/lib/bundler/fetcher/downloader.rb +2 -5
  38. data/bundler/lib/bundler/fetcher.rb +2 -6
  39. data/bundler/lib/bundler/force_platform.rb +18 -0
  40. data/bundler/lib/bundler/friendly_errors.rb +0 -3
  41. data/bundler/lib/bundler/gem_version_promoter.rb +52 -86
  42. data/bundler/lib/bundler/graph.rb +3 -3
  43. data/bundler/lib/bundler/index.rb +5 -13
  44. data/bundler/lib/bundler/injector.rb +1 -1
  45. data/bundler/lib/bundler/inline.rb +2 -2
  46. data/bundler/lib/bundler/installer/parallel_installer.rb +0 -31
  47. data/bundler/lib/bundler/installer.rb +6 -16
  48. data/bundler/lib/bundler/lazy_specification.rb +5 -1
  49. data/bundler/lib/bundler/lockfile_parser.rb +5 -5
  50. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  55. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  56. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-gem.1 +27 -37
  60. data/bundler/lib/bundler/man/bundle-gem.1.ronn +5 -5
  61. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-install.1 +1 -30
  66. data/bundler/lib/bundler/man/bundle-install.1.ronn +0 -29
  67. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  68. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  69. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  71. data/bundler/lib/bundler/man/bundle-platform.1 +2 -2
  72. data/bundler/lib/bundler/man/bundle-platform.1.ronn +1 -1
  73. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  74. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  75. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  76. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  77. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  78. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  79. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  80. data/bundler/lib/bundler/man/bundle.1 +1 -1
  81. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  82. data/bundler/lib/bundler/mirror.rb +5 -7
  83. data/bundler/lib/bundler/plugin/index.rb +4 -4
  84. data/bundler/lib/bundler/plugin/installer/rubygems.rb +0 -4
  85. data/bundler/lib/bundler/resolver/base.rb +7 -11
  86. data/bundler/lib/bundler/resolver/candidate.rb +92 -0
  87. data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
  88. data/bundler/lib/bundler/resolver/package.rb +63 -0
  89. data/bundler/lib/bundler/resolver/root.rb +25 -0
  90. data/bundler/lib/bundler/resolver/spec_group.rb +26 -36
  91. data/bundler/lib/bundler/resolver.rb +294 -277
  92. data/bundler/lib/bundler/rubygems_ext.rb +11 -6
  93. data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -2
  94. data/bundler/lib/bundler/rubygems_integration.rb +1 -9
  95. data/bundler/lib/bundler/runtime.rb +1 -5
  96. data/bundler/lib/bundler/settings.rb +0 -6
  97. data/bundler/lib/bundler/shared_helpers.rb +1 -0
  98. data/bundler/lib/bundler/source/git/git_proxy.rb +193 -67
  99. data/bundler/lib/bundler/source/git.rb +15 -17
  100. data/bundler/lib/bundler/source/metadata.rb +0 -1
  101. data/bundler/lib/bundler/source/path/installer.rb +1 -22
  102. data/bundler/lib/bundler/source/path.rb +5 -5
  103. data/bundler/lib/bundler/source/rubygems.rb +13 -67
  104. data/bundler/lib/bundler/source_list.rb +8 -2
  105. data/bundler/lib/bundler/spec_set.rb +7 -9
  106. data/bundler/lib/bundler/templates/Executable +1 -1
  107. data/bundler/lib/bundler/templates/Executable.bundler +4 -9
  108. data/bundler/lib/bundler/templates/Executable.standalone +2 -0
  109. data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  110. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +3 -0
  111. data/bundler/lib/bundler/templates/newgem/README.md.tt +6 -4
  112. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +2 -1
  113. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  114. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  115. data/bundler/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +0 -0
  116. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  117. data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  118. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +10 -0
  119. data/bundler/lib/bundler/templates/newgem/gitignore.tt +3 -0
  120. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +8 -0
  121. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  122. data/bundler/lib/bundler/ui/shell.rb +35 -12
  123. data/bundler/lib/bundler/ui/silent.rb +21 -5
  124. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
  125. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
  126. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +3 -1
  127. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
  128. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  129. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
  130. data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  131. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  132. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  133. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  134. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +151 -0
  135. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  136. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  137. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  138. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  139. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +53 -0
  140. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  141. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  142. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +124 -0
  143. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
  144. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -0
  145. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  146. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  147. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +1 -1
  148. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +64 -16
  149. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
  150. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -1
  151. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +27 -7
  152. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +40 -2
  153. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +2 -1
  154. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  155. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
  156. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -2
  157. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +13 -7
  158. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +10 -5
  159. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  160. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +1 -2
  161. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +2 -1
  162. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +3 -2
  163. data/bundler/lib/bundler/vendored_persistent.rb +1 -33
  164. data/bundler/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
  165. data/bundler/lib/bundler/version.rb +5 -1
  166. data/bundler/lib/bundler/worker.rb +5 -7
  167. data/bundler/lib/bundler.rb +20 -64
  168. data/lib/rubygems/command_manager.rb +2 -2
  169. data/lib/rubygems/commands/fetch_command.rb +1 -1
  170. data/lib/rubygems/commands/install_command.rb +7 -3
  171. data/lib/rubygems/commands/rdoc_command.rb +3 -2
  172. data/lib/rubygems/commands/setup_command.rb +2 -2
  173. data/lib/rubygems/commands/unpack_command.rb +1 -1
  174. data/lib/rubygems/commands/update_command.rb +1 -7
  175. data/lib/rubygems/config_file.rb +33 -0
  176. data/lib/rubygems/core_ext/kernel_warn.rb +1 -2
  177. data/lib/rubygems/defaults.rb +15 -1
  178. data/lib/rubygems/dependency.rb +4 -1
  179. data/lib/rubygems/dependency_installer.rb +24 -24
  180. data/lib/rubygems/exceptions.rb +1 -3
  181. data/lib/rubygems/ext/builder.rb +3 -3
  182. data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +9 -5
  183. data/lib/rubygems/ext/cargo_builder.rb +15 -20
  184. data/lib/rubygems/ext/ext_conf_builder.rb +2 -0
  185. data/lib/rubygems/indexer.rb +1 -1
  186. data/lib/rubygems/installer.rb +5 -5
  187. data/lib/rubygems/optparse/lib/optparse.rb +20 -15
  188. data/lib/rubygems/package/tar_header.rb +11 -11
  189. data/lib/rubygems/platform.rb +0 -2
  190. data/lib/rubygems/request_set/gem_dependency_api.rb +104 -104
  191. data/lib/rubygems/requirement.rb +7 -7
  192. data/lib/rubygems/resolver/installer_set.rb +1 -1
  193. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +1 -1
  194. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +32 -26
  195. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  196. data/lib/rubygems/security/policies.rb +40 -40
  197. data/lib/rubygems/security/trust_dir.rb +1 -1
  198. data/lib/rubygems/security.rb +3 -16
  199. data/lib/rubygems/source.rb +2 -2
  200. data/lib/rubygems/specification.rb +37 -49
  201. data/lib/rubygems/specification_policy.rb +14 -0
  202. data/lib/rubygems/stub_specification.rb +2 -2
  203. data/lib/rubygems/text.rb +1 -1
  204. data/lib/rubygems/tsort/lib/tsort.rb +308 -310
  205. data/lib/rubygems/update_suggestion.rb +69 -0
  206. data/lib/rubygems/util.rb +1 -5
  207. data/lib/rubygems/validator.rb +1 -1
  208. data/lib/rubygems.rb +8 -3
  209. data/rubygems-update.gemspec +2 -2
  210. data/test/rubygems/helper.rb +7 -3
  211. data/test/rubygems/test_bundled_ca.rb +1 -1
  212. data/test/rubygems/test_exit.rb +6 -0
  213. data/test/rubygems/test_gem.rb +4 -9
  214. data/test/rubygems/test_gem_bundler_version_finder.rb +2 -1
  215. data/test/rubygems/test_gem_command_manager.rb +1 -1
  216. data/test/rubygems/test_gem_commands_install_command.rb +19 -0
  217. data/test/rubygems/test_gem_commands_setup_command.rb +1 -8
  218. data/test/rubygems/test_gem_commands_update_command.rb +6 -6
  219. data/test/rubygems/test_gem_config_file.rb +1 -1
  220. data/test/rubygems/test_gem_dependency.rb +2 -0
  221. data/test/rubygems/test_gem_ext_builder.rb +3 -3
  222. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +22 -32
  223. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  224. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +22 -32
  225. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  226. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +12 -0
  227. data/test/rubygems/test_gem_ext_cargo_builder.rb +22 -27
  228. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +16 -16
  229. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -10
  230. data/test/rubygems/test_gem_indexer.rb +39 -20
  231. data/test/rubygems/test_gem_installer.rb +68 -2
  232. data/test/rubygems/test_gem_package_tar_header.rb +13 -13
  233. data/test/rubygems/test_gem_platform.rb +59 -60
  234. data/test/rubygems/test_gem_remote_fetcher.rb +4 -4
  235. data/test/rubygems/test_gem_request_set.rb +2 -2
  236. data/test/rubygems/test_gem_requirement.rb +1 -1
  237. data/test/rubygems/test_gem_resolver_api_set.rb +12 -12
  238. data/test/rubygems/test_gem_resolver_api_specification.rb +19 -19
  239. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
  240. data/test/rubygems/test_gem_security_policy.rb +10 -10
  241. data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
  242. data/test/rubygems/test_gem_specification.rb +50 -37
  243. data/test/rubygems/test_gem_uninstaller.rb +1 -1
  244. data/test/rubygems/test_gem_update_suggestion.rb +208 -0
  245. data/test/rubygems/test_kernel.rb +10 -8
  246. data/test/rubygems/test_require.rb +70 -55
  247. metadata +34 -31
  248. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -6
  249. data/bundler/lib/bundler/vendor/molinillo/LICENSE +0 -9
  250. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  251. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
  252. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  253. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  254. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  255. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  256. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  257. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  258. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  259. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  260. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
  261. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
  262. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -149
  263. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  264. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
  265. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
  266. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
  267. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
  268. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
  269. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
  270. data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
  271. data/bundler/lib/bundler/vendored_molinillo.rb +0 -4
  272. data/bundler/lib/bundler/version_ranges.rb +0 -122
@@ -30,7 +30,7 @@
30
30
  # class RSYNC < Generic
31
31
  # DEFAULT_PORT = 873
32
32
  # end
33
- # @@schemes['RSYNC'] = RSYNC
33
+ # register_scheme 'RSYNC', RSYNC
34
34
  # end
35
35
  # #=> Bundler::URI::RSYNC
36
36
  #
@@ -70,7 +70,6 @@
70
70
  # - Bundler::URI::REGEXP - (in uri/common.rb)
71
71
  # - Bundler::URI::REGEXP::PATTERN - (in uri/common.rb)
72
72
  # - Bundler::URI::Util - (in uri/common.rb)
73
- # - Bundler::URI::Escape - (in uri/common.rb)
74
73
  # - Bundler::URI::Error - (in uri/common.rb)
75
74
  # - Bundler::URI::InvalidURIError - (in uri/common.rb)
76
75
  # - Bundler::URI::InvalidComponentError - (in uri/common.rb)
@@ -101,3 +100,5 @@ require_relative 'uri/https'
101
100
  require_relative 'uri/ldap'
102
101
  require_relative 'uri/ldaps'
103
102
  require_relative 'uri/mailto'
103
+ require_relative 'uri/ws'
104
+ require_relative 'uri/wss'
@@ -11,37 +11,5 @@ end
11
11
  require_relative "vendor/net-http-persistent/lib/net/http/persistent"
12
12
 
13
13
  module Bundler
14
- class PersistentHTTP < Persistent::Net::HTTP::Persistent
15
- def connection_for(uri)
16
- super(uri) do |connection|
17
- result = yield connection
18
- warn_old_tls_version_rubygems_connection(uri, connection)
19
- result
20
- end
21
- end
22
-
23
- def warn_old_tls_version_rubygems_connection(uri, connection)
24
- return unless connection.http.use_ssl?
25
- return unless (uri.host || "").end_with?("rubygems.org")
26
-
27
- socket = connection.instance_variable_get(:@socket)
28
- return unless socket
29
- socket_io = socket.io
30
- return unless socket_io.respond_to?(:ssl_version)
31
- ssl_version = socket_io.ssl_version
32
-
33
- case ssl_version
34
- when /TLSv([\d\.]+)/
35
- version = Gem::Version.new($1)
36
- if version < Gem::Version.new("1.2")
37
- Bundler.ui.warn \
38
- "Warning: Your Ruby version is compiled against a copy of OpenSSL that is very old. " \
39
- "Starting in January 2018, RubyGems.org will refuse connection requests from these " \
40
- "very old versions of OpenSSL. If you will need to continue installing gems after " \
41
- "January 2018, please follow this guide to upgrade: http://ruby.to/tls-outdated.",
42
- :wrap => true
43
- end
44
- end
45
- end
46
- end
14
+ PersistentHTTP = Persistent::Net::HTTP::Persistent
47
15
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bundler; end
4
- require_relative "vendor/tmpdir/lib/tmpdir"
4
+ require_relative "vendor/pub_grub/lib/pub_grub"
@@ -1,9 +1,13 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.26".freeze
4
+ VERSION = "2.4.1".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
8
8
  end
9
+
10
+ def self.gem_version
11
+ @gem_version ||= Gem::Version.create(VERSION)
12
+ end
9
13
  end
@@ -87,14 +87,12 @@ module Bundler
87
87
  creation_errors = []
88
88
 
89
89
  @threads = Array.new(@size) do |i|
90
- begin
91
- Thread.start { process_queue(i) }.tap do |thread|
92
- thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
93
- end
94
- rescue ThreadError => e
95
- creation_errors << e
96
- nil
90
+ Thread.start { process_queue(i) }.tap do |thread|
91
+ thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
97
92
  end
93
+ rescue ThreadError => e
94
+ creation_errors << e
95
+ nil
98
96
  end.compact
99
97
 
100
98
  add_interrupt_handler unless @threads.empty?
@@ -39,6 +39,16 @@ module Bundler
39
39
  environment_preserver.replace_with_backup
40
40
  SUDO_MUTEX = Thread::Mutex.new
41
41
 
42
+ SAFE_MARSHAL_CLASSES = [Symbol, TrueClass, String, Array, Hash].freeze
43
+ SAFE_MARSHAL_ERROR = "Unexpected class %s present in marshaled data. Only %s are allowed.".freeze
44
+ SAFE_MARSHAL_PROC = proc do |object|
45
+ object.tap do
46
+ unless SAFE_MARSHAL_CLASSES.include?(object.class)
47
+ raise TypeError, format(SAFE_MARSHAL_ERROR, object.class, SAFE_MARSHAL_CLASSES.join(", "))
48
+ end
49
+ end
50
+ end
51
+
42
52
  autoload :Definition, File.expand_path("bundler/definition", __dir__)
43
53
  autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
44
54
  autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
@@ -75,7 +85,6 @@ module Bundler
75
85
  autoload :StubSpecification, File.expand_path("bundler/stub_specification", __dir__)
76
86
  autoload :UI, File.expand_path("bundler/ui", __dir__)
77
87
  autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
78
- autoload :VersionRanges, File.expand_path("bundler/version_ranges", __dir__)
79
88
 
80
89
  class << self
81
90
  def configure
@@ -454,7 +463,7 @@ EOF
454
463
  end
455
464
 
456
465
  def local_platform
457
- return Gem::Platform::RUBY if settings[:force_ruby_platform] || Gem.platforms == [Gem::Platform::RUBY]
466
+ return Gem::Platform::RUBY if settings[:force_ruby_platform]
458
467
  Gem::Platform.local
459
468
  end
460
469
 
@@ -487,41 +496,9 @@ EOF
487
496
  configured_bundle_path.use_system_gems?
488
497
  end
489
498
 
490
- def requires_sudo?
491
- return @requires_sudo if defined?(@requires_sudo_ran)
492
-
493
- sudo_present = which "sudo" if settings.allow_sudo?
494
-
495
- if sudo_present
496
- # the bundle path and subdirectories need to be writable for RubyGems
497
- # to be able to unpack and install gems without exploding
498
- path = bundle_path
499
- path = path.parent until path.exist?
500
-
501
- # bins are written to a different location on OS X
502
- bin_dir = Pathname.new(Bundler.system_bindir)
503
- bin_dir = bin_dir.parent until bin_dir.exist?
504
-
505
- # if any directory is not writable, we need sudo
506
- files = [path, bin_dir] | Dir[bundle_path.join("build_info/*").to_s] | Dir[bundle_path.join("*").to_s]
507
- unwritable_files = files.reject {|f| File.writable?(f) }
508
- sudo_needed = !unwritable_files.empty?
509
- if sudo_needed
510
- Bundler.ui.warn "Following files may not be writable, so sudo is needed:\n #{unwritable_files.map(&:to_s).sort.join("\n ")}"
511
- end
512
- end
513
-
514
- @requires_sudo_ran = true
515
- @requires_sudo = settings.allow_sudo? && sudo_present && sudo_needed
516
- end
517
-
518
499
  def mkdir_p(path, options = {})
519
- if requires_sudo? && !options[:no_sudo]
520
- sudo "mkdir -p '#{path}'" unless File.exist?(path)
521
- else
522
- SharedHelpers.filesystem_access(path, :write) do |p|
523
- FileUtils.mkdir_p(p)
524
- end
500
+ SharedHelpers.filesystem_access(path, :write) do |p|
501
+ FileUtils.mkdir_p(p)
525
502
  end
526
503
  end
527
504
 
@@ -538,39 +515,18 @@ EOF
538
515
  end
539
516
  end
540
517
 
541
- def sudo(str)
542
- SUDO_MUTEX.synchronize do
543
- prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, "").strip + " "
544
- Your user account isn't allowed to install to the system RubyGems.
545
- You can cancel this installation and run:
546
-
547
- bundle config set --local path 'vendor/bundle'
548
- bundle install
549
-
550
- to install the gems into ./vendor/bundle/, or you can enter your password
551
- and install the bundled gems to RubyGems using sudo.
552
-
553
- Password:
554
- PROMPT
555
-
556
- unless @prompted_for_sudo ||= system(%(sudo -k -p "#{prompt}" true))
557
- raise SudoNotPermittedError,
558
- "Bundler requires sudo access to install at the moment. " \
559
- "Try installing again, granting Bundler sudo access when prompted, or installing into a different path."
560
- end
561
-
562
- `sudo -p "#{prompt}" #{str}`
563
- end
564
- end
565
-
566
518
  def read_file(file)
567
519
  SharedHelpers.filesystem_access(file, :read) do
568
520
  File.open(file, "r:UTF-8", &:read)
569
521
  end
570
522
  end
571
523
 
572
- def load_marshal(data)
573
- Marshal.load(data)
524
+ def safe_load_marshal(data)
525
+ load_marshal(data, :marshal_proc => SAFE_MARSHAL_PROC)
526
+ end
527
+
528
+ def load_marshal(data, marshal_proc: nil)
529
+ Marshal.load(data, marshal_proc)
574
530
  rescue TypeError => e
575
531
  raise MarshalError, "#{e.class}: #{e.message}"
576
532
  end
@@ -608,7 +564,7 @@ EOF
608
564
 
609
565
  def git_present?
610
566
  return @git_present if defined?(@git_present)
611
- @git_present = Bundler.which("git") || Bundler.which("git.exe")
567
+ @git_present = Bundler.which("git#{RbConfig::CONFIG["EXEEXT"]}")
612
568
  end
613
569
 
614
570
  def feature_flag
@@ -73,8 +73,8 @@ class Gem::CommandManager
73
73
  ].freeze
74
74
 
75
75
  ALIAS_COMMANDS = {
76
- "i" => "install",
77
- "login" => "signin",
76
+ "i" => "install",
77
+ "login" => "signin",
78
78
  "logout" => "signout",
79
79
  }.freeze
80
80
 
@@ -10,7 +10,7 @@ class Gem::Commands::FetchCommand < Gem::Command
10
10
  def initialize
11
11
  defaults = {
12
12
  :suggest_alternate => true,
13
- :version => Gem::Requirement.default,
13
+ :version => Gem::Requirement.default,
14
14
  }
15
15
 
16
16
  super "fetch", "Download a gem and place it in the current directory", defaults
@@ -5,6 +5,7 @@ require_relative "../dependency_installer"
5
5
  require_relative "../local_remote_options"
6
6
  require_relative "../validator"
7
7
  require_relative "../version_option"
8
+ require_relative "../update_suggestion"
8
9
 
9
10
  ##
10
11
  # Gem installer command line tool
@@ -17,14 +18,15 @@ class Gem::Commands::InstallCommand < Gem::Command
17
18
  include Gem::VersionOption
18
19
  include Gem::LocalRemoteOptions
19
20
  include Gem::InstallUpdateOptions
21
+ include Gem::UpdateSuggestion
20
22
 
21
23
  def initialize
22
24
  defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({
23
25
  :format_executable => false,
24
- :lock => true,
26
+ :lock => true,
25
27
  :suggest_alternate => true,
26
- :version => Gem::Requirement.default,
27
- :without_groups => [],
28
+ :version => Gem::Requirement.default,
29
+ :without_groups => [],
28
30
  })
29
31
 
30
32
  defaults.merge!(install_update_options)
@@ -168,6 +170,8 @@ You can use `i` command instead of `install`.
168
170
 
169
171
  show_installed
170
172
 
173
+ say update_suggestion if eglible_for_update?
174
+
171
175
  terminate_interaction exit_code
172
176
  end
173
177
 
@@ -86,8 +86,9 @@ Use --overwrite to force rebuilding of documentation.
86
86
  begin
87
87
  doc.generate
88
88
  rescue Errno::ENOENT => e
89
- e.message =~ / - /
90
- alert_error "Unable to document #{spec.full_name}, #{$'} is missing, skipping"
89
+ match = / - /.match(e.message)
90
+ alert_error "Unable to document #{spec.full_name}, " \
91
+ " #{match.post_match} is missing, skipping"
91
92
  terminate_interaction 1 if specs.length == 1
92
93
  end
93
94
  end
@@ -107,7 +107,7 @@ class Gem::Commands::SetupCommand < Gem::Command
107
107
  end
108
108
 
109
109
  def check_ruby_version
110
- required_version = Gem::Requirement.new ">= 2.3.0"
110
+ required_version = Gem::Requirement.new ">= 2.6.0"
111
111
 
112
112
  unless required_version.satisfied_by? Gem.ruby_version
113
113
  alert_error "Expected Ruby version #{required_version}, is #{Gem.ruby_version}"
@@ -576,7 +576,7 @@ abort "#{deprecation_message}"
576
576
  require_relative "../uninstaller"
577
577
 
578
578
  ui = Gem::Uninstaller.new("gemcutter", :all => true, :ignore => true,
579
- :version => "< 0.4")
579
+ :version => "< 0.4")
580
580
  ui.uninstall
581
581
  rescue Gem::InstallError
582
582
  end
@@ -21,7 +21,7 @@ class Gem::Commands::UnpackCommand < Gem::Command
21
21
 
22
22
  super "unpack", "Unpack an installed gem to the current directory",
23
23
  :version => Gem::Requirement.default,
24
- :target => Dir.pwd
24
+ :target => Dir.pwd
25
25
 
26
26
  add_option("--target=DIR",
27
27
  "target directory for unpacking") do |value, options|
@@ -329,14 +329,8 @@ command to remove old versions.
329
329
  Gem::Version.new("3.2.3")
330
330
  elsif Gem.ruby_version > Gem::Version.new("2.7.a")
331
331
  Gem::Version.new("3.1.2")
332
- elsif Gem.ruby_version > Gem::Version.new("2.6.a")
333
- Gem::Version.new("3.0.1")
334
- elsif Gem.ruby_version > Gem::Version.new("2.5.a")
335
- Gem::Version.new("2.7.3")
336
- elsif Gem.ruby_version > Gem::Version.new("2.4.a")
337
- Gem::Version.new("2.6.8")
338
332
  else
339
- Gem::Version.new("2.5.2")
333
+ Gem::Version.new("3.0.1")
340
334
  end
341
335
  end
342
336
  end
@@ -371,11 +371,44 @@ if you believe they were disclosed to a third party.
371
371
  @backtrace || $DEBUG
372
372
  end
373
373
 
374
+ # Check state file is writable. Creates empty file if not present to ensure we can write to it.
375
+ def state_file_writable?
376
+ if File.exist?(state_file_name)
377
+ File.writable?(state_file_name)
378
+ else
379
+ require "fileutils"
380
+ FileUtils.mkdir_p File.dirname(state_file_name)
381
+ File.open(state_file_name, "w") {}
382
+ true
383
+ end
384
+ rescue Errno::EACCES
385
+ false
386
+ end
387
+
374
388
  # The name of the configuration file.
375
389
  def config_file_name
376
390
  @config_file_name || Gem.config_file
377
391
  end
378
392
 
393
+ # The name of the state file.
394
+ def state_file_name
395
+ Gem.state_file
396
+ end
397
+
398
+ # Reads time of last update check from state file
399
+ def last_update_check
400
+ if File.readable?(state_file_name)
401
+ File.read(state_file_name).to_i
402
+ else
403
+ 0
404
+ end
405
+ end
406
+
407
+ # Writes time of last update check to state file
408
+ def last_update_check=(timestamp)
409
+ File.write(state_file_name, timestamp.to_s) if state_file_writable?
410
+ end
411
+
379
412
  # Delegates to @hash
380
413
  def each(&block)
381
414
  hash = @hash.dup
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # `uplevel` keyword argument of Kernel#warn is available since ruby 2.5.
4
- if RUBY_VERSION >= "2.5" && !Gem::KERNEL_WARN_IGNORES_INTERNAL_ENTRIES
3
+ if !Gem::KERNEL_WARN_IGNORES_INTERNAL_ENTRIES
5
4
 
6
5
  module Kernel
7
6
  rubygems_path = "#{__dir__}/" # Frames to be skipped start with this path.
@@ -133,6 +133,13 @@ module Gem
133
133
  @config_file ||= find_config_file.tap(&Gem::UNTAINT)
134
134
  end
135
135
 
136
+ ##
137
+ # The path to standard location of the user's state file.
138
+
139
+ def self.state_file
140
+ @state_file ||= File.join(Gem.state_home, "gem", "last_update_check").tap(&Gem::UNTAINT)
141
+ end
142
+
136
143
  ##
137
144
  # The path to standard location of the user's cache directory.
138
145
 
@@ -147,6 +154,13 @@ module Gem
147
154
  @data_home ||= (ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, ".local", "share"))
148
155
  end
149
156
 
157
+ ##
158
+ # The path to standard location of the user's state directory.
159
+
160
+ def self.state_home
161
+ @data_home ||= (ENV["XDG_STATE_HOME"] || File.join(Gem.user_home, ".local", "state"))
162
+ end
163
+
150
164
  ##
151
165
  # How String Gem paths should be split. Overridable for esoteric platforms.
152
166
 
@@ -171,7 +185,7 @@ module Gem
171
185
  def self.default_exec_format
172
186
  exec_format = RbConfig::CONFIG["ruby_install_name"].sub("ruby", "%s") rescue "%s"
173
187
 
174
- unless exec_format =~ /%s/
188
+ unless exec_format.include?("%s")
175
189
  raise Gem::Exception,
176
190
  "[BUG] invalid exec_format #{exec_format.inspect}, no %s"
177
191
  end
@@ -277,7 +277,10 @@ class Gem::Dependency
277
277
  requirement.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version)
278
278
  end.map(&:to_spec)
279
279
 
280
- Gem::BundlerVersionFinder.prioritize!(matches) if prioritizes_bundler?
280
+ if prioritizes_bundler?
281
+ require_relative "bundler_version_finder"
282
+ Gem::BundlerVersionFinder.prioritize!(matches)
283
+ end
281
284
 
282
285
  if platform_only
283
286
  matches.reject! do |spec|
@@ -16,16 +16,16 @@ class Gem::DependencyInstaller
16
16
  extend Gem::Deprecate
17
17
 
18
18
  DEFAULT_OPTIONS = { # :nodoc:
19
- :env_shebang => false,
20
- :document => %w[ri],
21
- :domain => :both, # HACK dup
22
- :force => false,
23
- :format_executable => false, # HACK dup
19
+ :env_shebang => false,
20
+ :document => %w[ri],
21
+ :domain => :both, # HACK dup
22
+ :force => false,
23
+ :format_executable => false, # HACK dup
24
24
  :ignore_dependencies => false,
25
- :prerelease => false,
26
- :security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low?
27
- :wrappers => true,
28
- :build_args => nil,
25
+ :prerelease => false,
26
+ :security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low?
27
+ :wrappers => true,
28
+ :build_args => nil,
29
29
  :build_docs_in_background => false,
30
30
  :install_as_default => false,
31
31
  }.freeze
@@ -230,22 +230,22 @@ class Gem::DependencyInstaller
230
230
  @installed_gems = []
231
231
 
232
232
  options = {
233
- :bin_dir => @bin_dir,
234
- :build_args => @build_args,
235
- :document => @document,
236
- :env_shebang => @env_shebang,
237
- :force => @force,
238
- :format_executable => @format_executable,
233
+ :bin_dir => @bin_dir,
234
+ :build_args => @build_args,
235
+ :document => @document,
236
+ :env_shebang => @env_shebang,
237
+ :force => @force,
238
+ :format_executable => @format_executable,
239
239
  :ignore_dependencies => @ignore_dependencies,
240
- :prerelease => @prerelease,
241
- :security_policy => @security_policy,
242
- :user_install => @user_install,
243
- :wrappers => @wrappers,
244
- :build_root => @build_root,
245
- :install_as_default => @install_as_default,
246
- :dir_mode => @dir_mode,
247
- :data_mode => @data_mode,
248
- :prog_mode => @prog_mode,
240
+ :prerelease => @prerelease,
241
+ :security_policy => @security_policy,
242
+ :user_install => @user_install,
243
+ :wrappers => @wrappers,
244
+ :build_root => @build_root,
245
+ :install_as_default => @install_as_default,
246
+ :dir_mode => @dir_mode,
247
+ :data_mode => @data_mode,
248
+ :prog_mode => @prog_mode,
249
249
  }
250
250
  options[:install_dir] = @install_dir if @only_install_dir
251
251
 
@@ -221,14 +221,12 @@ class Gem::SystemExitException < SystemExit
221
221
  ##
222
222
  # The exit code for the process
223
223
 
224
- attr_accessor :exit_code
224
+ alias exit_code status
225
225
 
226
226
  ##
227
227
  # Creates a new SystemExitException with the given +exit_code+
228
228
 
229
229
  def initialize(exit_code)
230
- @exit_code = exit_code
231
-
232
230
  super exit_code, "Exiting RubyGems with exit_code #{exit_code}"
233
231
  end
234
232
  end
@@ -17,7 +17,7 @@ class Gem::Ext::Builder
17
17
  $1.downcase
18
18
  end
19
19
 
20
- def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil)
20
+ def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil, targets = ["clean", "", "install"])
21
21
  unless File.exist? File.join(make_dir, "Makefile")
22
22
  raise Gem::InstallError, "Makefile not found"
23
23
  end
@@ -26,7 +26,7 @@ class Gem::Ext::Builder
26
26
  RbConfig::CONFIG["configure_args"] =~ /with-make-prog\=(\w+)/
27
27
  make_program_name = ENV["MAKE"] || ENV["make"] || $1
28
28
  unless make_program_name
29
- make_program_name = (/mswin/ =~ RUBY_PLATFORM) ? "nmake" : "make"
29
+ make_program_name = (RUBY_PLATFORM.include?("mswin")) ? "nmake" : "make"
30
30
  end
31
31
  make_program = Shellwords.split(make_program_name)
32
32
 
@@ -40,7 +40,7 @@ class Gem::Ext::Builder
40
40
  env << "sitelibdir=%s" % sitedir
41
41
  end
42
42
 
43
- ["clean", "", "install"].each do |target|
43
+ targets.each do |target|
44
44
  # Pass DESTDIR via command line to override what's in MAKEFLAGS
45
45
  cmd = [
46
46
  *make_program,
@@ -3,20 +3,24 @@
3
3
  class Gem::Ext::CargoBuilder < Gem::Ext::Builder
4
4
  # Converts Ruby link flags into something cargo understands
5
5
  class LinkFlagConverter
6
+ FILTERED_PATTERNS = [
7
+ /compress-debug-sections/, # Not supported by all linkers, and not required for Rust
8
+ ].freeze
9
+
6
10
  def self.convert(arg)
11
+ return [] if FILTERED_PATTERNS.any? {|p| p.match?(arg) }
12
+
7
13
  case arg.chomp
8
14
  when /^-L\s*(.+)$/
9
15
  ["-L", "native=#{$1}"]
10
16
  when /^--library=(\w+\S+)$/, /^-l\s*(\w+\S+)$/
11
17
  ["-l", $1]
12
- when /^-l\s*:lib(\S+).a$/
13
- ["-l", "static=#{$1}"]
14
- when /^-l\s*:lib(\S+).(so|dylib|dll)$/
15
- ["-l", "dylib=#{$1}"]
18
+ when /^-l\s*([^:\s])+/ # -lfoo, but not -l:libfoo.a
19
+ ["-l", $1]
16
20
  when /^-F\s*(.*)$/
17
21
  ["-l", "framework=#{$1}"]
18
22
  else
19
- ["-C", "link_arg=#{arg}"]
23
+ ["-C", "link-args=#{arg}"]
20
24
  end
21
25
  end
22
26
  end