rubygems-update 3.3.18 → 3.3.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/Manifest.txt +1 -0
  4. data/bin/gem +2 -2
  5. data/bin/update_rubygems +4 -4
  6. data/bundler/CHANGELOG.md +29 -0
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/common.rb +1 -0
  9. data/bundler/lib/bundler/definition.rb +31 -12
  10. data/bundler/lib/bundler/dsl.rb +2 -2
  11. data/bundler/lib/bundler/incomplete_specification.rb +12 -0
  12. data/bundler/lib/bundler/index.rb +10 -12
  13. data/bundler/lib/bundler/lazy_specification.rb +15 -6
  14. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  15. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  16. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  17. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  18. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  19. data/bundler/lib/bundler/man/bundle-config.1 +13 -3
  20. data/bundler/lib/bundler/man/bundle-config.1.ronn +9 -2
  21. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
  23. data/bundler/lib/bundler/man/bundle-exec.1.ronn +1 -1
  24. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-inject.1 +5 -2
  28. data/bundler/lib/bundler/man/bundle-inject.1.ronn +3 -1
  29. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-viz.1 +4 -1
  40. data/bundler/lib/bundler/man/bundle-viz.1.ronn +2 -0
  41. data/bundler/lib/bundler/man/bundle.1 +3 -3
  42. data/bundler/lib/bundler/man/bundle.1.ronn +2 -2
  43. data/bundler/lib/bundler/man/gemfile.5 +16 -10
  44. data/bundler/lib/bundler/man/gemfile.5.ronn +23 -16
  45. data/bundler/lib/bundler/remote_specification.rb +5 -4
  46. data/bundler/lib/bundler/resolver.rb +5 -6
  47. data/bundler/lib/bundler/rubygems_gem_installer.rb +19 -12
  48. data/bundler/lib/bundler/settings.rb +1 -0
  49. data/bundler/lib/bundler/spec_set.rb +29 -21
  50. data/bundler/lib/bundler/version.rb +1 -1
  51. data/bundler/lib/bundler.rb +1 -0
  52. data/lib/rubygems/basic_specification.rb +2 -2
  53. data/lib/rubygems/command.rb +19 -19
  54. data/lib/rubygems/command_manager.rb +9 -9
  55. data/lib/rubygems/commands/build_command.rb +8 -8
  56. data/lib/rubygems/commands/cert_command.rb +32 -32
  57. data/lib/rubygems/commands/check_command.rb +20 -20
  58. data/lib/rubygems/commands/cleanup_command.rb +16 -16
  59. data/lib/rubygems/commands/contents_command.rb +12 -12
  60. data/lib/rubygems/commands/dependency_command.rb +12 -12
  61. data/lib/rubygems/commands/environment_command.rb +5 -5
  62. data/lib/rubygems/commands/fetch_command.rb +6 -6
  63. data/lib/rubygems/commands/generate_index_command.rb +15 -15
  64. data/lib/rubygems/commands/help_command.rb +3 -3
  65. data/lib/rubygems/commands/info_command.rb +3 -3
  66. data/lib/rubygems/commands/install_command.rb +13 -13
  67. data/lib/rubygems/commands/list_command.rb +3 -3
  68. data/lib/rubygems/commands/lock_command.rb +4 -4
  69. data/lib/rubygems/commands/mirror_command.rb +3 -3
  70. data/lib/rubygems/commands/open_command.rb +9 -9
  71. data/lib/rubygems/commands/outdated_command.rb +5 -5
  72. data/lib/rubygems/commands/owner_command.rb +11 -11
  73. data/lib/rubygems/commands/pristine_command.rb +31 -31
  74. data/lib/rubygems/commands/push_command.rb +8 -8
  75. data/lib/rubygems/commands/query_command.rb +8 -8
  76. data/lib/rubygems/commands/rdoc_command.rb +17 -17
  77. data/lib/rubygems/commands/search_command.rb +3 -3
  78. data/lib/rubygems/commands/server_command.rb +3 -3
  79. data/lib/rubygems/commands/setup_command.rb +92 -102
  80. data/lib/rubygems/commands/signin_command.rb +9 -9
  81. data/lib/rubygems/commands/signout_command.rb +7 -7
  82. data/lib/rubygems/commands/sources_command.rb +19 -19
  83. data/lib/rubygems/commands/specification_command.rb +11 -11
  84. data/lib/rubygems/commands/stale_command.rb +2 -2
  85. data/lib/rubygems/commands/uninstall_command.rb +36 -36
  86. data/lib/rubygems/commands/unpack_command.rb +12 -12
  87. data/lib/rubygems/commands/update_command.rb +35 -51
  88. data/lib/rubygems/commands/which_command.rb +6 -6
  89. data/lib/rubygems/commands/yank_command.rb +11 -11
  90. data/lib/rubygems/config_file.rb +14 -14
  91. data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
  92. data/lib/rubygems/core_ext/kernel_require.rb +1 -1
  93. data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
  94. data/lib/rubygems/core_ext/tcpsocket_init.rb +1 -1
  95. data/lib/rubygems/defaults.rb +15 -15
  96. data/lib/rubygems/dependency.rb +4 -4
  97. data/lib/rubygems/dependency_installer.rb +8 -8
  98. data/lib/rubygems/dependency_list.rb +2 -2
  99. data/lib/rubygems/doctor.rb +16 -16
  100. data/lib/rubygems/errors.rb +2 -2
  101. data/lib/rubygems/exceptions.rb +4 -4
  102. data/lib/rubygems/ext/build_error.rb +1 -1
  103. data/lib/rubygems/ext/builder.rb +16 -16
  104. data/lib/rubygems/ext/cargo_builder.rb +7 -7
  105. data/lib/rubygems/ext/cmake_builder.rb +2 -2
  106. data/lib/rubygems/ext/configure_builder.rb +1 -1
  107. data/lib/rubygems/ext/ext_conf_builder.rb +6 -6
  108. data/lib/rubygems/ext/rake_builder.rb +3 -3
  109. data/lib/rubygems/ext.rb +7 -7
  110. data/lib/rubygems/gem_runner.rb +5 -5
  111. data/lib/rubygems/gemcutter_utilities.rb +30 -27
  112. data/lib/rubygems/indexer.rb +24 -24
  113. data/lib/rubygems/install_default_message.rb +2 -2
  114. data/lib/rubygems/install_message.rb +2 -2
  115. data/lib/rubygems/install_update_options.rb +55 -55
  116. data/lib/rubygems/installer.rb +27 -27
  117. data/lib/rubygems/installer_uninstaller_utils.rb +2 -2
  118. data/lib/rubygems/local_remote_options.rb +18 -20
  119. data/lib/rubygems/mock_gem_ui.rb +2 -2
  120. data/lib/rubygems/name_tuple.rb +1 -1
  121. data/lib/rubygems/optparse.rb +1 -1
  122. data/lib/rubygems/package/file_source.rb +2 -2
  123. data/lib/rubygems/package/old.rb +8 -8
  124. data/lib/rubygems/package/tar_header.rb +33 -33
  125. data/lib/rubygems/package/tar_reader/entry.rb +2 -2
  126. data/lib/rubygems/package/tar_reader.rb +1 -1
  127. data/lib/rubygems/package/tar_writer.rb +6 -6
  128. data/lib/rubygems/package.rb +35 -35
  129. data/lib/rubygems/package_task.rb +4 -4
  130. data/lib/rubygems/platform.rb +42 -42
  131. data/lib/rubygems/psych_tree.rb +1 -1
  132. data/lib/rubygems/query_utils.rb +27 -27
  133. data/lib/rubygems/rdoc.rb +2 -2
  134. data/lib/rubygems/remote_fetcher.rb +19 -19
  135. data/lib/rubygems/request/connection_pools.rb +2 -2
  136. data/lib/rubygems/request.rb +21 -21
  137. data/lib/rubygems/request_set/gem_dependency_api.rb +15 -15
  138. data/lib/rubygems/request_set/lockfile/parser.rb +14 -14
  139. data/lib/rubygems/request_set/lockfile/tokenizer.rb +2 -2
  140. data/lib/rubygems/request_set/lockfile.rb +5 -5
  141. data/lib/rubygems/request_set.rb +14 -14
  142. data/lib/rubygems/requirement.rb +5 -5
  143. data/lib/rubygems/resolver/activation_request.rb +3 -3
  144. data/lib/rubygems/resolver/api_set.rb +4 -4
  145. data/lib/rubygems/resolver/api_specification.rb +2 -2
  146. data/lib/rubygems/resolver/best_set.rb +2 -2
  147. data/lib/rubygems/resolver/conflict.rb +7 -7
  148. data/lib/rubygems/resolver/dependency_request.rb +2 -2
  149. data/lib/rubygems/resolver/git_set.rb +2 -2
  150. data/lib/rubygems/resolver/git_specification.rb +3 -3
  151. data/lib/rubygems/resolver/index_set.rb +3 -3
  152. data/lib/rubygems/resolver/index_specification.rb +3 -3
  153. data/lib/rubygems/resolver/installed_specification.rb +2 -2
  154. data/lib/rubygems/resolver/installer_set.rb +4 -4
  155. data/lib/rubygems/resolver/local_specification.rb +2 -2
  156. data/lib/rubygems/resolver/lock_set.rb +3 -3
  157. data/lib/rubygems/resolver/lock_specification.rb +3 -3
  158. data/lib/rubygems/resolver/molinillo.rb +1 -1
  159. data/lib/rubygems/resolver/specification.rb +1 -1
  160. data/lib/rubygems/resolver/vendor_set.rb +1 -1
  161. data/lib/rubygems/resolver.rb +35 -35
  162. data/lib/rubygems/s3_uri_signer.rb +6 -6
  163. data/lib/rubygems/safe_yaml.rb +2 -2
  164. data/lib/rubygems/security/policies.rb +11 -11
  165. data/lib/rubygems/security/policy.rb +12 -12
  166. data/lib/rubygems/security/signer.rb +4 -4
  167. data/lib/rubygems/security/trust_dir.rb +3 -3
  168. data/lib/rubygems/security.rb +27 -27
  169. data/lib/rubygems/security_option.rb +5 -5
  170. data/lib/rubygems/source/git.rb +17 -17
  171. data/lib/rubygems/source/installed.rb +1 -1
  172. data/lib/rubygems/source/local.rb +2 -2
  173. data/lib/rubygems/source/specific_file.rb +1 -1
  174. data/lib/rubygems/source.rb +15 -15
  175. data/lib/rubygems/spec_fetcher.rb +8 -8
  176. data/lib/rubygems/specification.rb +37 -38
  177. data/lib/rubygems/specification_policy.rb +13 -13
  178. data/lib/rubygems/stub_specification.rb +5 -5
  179. data/lib/rubygems/tsort.rb +1 -1
  180. data/lib/rubygems/uninstaller.rb +14 -14
  181. data/lib/rubygems/uri.rb +4 -4
  182. data/lib/rubygems/uri_formatter.rb +1 -1
  183. data/lib/rubygems/user_interaction.rb +31 -17
  184. data/lib/rubygems/util/licenses.rb +3 -3
  185. data/lib/rubygems/util.rb +10 -10
  186. data/lib/rubygems/validator.rb +5 -5
  187. data/lib/rubygems/version.rb +3 -5
  188. data/lib/rubygems/version_option.rb +3 -3
  189. data/lib/rubygems.rb +59 -58
  190. data/rubygems-update.gemspec +2 -2
  191. data/setup.rb +9 -9
  192. data/test/rubygems/helper.rb +127 -127
  193. data/test/rubygems/installer_test_case.rb +13 -13
  194. data/test/rubygems/package/tar_test_case.rb +2 -2
  195. data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
  196. data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
  197. data/test/rubygems/rubygems_plugin.rb +2 -2
  198. data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +4 -4
  199. data/test/rubygems/test_bundled_ca.rb +10 -10
  200. data/test/rubygems/test_config.rb +3 -3
  201. data/test/rubygems/test_deprecate.rb +3 -3
  202. data/test/rubygems/test_exit.rb +2 -2
  203. data/test/rubygems/test_gem.rb +342 -342
  204. data/test/rubygems/test_gem_available_set.rb +21 -21
  205. data/test/rubygems/test_gem_bundler_version_finder.rb +1 -1
  206. data/test/rubygems/test_gem_command.rb +44 -44
  207. data/test/rubygems/test_gem_command_manager.rb +29 -29
  208. data/test/rubygems/test_gem_commands_build_command.rb +63 -63
  209. data/test/rubygems/test_gem_commands_cert_command.rb +97 -99
  210. data/test/rubygems/test_gem_commands_check_command.rb +4 -4
  211. data/test/rubygems/test_gem_commands_cleanup_command.rb +40 -40
  212. data/test/rubygems/test_gem_commands_contents_command.rb +27 -27
  213. data/test/rubygems/test_gem_commands_dependency_command.rb +36 -36
  214. data/test/rubygems/test_gem_commands_environment_command.rb +16 -16
  215. data/test/rubygems/test_gem_commands_fetch_command.rb +37 -37
  216. data/test/rubygems/test_gem_commands_generate_index_command.rb +7 -7
  217. data/test/rubygems/test_gem_commands_help_command.rb +13 -13
  218. data/test/rubygems/test_gem_commands_info_command.rb +2 -2
  219. data/test/rubygems/test_gem_commands_install_command.rb +131 -131
  220. data/test/rubygems/test_gem_commands_list_command.rb +4 -4
  221. data/test/rubygems/test_gem_commands_lock_command.rb +10 -10
  222. data/test/rubygems/test_gem_commands_mirror.rb +2 -2
  223. data/test/rubygems/test_gem_commands_open_command.rb +4 -4
  224. data/test/rubygems/test_gem_commands_outdated_command.rb +9 -9
  225. data/test/rubygems/test_gem_commands_owner_command.rb +41 -41
  226. data/test/rubygems/test_gem_commands_pristine_command.rb +92 -92
  227. data/test/rubygems/test_gem_commands_push_command.rb +54 -54
  228. data/test/rubygems/test_gem_commands_query_command.rb +73 -73
  229. data/test/rubygems/test_gem_commands_search_command.rb +2 -2
  230. data/test/rubygems/test_gem_commands_server_command.rb +2 -2
  231. data/test/rubygems/test_gem_commands_setup_command.rb +119 -85
  232. data/test/rubygems/test_gem_commands_signin_command.rb +45 -31
  233. data/test/rubygems/test_gem_commands_signout_command.rb +3 -3
  234. data/test/rubygems/test_gem_commands_sources_command.rb +28 -29
  235. data/test/rubygems/test_gem_commands_specification_command.rb +32 -32
  236. data/test/rubygems/test_gem_commands_stale_command.rb +4 -4
  237. data/test/rubygems/test_gem_commands_uninstall_command.rb +75 -75
  238. data/test/rubygems/test_gem_commands_unpack_command.rb +31 -31
  239. data/test/rubygems/test_gem_commands_update_command.rb +89 -89
  240. data/test/rubygems/test_gem_commands_which_command.rb +6 -6
  241. data/test/rubygems/test_gem_commands_yank_command.rb +40 -40
  242. data/test/rubygems/test_gem_config_file.rb +77 -77
  243. data/test/rubygems/test_gem_dependency.rb +73 -73
  244. data/test/rubygems/test_gem_dependency_installer.rb +165 -165
  245. data/test/rubygems/test_gem_dependency_list.rb +47 -47
  246. data/test/rubygems/test_gem_dependency_resolution_error.rb +4 -4
  247. data/test/rubygems/test_gem_doctor.rb +26 -26
  248. data/test/rubygems/test_gem_ext_builder.rb +59 -59
  249. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +6 -6
  250. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  251. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +8 -8
  252. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +1 -1
  253. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +6 -6
  254. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  255. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +8 -8
  256. data/test/rubygems/test_gem_ext_cargo_builder.rb +26 -26
  257. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +3 -3
  258. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +23 -23
  259. data/test/rubygems/test_gem_ext_cmake_builder.rb +15 -15
  260. data/test/rubygems/test_gem_ext_configure_builder.rb +13 -13
  261. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +51 -52
  262. data/test/rubygems/test_gem_ext_rake_builder.rb +15 -15
  263. data/test/rubygems/test_gem_gem_runner.rb +7 -7
  264. data/test/rubygems/test_gem_gemcutter_utilities.rb +66 -66
  265. data/test/rubygems/test_gem_impossible_dependencies_error.rb +4 -4
  266. data/test/rubygems/test_gem_indexer.rb +48 -48
  267. data/test/rubygems/test_gem_install_update_options.rb +16 -16
  268. data/test/rubygems/test_gem_installer.rb +297 -297
  269. data/test/rubygems/test_gem_local_remote_options.rb +10 -10
  270. data/test/rubygems/test_gem_name_tuple.rb +4 -4
  271. data/test/rubygems/test_gem_package.rb +206 -206
  272. data/test/rubygems/test_gem_package_old.rb +13 -13
  273. data/test/rubygems/test_gem_package_tar_header.rb +42 -42
  274. data/test/rubygems/test_gem_package_tar_reader.rb +7 -7
  275. data/test/rubygems/test_gem_package_tar_reader_entry.rb +10 -10
  276. data/test/rubygems/test_gem_package_tar_writer.rb +76 -76
  277. data/test/rubygems/test_gem_package_task.rb +18 -18
  278. data/test/rubygems/test_gem_path_support.rb +14 -14
  279. data/test/rubygems/test_gem_platform.rb +227 -227
  280. data/test/rubygems/test_gem_rdoc.rb +14 -14
  281. data/test/rubygems/test_gem_remote_fetcher.rb +149 -149
  282. data/test/rubygems/test_gem_request.rb +55 -55
  283. data/test/rubygems/test_gem_request_connection_pools.rb +29 -29
  284. data/test/rubygems/test_gem_request_set.rb +99 -99
  285. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +204 -206
  286. data/test/rubygems/test_gem_request_set_lockfile.rb +86 -86
  287. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +56 -56
  288. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +62 -62
  289. data/test/rubygems/test_gem_requirement.rb +38 -38
  290. data/test/rubygems/test_gem_resolver.rb +98 -98
  291. data/test/rubygems/test_gem_resolver_activation_request.rb +6 -6
  292. data/test/rubygems/test_gem_resolver_api_set.rb +33 -33
  293. data/test/rubygems/test_gem_resolver_api_specification.rb +47 -47
  294. data/test/rubygems/test_gem_resolver_best_set.rb +22 -22
  295. data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
  296. data/test/rubygems/test_gem_resolver_conflict.rb +12 -12
  297. data/test/rubygems/test_gem_resolver_dependency_request.rb +15 -15
  298. data/test/rubygems/test_gem_resolver_git_set.rb +21 -21
  299. data/test/rubygems/test_gem_resolver_git_specification.rb +21 -21
  300. data/test/rubygems/test_gem_resolver_index_set.rb +12 -12
  301. data/test/rubygems/test_gem_resolver_index_specification.rb +15 -15
  302. data/test/rubygems/test_gem_resolver_installed_specification.rb +5 -5
  303. data/test/rubygems/test_gem_resolver_installer_set.rb +34 -34
  304. data/test/rubygems/test_gem_resolver_local_specification.rb +7 -7
  305. data/test/rubygems/test_gem_resolver_lock_set.rb +12 -12
  306. data/test/rubygems/test_gem_resolver_lock_specification.rb +17 -17
  307. data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
  308. data/test/rubygems/test_gem_resolver_specification.rb +8 -8
  309. data/test/rubygems/test_gem_resolver_vendor_set.rb +6 -6
  310. data/test/rubygems/test_gem_resolver_vendor_specification.rb +10 -10
  311. data/test/rubygems/test_gem_security.rb +67 -67
  312. data/test/rubygems/test_gem_security_policy.rb +62 -62
  313. data/test/rubygems/test_gem_security_signer.rb +28 -28
  314. data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
  315. data/test/rubygems/test_gem_silent_ui.rb +38 -32
  316. data/test/rubygems/test_gem_source.rb +44 -44
  317. data/test/rubygems/test_gem_source_fetch_problem.rb +9 -9
  318. data/test/rubygems/test_gem_source_git.rb +59 -59
  319. data/test/rubygems/test_gem_source_installed.rb +16 -16
  320. data/test/rubygems/test_gem_source_list.rb +5 -5
  321. data/test/rubygems/test_gem_source_local.rb +14 -14
  322. data/test/rubygems/test_gem_source_lock.rb +31 -31
  323. data/test/rubygems/test_gem_source_specific_file.rb +17 -17
  324. data/test/rubygems/test_gem_source_subpath_problem.rb +7 -7
  325. data/test/rubygems/test_gem_source_vendor.rb +13 -13
  326. data/test/rubygems/test_gem_spec_fetcher.rb +72 -72
  327. data/test/rubygems/test_gem_specification.rb +434 -435
  328. data/test/rubygems/test_gem_stream_ui.rb +19 -19
  329. data/test/rubygems/test_gem_stub_specification.rb +32 -32
  330. data/test/rubygems/test_gem_text.rb +1 -1
  331. data/test/rubygems/test_gem_uninstaller.rb +112 -112
  332. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +3 -3
  333. data/test/rubygems/test_gem_uri.rb +4 -4
  334. data/test/rubygems/test_gem_uri_formatter.rb +14 -14
  335. data/test/rubygems/test_gem_util.rb +23 -23
  336. data/test/rubygems/test_gem_validator.rb +8 -8
  337. data/test/rubygems/test_gem_version.rb +13 -13
  338. data/test/rubygems/test_gem_version_option.rb +15 -15
  339. data/test/rubygems/test_kernel.rb +31 -31
  340. data/test/rubygems/test_project_sanity.rb +1 -1
  341. data/test/rubygems/test_remote_fetch_error.rb +6 -6
  342. data/test/rubygems/test_require.rb +42 -42
  343. data/test/rubygems/test_rubygems.rb +8 -8
  344. data/test/rubygems/utilities.rb +17 -17
  345. metadata +4 -3
@@ -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" "June 2022" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "July 2022" "" ""
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" "June 2022" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "July 2022" "" ""
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" "June 2022" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "July 2022" "" ""
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" "June 2022" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "July 2022" "" ""
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" "June 2022" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "July 2022" "" ""
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\-PRISTINE" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "July 2022" "" ""
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" "June 2022" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "July 2022" "" ""
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" "June 2022" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "July 2022" "" ""
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" "June 2022" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "July 2022" "" ""
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\-VIZ" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -15,6 +15,9 @@
15
15
  .P
16
16
  The associated gems must also be installed via \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR\.
17
17
  .
18
+ .P
19
+ \fBviz\fR command was deprecated in Bundler 2\.2\. Use bundler\-graph plugin \fIhttps://github\.com/rubygems/bundler\-graph\fR instead\.
20
+ .
18
21
  .SH "OPTIONS"
19
22
  .
20
23
  .TP
@@ -16,6 +16,8 @@ bundle-viz(1) -- Generates a visual dependency graph for your Gemfile
16
16
 
17
17
  The associated gems must also be installed via [`bundle install(1)`](bundle-install.1.html).
18
18
 
19
+ `viz` command was deprecated in Bundler 2.2. Use [bundler-graph plugin](https://github.com/rubygems/bundler-graph) instead.
20
+
19
21
  ## OPTIONS
20
22
 
21
23
  * `--file`, `-f`:
@@ -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" "June 2022" "" ""
4
+ .TH "BUNDLE" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -93,7 +93,7 @@ Open an installed gem in the editor
93
93
  Generate a lockfile for your dependencies
94
94
  .
95
95
  .TP
96
- \fBbundle viz(1)\fR \fIbundle\-viz\.1\.html\fR
96
+ \fBbundle viz(1)\fR \fIbundle\-viz\.1\.html\fR (deprecated)
97
97
  Generate a visual representation of your dependencies
98
98
  .
99
99
  .TP
@@ -130,7 +130,7 @@ These commands are obsolete and should no longer be used:
130
130
  \fBbundle cache(1)\fR
131
131
  .
132
132
  .IP "\(bu" 4
133
- \fBbundle show(1)\fR
133
+ \fBbundle inject(1)\fR
134
134
  .
135
135
  .IP "" 0
136
136
 
@@ -76,7 +76,7 @@ We divide `bundle` subcommands into primary commands and utilities:
76
76
  * [`bundle lock(1)`](bundle-lock.1.html):
77
77
  Generate a lockfile for your dependencies
78
78
 
79
- * [`bundle viz(1)`](bundle-viz.1.html):
79
+ * [`bundle viz(1)`](bundle-viz.1.html) (deprecated):
80
80
  Generate a visual representation of your dependencies
81
81
 
82
82
  * [`bundle init(1)`](bundle-init.1.html):
@@ -108,4 +108,4 @@ and execute it, passing down any extra arguments to it.
108
108
  These commands are obsolete and should no longer be used:
109
109
 
110
110
  * `bundle cache(1)`
111
- * `bundle show(1)`
111
+ * `bundle inject(1)`
@@ -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" "June 2022" "" ""
4
+ .TH "GEMFILE" "5" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -15,8 +15,8 @@ Place the \fBGemfile\fR in the root of the directory containing the associated c
15
15
  .SH "SYNTAX"
16
16
  A \fBGemfile\fR is evaluated as Ruby code, in a context which makes available a number of methods used to describe the gem requirements\.
17
17
  .
18
- .SH "GLOBAL SOURCES"
19
- At the top of the \fBGemfile\fR, add a line for the \fBRubygems\fR source that contains the gems listed in the \fBGemfile\fR\.
18
+ .SH "GLOBAL SOURCE"
19
+ At the top of the \fBGemfile\fR, add a single line for the \fBRubyGems\fR source that contains the gems listed in the \fBGemfile\fR\.
20
20
  .
21
21
  .IP "" 4
22
22
  .
@@ -29,10 +29,16 @@ source "https://rubygems\.org"
29
29
  .IP "" 0
30
30
  .
31
31
  .P
32
- It is possible, but not recommended as of Bundler 1\.7, to add multiple global \fBsource\fR lines\. Each of these \fBsource\fRs \fBMUST\fR be a valid Rubygems repository\.
32
+ You can add only one global source\. In Bundler 1\.13, adding multiple global sources was deprecated\. The \fBsource\fR \fBMUST\fR be a valid RubyGems repository\.
33
33
  .
34
34
  .P
35
- Sources are checked for gems following the heuristics described in \fISOURCE PRIORITY\fR\. If a gem is found in more than one global source, Bundler will print a warning after installing the gem indicating which source was used, and listing the other sources where the gem is available\. A specific source can be selected for gems that need to use a non\-standard repository, suppressing this warning, by using the \fI\fB:source\fR option\fR or a \fI\fBsource\fR block\fR\.
35
+ To use more than one source of RubyGems, you should use \fI\fBsource\fR block\fR\.
36
+ .
37
+ .P
38
+ A source is checked for gems following the heuristics described in \fISOURCE PRIORITY\fR\.
39
+ .
40
+ .P
41
+ \fBNote about a behavior of the feature deprecated in Bundler 1\.13\fR: If a gem is found in more than one global source, Bundler will print a warning after installing the gem indicating which source was used, and listing the other sources where the gem is available\. A specific source can be selected for gems that need to use a non\-standard repository, suppressing this warning, by using the \fI\fB:source\fR option\fR or \fBsource\fR block\.
36
42
  .
37
43
  .SS "CREDENTIALS"
38
44
  Some gem sources require a username and password\. Use bundle config(1) \fIbundle\-config\.1\.html\fR to set the username and password for any of the sources that need it\. The command must be run once on each computer that will install the Gemfile, but this keeps the credentials from being stored in plain text in version control\.
@@ -356,7 +362,7 @@ The platform specific variant does not yet support a newer ruby (and thus has a
356
362
  .IP "" 0
357
363
  .
358
364
  .SS "SOURCE"
359
- You can select an alternate Rubygems repository for a gem using the \':source\' option\.
365
+ You can select an alternate RubyGems repository for a gem using the \':source\' option\.
360
366
  .
361
367
  .IP "" 4
362
368
  .
@@ -369,13 +375,13 @@ gem "some_internal_gem", source: "https://gems\.example\.com"
369
375
  .IP "" 0
370
376
  .
371
377
  .P
372
- This forces the gem to be loaded from this source and ignores any global sources declared at the top level of the file\. If the gem does not exist in this source, it will not be installed\.
378
+ This forces the gem to be loaded from this source and ignores the global source declared at the top level of the file\. If the gem does not exist in this source, it will not be installed\.
373
379
  .
374
380
  .P
375
- Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall back on global sources using the ordering described in \fISOURCE PRIORITY\fR\.
381
+ Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall back on the global source\.
376
382
  .
377
383
  .P
378
- Selecting a specific source repository this way also suppresses the ambiguous gem warning described above in \fIGLOBAL SOURCES (#source)\fR\.
384
+ \fBNote about a behavior of the feature deprecated in Bundler 1\.13\fR: Selecting a specific source repository this way also suppresses the ambiguous gem warning described above in \fIGLOBAL SOURCE\fR\.
379
385
  .
380
386
  .P
381
387
  Using the \fB:source\fR option for an individual gem will also make that source available as a possible global source for any other gems which do not specify explicit sources\. Thus, when adding gems with explicit sources, it is recommended that you also ensure all other gems in the Gemfile are using explicit sources\.
@@ -730,7 +736,7 @@ The source explicitly attached to the gem (using \fB:source\fR, \fB:path\fR, or
730
736
  For implicit gems (dependencies of explicit gems), any source, git, or path repository declared on the parent\. This results in bundler prioritizing the ActiveSupport gem from the Rails git repository over ones from \fBrubygems\.org\fR
731
737
  .
732
738
  .IP "3." 4
733
- The sources specified via global \fBsource\fR lines, searching each source in your \fBGemfile\fR from last added to first added\.
739
+ If neither of the above conditions are met, the global source will be used\. If multiple global sources are specified, they will be prioritized from last to first, but this is deprecated since Bundler 1\.13, so Bundler prints a warning and will abort with an error in the future\.
734
740
  .
735
741
  .IP "" 0
736
742
 
@@ -15,23 +15,28 @@ directory as the `Rakefile`.
15
15
  A `Gemfile` is evaluated as Ruby code, in a context which makes available
16
16
  a number of methods used to describe the gem requirements.
17
17
 
18
- ## GLOBAL SOURCES
18
+ ## GLOBAL SOURCE
19
19
 
20
- At the top of the `Gemfile`, add a line for the `Rubygems` source that contains
21
- the gems listed in the `Gemfile`.
20
+ At the top of the `Gemfile`, add a single line for the `RubyGems` source that
21
+ contains the gems listed in the `Gemfile`.
22
22
 
23
23
  source "https://rubygems.org"
24
24
 
25
- It is possible, but not recommended as of Bundler 1.7, to add multiple global
26
- `source` lines. Each of these `source`s `MUST` be a valid Rubygems repository.
25
+ You can add only one global source. In Bundler 1.13, adding multiple global
26
+ sources was deprecated. The `source` `MUST` be a valid RubyGems repository.
27
27
 
28
- Sources are checked for gems following the heuristics described in
29
- [SOURCE PRIORITY][]. If a gem is found in more than one global source, Bundler
28
+ To use more than one source of RubyGems, you should use [`source` block
29
+ ](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
30
+
31
+ A source is checked for gems following the heuristics described in
32
+ [SOURCE PRIORITY][].
33
+
34
+ **Note about a behavior of the feature deprecated in Bundler 1.13**:
35
+ If a gem is found in more than one global source, Bundler
30
36
  will print a warning after installing the gem indicating which source was used,
31
37
  and listing the other sources where the gem is available. A specific source can
32
38
  be selected for gems that need to use a non-standard repository, suppressing
33
- this warning, by using the [`:source` option](#SOURCE) or a
34
- [`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
39
+ this warning, by using the [`:source` option](#SOURCE) or `source` block.
35
40
 
36
41
  ### CREDENTIALS
37
42
 
@@ -247,22 +252,22 @@ This can be handy (assuming the pure ruby variant works fine) when:
247
252
 
248
253
  ### SOURCE
249
254
 
250
- You can select an alternate Rubygems repository for a gem using the ':source'
255
+ You can select an alternate RubyGems repository for a gem using the ':source'
251
256
  option.
252
257
 
253
258
  gem "some_internal_gem", source: "https://gems.example.com"
254
259
 
255
- This forces the gem to be loaded from this source and ignores any global sources
260
+ This forces the gem to be loaded from this source and ignores the global source
256
261
  declared at the top level of the file. If the gem does not exist in this source,
257
262
  it will not be installed.
258
263
 
259
264
  Bundler will search for child dependencies of this gem by first looking in the
260
265
  source selected for the parent, but if they are not found there, it will fall
261
- back on global sources using the ordering described in [SOURCE PRIORITY][].
266
+ back on the global source.
262
267
 
268
+ **Note about a behavior of the feature deprecated in Bundler 1.13**:
263
269
  Selecting a specific source repository this way also suppresses the ambiguous
264
- gem warning described above in
265
- [GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
270
+ gem warning described above in [GLOBAL SOURCE](#GLOBAL-SOURCE).
266
271
 
267
272
  Using the `:source` option for an individual gem will also make that source
268
273
  available as a possible global source for any other gems which do not specify
@@ -535,5 +540,7 @@ bundler uses the following priority order:
535
540
  repository declared on the parent. This results in bundler prioritizing the
536
541
  ActiveSupport gem from the Rails git repository over ones from
537
542
  `rubygems.org`
538
- 3. The sources specified via global `source` lines, searching each source in
539
- your `Gemfile` from last added to first added.
543
+ 3. If neither of the above conditions are met, the global source will be used.
544
+ If multiple global sources are specified, they will be prioritized from
545
+ last to first, but this is deprecated since Bundler 1.13, so Bundler prints
546
+ a warning and will abort with an error in the future.
@@ -16,7 +16,8 @@ module Bundler
16
16
  def initialize(name, version, platform, spec_fetcher)
17
17
  @name = name
18
18
  @version = Gem::Version.create version
19
- @platform = platform
19
+ @original_platform = platform || Gem::Platform::RUBY
20
+ @platform = Gem::Platform.new(platform)
20
21
  @spec_fetcher = spec_fetcher
21
22
  @dependencies = nil
22
23
  end
@@ -35,10 +36,10 @@ module Bundler
35
36
  end
36
37
 
37
38
  def full_name
38
- if platform == Gem::Platform::RUBY || platform.nil?
39
+ if @original_platform == Gem::Platform::RUBY
39
40
  "#{@name}-#{@version}"
40
41
  else
41
- "#{@name}-#{@version}-#{platform}"
42
+ "#{@name}-#{@version}-#{@original_platform}"
42
43
  end
43
44
  end
44
45
 
@@ -105,7 +106,7 @@ module Bundler
105
106
  end
106
107
 
107
108
  def _remote_specification
108
- @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
109
+ @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @original_platform])
109
110
  @_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \
110
111
  " missing from the server! Try installing with `--full-index` as a workaround.")
111
112
  end
@@ -22,17 +22,16 @@ module Bundler
22
22
  metadata_requirements, regular_requirements = requirements.partition {|dep| dep.name.end_with?("\0") }
23
23
  resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
24
24
  result = resolver.start(requirements)
25
- SpecSet.new(SpecSet.new(result).for(regular_requirements))
25
+ SpecSet.new(SpecSet.new(result).for(regular_requirements, false, platforms))
26
26
  end
27
27
 
28
28
  def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
29
29
  @source_requirements = source_requirements
30
30
  @metadata_requirements = metadata_requirements
31
- @base = base
32
31
  @resolver = Molinillo::Resolver.new(self, self)
33
32
  @search_for = {}
34
33
  @base_dg = Molinillo::DependencyGraph.new
35
- @base.each do |ls|
34
+ @base = base.materialized_for_resolution do |ls|
36
35
  dep = Dependency.new(ls.name, ls.version)
37
36
  @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
38
37
  end
@@ -111,7 +110,7 @@ module Bundler
111
110
  dependency = dependency_proxy.dep
112
111
  name = dependency.name
113
112
  @search_for[dependency_proxy] ||= begin
114
- results = results_for(dependency, @base[name])
113
+ results = results_for(dependency) + @base[name].select {|spec| requirement_satisfied_by?(dependency, nil, spec) }
115
114
 
116
115
  if vertex = @base_dg.vertex_named(name)
117
116
  locked_requirement = vertex.payload.requirement
@@ -176,8 +175,8 @@ module Bundler
176
175
  @source_requirements[name] || @source_requirements[:default]
177
176
  end
178
177
 
179
- def results_for(dependency, base)
180
- index_for(dependency).search(dependency, base)
178
+ def results_for(dependency)
179
+ index_for(dependency).search(dependency)
181
180
  end
182
181
 
183
182
  def name_for(dependency)
@@ -25,7 +25,7 @@ module Bundler
25
25
 
26
26
  extract_files
27
27
 
28
- build_extensions
28
+ build_extensions if spec.extensions.any?
29
29
  write_build_info_file
30
30
  run_post_build_hooks
31
31
 
@@ -66,26 +66,26 @@ module Bundler
66
66
 
67
67
  def build_extensions
68
68
  extension_cache_path = options[:bundler_extension_cache_path]
69
- unless extension_cache_path && extension_dir = spec.extension_dir
70
- require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
69
+ extension_dir = spec.extension_dir
70
+ unless extension_cache_path && extension_dir
71
+ prepare_extension_build(extension_dir)
71
72
  return super
72
73
  end
73
74
 
74
- extension_dir = Pathname.new(extension_dir)
75
75
  build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
76
76
  if build_complete && !options[:force]
77
- SharedHelpers.filesystem_access(extension_dir.parent, &:mkpath)
77
+ SharedHelpers.filesystem_access(File.dirname(extension_dir)) do |p|
78
+ FileUtils.mkpath p
79
+ end
78
80
  SharedHelpers.filesystem_access(extension_cache_path) do
79
- FileUtils.cp_r extension_cache_path, spec.extension_dir
81
+ FileUtils.cp_r extension_cache_path, extension_dir
80
82
  end
81
83
  else
82
- require "shellwords" # compensate missing require in rubygems before version 3.2.25
84
+ prepare_extension_build(extension_dir)
83
85
  super
84
- if extension_dir.directory? # not made for gems without extensions
85
- SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
86
- SharedHelpers.filesystem_access(extension_cache_path) do
87
- FileUtils.cp_r extension_dir, extension_cache_path
88
- end
86
+ SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
87
+ SharedHelpers.filesystem_access(extension_cache_path) do
88
+ FileUtils.cp_r extension_dir, extension_cache_path
89
89
  end
90
90
  end
91
91
  end
@@ -100,6 +100,13 @@ module Bundler
100
100
 
101
101
  private
102
102
 
103
+ def prepare_extension_build(extension_dir)
104
+ SharedHelpers.filesystem_access(extension_dir, :create) do
105
+ FileUtils.mkdir_p extension_dir
106
+ end
107
+ require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
108
+ end
109
+
103
110
  def strict_rm_rf(dir)
104
111
  Bundler.rm_rf dir
105
112
  rescue Errno::ENOTEMPTY => e
@@ -57,6 +57,7 @@ module Bundler
57
57
  ].freeze
58
58
 
59
59
  ARRAY_KEYS = %w[
60
+ only
60
61
  with
61
62
  without
62
63
  ].freeze
@@ -11,30 +11,27 @@ module Bundler
11
11
  @specs = specs
12
12
  end
13
13
 
14
- def for(dependencies, check = false, match_current_platform = false)
15
- # dep.name => [list, of, deps]
16
- handled = Hash.new {|h, k| h[k] = [] }
17
- deps = dependencies.dup
14
+ def for(dependencies, check = false, platforms = [nil])
15
+ handled = ["bundler"].product(platforms).map {|k| [k, true] }.to_h
16
+ deps = dependencies.product(platforms).map {|dep, platform| [dep.name, platform && dep.force_ruby_platform ? Gem::Platform::RUBY : platform] }
18
17
  specs = []
19
18
 
20
19
  loop do
21
20
  break unless dep = deps.shift
22
- next if handled[dep.name].any? {|d| match_current_platform || d.__platform == dep.__platform } || dep.name == "bundler"
21
+ next if handled.key?(dep)
23
22
 
24
- # use a hash here to ensure constant lookup time in the `any?` call above
25
- handled[dep.name] << dep
23
+ handled[dep] = true
26
24
 
27
- specs_for_dep = specs_for_dependency(dep, match_current_platform)
25
+ specs_for_dep = specs_for_dependency(*dep)
28
26
  if specs_for_dep.any?
29
27
  specs.concat(specs_for_dep)
30
28
 
31
29
  specs_for_dep.first.dependencies.each do |d|
32
30
  next if d.type == :development
33
- d = DepProxy.get_proxy(Dependency.new(d.name, d.requirement), dep.__platform) unless match_current_platform
34
- deps << d
31
+ deps << [d.name, dep[1]]
35
32
  end
36
33
  elsif check
37
- return false
34
+ specs << IncompleteSpecification.new(*dep)
38
35
  end
39
36
  end
40
37
 
@@ -42,9 +39,7 @@ module Bundler
42
39
  specs << spec
43
40
  end
44
41
 
45
- specs.uniq! unless match_current_platform
46
-
47
- check ? true : specs
42
+ specs
48
43
  end
49
44
 
50
45
  def [](key)
@@ -71,12 +66,12 @@ module Bundler
71
66
  end
72
67
 
73
68
  def materialize(deps)
74
- materialized = self.for(deps, false, true)
69
+ materialized = self.for(deps, true).uniq
75
70
 
76
71
  materialized.map! do |s|
77
72
  next s unless s.is_a?(LazySpecification)
78
73
  s.source.local!
79
- s.__materialize__ || s
74
+ s.materialize_for_installation || s
80
75
  end
81
76
  SpecSet.new(materialized)
82
77
  end
@@ -89,16 +84,29 @@ module Bundler
89
84
  next s unless s.is_a?(LazySpecification)
90
85
  s.source.local!
91
86
  s.source.remote!
92
- spec = s.__materialize__
87
+ spec = s.materialize_for_installation
93
88
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
94
89
  spec
95
90
  end
96
91
  end
97
92
 
93
+ def materialized_for_resolution
94
+ materialized = @specs.map do |s|
95
+ spec = s.materialize_for_resolution
96
+ yield spec if spec
97
+ spec
98
+ end.compact
99
+ SpecSet.new(materialized)
100
+ end
101
+
98
102
  def missing_specs
99
103
  @specs.select {|s| s.is_a?(LazySpecification) }
100
104
  end
101
105
 
106
+ def incomplete_specs
107
+ @specs.select {|s| s.is_a?(IncompleteSpecification) }
108
+ end
109
+
102
110
  def merge(set)
103
111
  arr = sorted.dup
104
112
  set.each do |set_spec|
@@ -173,12 +181,12 @@ module Bundler
173
181
  @specs.sort_by(&:name).each {|s| yield s }
174
182
  end
175
183
 
176
- def specs_for_dependency(dep, match_current_platform)
177
- specs_for_name = lookup[dep.name]
178
- if match_current_platform
184
+ def specs_for_dependency(name, platform)
185
+ specs_for_name = lookup[name]
186
+ if platform.nil?
179
187
  GemHelpers.select_best_platform_match(specs_for_name.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
180
188
  else
181
- specs_for_name_and_platform = GemHelpers.select_best_platform_match(specs_for_name, dep.force_ruby_platform ? Gem::Platform::RUBY : dep.__platform)
189
+ specs_for_name_and_platform = GemHelpers.select_best_platform_match(specs_for_name, platform)
182
190
  specs_for_name_and_platform.any? ? specs_for_name_and_platform : specs_for_name
183
191
  end
184
192
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.18".freeze
4
+ VERSION = "2.3.19".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -53,6 +53,7 @@ module Bundler
53
53
  autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
54
54
  autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
55
55
  autoload :Graph, File.expand_path("bundler/graph", __dir__)
56
+ autoload :IncompleteSpecification, File.expand_path("bundler/incomplete_specification", __dir__)
56
57
  autoload :Index, File.expand_path("bundler/index", __dir__)
57
58
  autoload :Injector, File.expand_path("bundler/injector", __dir__)
58
59
  autoload :Installer, File.expand_path("bundler/installer", __dir__)
@@ -47,7 +47,7 @@ class Gem::BasicSpecification
47
47
  # directory.
48
48
 
49
49
  def gem_build_complete_path # :nodoc:
50
- File.join extension_dir, 'gem.build_complete'
50
+ File.join extension_dir, "gem.build_complete"
51
51
  end
52
52
 
53
53
  ##
@@ -103,7 +103,7 @@ class Gem::BasicSpecification
103
103
 
104
104
  def extensions_dir
105
105
  Gem.default_ext_dir_for(base_dir) ||
106
- File.join(base_dir, 'extensions', Gem::Platform.local.to_s,
106
+ File.join(base_dir, "extensions", Gem::Platform.local.to_s,
107
107
  Gem.extension_api_version)
108
108
  end
109
109