rubygems-update 2.5.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (322) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +46 -0
  3. data/CONTRIBUTING.rdoc +98 -27
  4. data/History.txt +44 -1
  5. data/MAINTAINERS.md +4 -0
  6. data/Manifest.txt +4 -0
  7. data/POLICIES.rdoc +61 -0
  8. data/appveyor.yml +6 -1
  9. data/lib/gauntlet_rubygems.rb +1 -0
  10. data/lib/rubygems.rb +3 -2
  11. data/lib/rubygems/available_set.rb +1 -0
  12. data/lib/rubygems/basic_specification.rb +4 -4
  13. data/lib/rubygems/command.rb +7 -2
  14. data/lib/rubygems/command_manager.rb +1 -0
  15. data/lib/rubygems/commands/build_command.rb +5 -0
  16. data/lib/rubygems/commands/cert_command.rb +1 -0
  17. data/lib/rubygems/commands/check_command.rb +1 -0
  18. data/lib/rubygems/commands/cleanup_command.rb +1 -0
  19. data/lib/rubygems/commands/contents_command.rb +1 -0
  20. data/lib/rubygems/commands/dependency_command.rb +3 -2
  21. data/lib/rubygems/commands/environment_command.rb +3 -3
  22. data/lib/rubygems/commands/fetch_command.rb +1 -0
  23. data/lib/rubygems/commands/generate_index_command.rb +1 -0
  24. data/lib/rubygems/commands/help_command.rb +1 -0
  25. data/lib/rubygems/commands/install_command.rb +1 -0
  26. data/lib/rubygems/commands/list_command.rb +1 -0
  27. data/lib/rubygems/commands/lock_command.rb +1 -0
  28. data/lib/rubygems/commands/mirror_command.rb +1 -0
  29. data/lib/rubygems/commands/open_command.rb +1 -0
  30. data/lib/rubygems/commands/outdated_command.rb +1 -0
  31. data/lib/rubygems/commands/owner_command.rb +1 -0
  32. data/lib/rubygems/commands/pristine_command.rb +1 -0
  33. data/lib/rubygems/commands/push_command.rb +1 -0
  34. data/lib/rubygems/commands/query_command.rb +12 -5
  35. data/lib/rubygems/commands/rdoc_command.rb +1 -0
  36. data/lib/rubygems/commands/search_command.rb +1 -0
  37. data/lib/rubygems/commands/server_command.rb +1 -0
  38. data/lib/rubygems/commands/setup_command.rb +1 -0
  39. data/lib/rubygems/commands/sources_command.rb +1 -0
  40. data/lib/rubygems/commands/specification_command.rb +1 -0
  41. data/lib/rubygems/commands/stale_command.rb +1 -0
  42. data/lib/rubygems/commands/uninstall_command.rb +1 -0
  43. data/lib/rubygems/commands/unpack_command.rb +1 -0
  44. data/lib/rubygems/commands/update_command.rb +1 -0
  45. data/lib/rubygems/commands/which_command.rb +1 -0
  46. data/lib/rubygems/commands/yank_command.rb +11 -15
  47. data/lib/rubygems/compatibility.rb +1 -0
  48. data/lib/rubygems/config_file.rb +6 -4
  49. data/lib/rubygems/core_ext/kernel_gem.rb +1 -0
  50. data/lib/rubygems/core_ext/kernel_require.rb +1 -0
  51. data/lib/rubygems/defaults.rb +1 -0
  52. data/lib/rubygems/dependency.rb +3 -2
  53. data/lib/rubygems/dependency_installer.rb +1 -0
  54. data/lib/rubygems/dependency_list.rb +1 -0
  55. data/lib/rubygems/deprecate.rb +1 -0
  56. data/lib/rubygems/doctor.rb +1 -0
  57. data/lib/rubygems/errors.rb +1 -0
  58. data/lib/rubygems/exceptions.rb +2 -2
  59. data/lib/rubygems/ext.rb +1 -0
  60. data/lib/rubygems/ext/build_error.rb +1 -0
  61. data/lib/rubygems/ext/builder.rb +1 -0
  62. data/lib/rubygems/ext/cmake_builder.rb +1 -0
  63. data/lib/rubygems/ext/configure_builder.rb +1 -0
  64. data/lib/rubygems/ext/ext_conf_builder.rb +15 -4
  65. data/lib/rubygems/ext/rake_builder.rb +1 -0
  66. data/lib/rubygems/gem_runner.rb +1 -0
  67. data/lib/rubygems/gemcutter_utilities.rb +9 -3
  68. data/lib/rubygems/indexer.rb +1 -0
  69. data/lib/rubygems/install_default_message.rb +1 -0
  70. data/lib/rubygems/install_message.rb +1 -0
  71. data/lib/rubygems/install_update_options.rb +6 -0
  72. data/lib/rubygems/installer.rb +12 -5
  73. data/lib/rubygems/installer_test_case.rb +1 -0
  74. data/lib/rubygems/local_remote_options.rb +2 -1
  75. data/lib/rubygems/mock_gem_ui.rb +1 -0
  76. data/lib/rubygems/name_tuple.rb +2 -1
  77. data/lib/rubygems/package.rb +3 -2
  78. data/lib/rubygems/package/digest_io.rb +1 -0
  79. data/lib/rubygems/package/file_source.rb +1 -0
  80. data/lib/rubygems/package/io_source.rb +1 -0
  81. data/lib/rubygems/package/old.rb +4 -4
  82. data/lib/rubygems/package/source.rb +1 -0
  83. data/lib/rubygems/package/tar_header.rb +1 -0
  84. data/lib/rubygems/package/tar_reader.rb +1 -0
  85. data/lib/rubygems/package/tar_reader/entry.rb +1 -0
  86. data/lib/rubygems/package/tar_test_case.rb +1 -0
  87. data/lib/rubygems/package/tar_writer.rb +1 -0
  88. data/lib/rubygems/package_task.rb +1 -0
  89. data/lib/rubygems/path_support.rb +15 -5
  90. data/lib/rubygems/platform.rb +1 -0
  91. data/lib/rubygems/psych_additions.rb +1 -0
  92. data/lib/rubygems/psych_tree.rb +1 -0
  93. data/lib/rubygems/rdoc.rb +1 -0
  94. data/lib/rubygems/remote_fetcher.rb +1 -0
  95. data/lib/rubygems/request.rb +3 -2
  96. data/lib/rubygems/request/connection_pools.rb +1 -0
  97. data/lib/rubygems/request/http_pool.rb +1 -0
  98. data/lib/rubygems/request/https_pool.rb +1 -0
  99. data/lib/rubygems/request_set.rb +14 -8
  100. data/lib/rubygems/request_set/gem_dependency_api.rb +54 -6
  101. data/lib/rubygems/request_set/lockfile.rb +3 -3
  102. data/lib/rubygems/request_set/lockfile/parser.rb +18 -9
  103. data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -0
  104. data/lib/rubygems/requirement.rb +1 -0
  105. data/lib/rubygems/resolver.rb +2 -0
  106. data/lib/rubygems/resolver/activation_request.rb +18 -5
  107. data/lib/rubygems/resolver/api_set.rb +1 -0
  108. data/lib/rubygems/resolver/api_specification.rb +1 -0
  109. data/lib/rubygems/resolver/best_set.rb +1 -0
  110. data/lib/rubygems/resolver/composed_set.rb +1 -0
  111. data/lib/rubygems/resolver/conflict.rb +1 -0
  112. data/lib/rubygems/resolver/current_set.rb +1 -0
  113. data/lib/rubygems/resolver/dependency_request.rb +1 -0
  114. data/lib/rubygems/resolver/git_set.rb +1 -0
  115. data/lib/rubygems/resolver/git_specification.rb +1 -0
  116. data/lib/rubygems/resolver/index_set.rb +1 -0
  117. data/lib/rubygems/resolver/index_specification.rb +1 -0
  118. data/lib/rubygems/resolver/installed_specification.rb +1 -0
  119. data/lib/rubygems/resolver/installer_set.rb +1 -0
  120. data/lib/rubygems/resolver/local_specification.rb +1 -0
  121. data/lib/rubygems/resolver/lock_set.rb +4 -5
  122. data/lib/rubygems/resolver/lock_specification.rb +6 -2
  123. data/lib/rubygems/resolver/molinillo.rb +1 -0
  124. data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +5 -0
  125. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +10 -0
  126. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +6 -0
  127. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +3 -1
  128. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
  129. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +1 -0
  130. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +2 -0
  131. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -1
  132. data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +8 -7
  133. data/lib/rubygems/resolver/requirement_list.rb +1 -0
  134. data/lib/rubygems/resolver/set.rb +1 -0
  135. data/lib/rubygems/resolver/source_set.rb +48 -0
  136. data/lib/rubygems/resolver/spec_specification.rb +1 -0
  137. data/lib/rubygems/resolver/specification.rb +1 -0
  138. data/lib/rubygems/resolver/stats.rb +1 -0
  139. data/lib/rubygems/resolver/vendor_set.rb +1 -0
  140. data/lib/rubygems/resolver/vendor_specification.rb +1 -0
  141. data/lib/rubygems/security.rb +3 -2
  142. data/lib/rubygems/security/policies.rb +1 -0
  143. data/lib/rubygems/security/policy.rb +2 -2
  144. data/lib/rubygems/security/signer.rb +1 -0
  145. data/lib/rubygems/security/trust_dir.rb +1 -0
  146. data/lib/rubygems/server.rb +1 -0
  147. data/lib/rubygems/source.rb +1 -0
  148. data/lib/rubygems/source/git.rb +1 -0
  149. data/lib/rubygems/source/installed.rb +1 -0
  150. data/lib/rubygems/source/local.rb +1 -0
  151. data/lib/rubygems/source/lock.rb +1 -0
  152. data/lib/rubygems/source/specific_file.rb +1 -0
  153. data/lib/rubygems/source/vendor.rb +1 -0
  154. data/lib/rubygems/source_list.rb +2 -1
  155. data/lib/rubygems/source_local.rb +1 -0
  156. data/lib/rubygems/source_specific_file.rb +1 -0
  157. data/lib/rubygems/spec_fetcher.rb +1 -0
  158. data/lib/rubygems/specification.rb +11 -6
  159. data/lib/rubygems/stub_specification.rb +1 -0
  160. data/lib/rubygems/syck_hack.rb +1 -0
  161. data/lib/rubygems/test_case.rb +15 -3
  162. data/lib/rubygems/test_utilities.rb +1 -0
  163. data/lib/rubygems/text.rb +1 -1
  164. data/lib/rubygems/uninstaller.rb +1 -0
  165. data/lib/rubygems/uri_formatter.rb +1 -0
  166. data/lib/rubygems/user_interaction.rb +1 -0
  167. data/lib/rubygems/util.rb +2 -1
  168. data/lib/rubygems/util/licenses.rb +14 -0
  169. data/lib/rubygems/util/list.rb +1 -0
  170. data/lib/rubygems/validator.rb +1 -0
  171. data/lib/rubygems/version.rb +5 -1
  172. data/lib/rubygems/version_option.rb +1 -0
  173. data/lib/ubygems.rb +1 -0
  174. data/setup.rb +1 -0
  175. data/test/rubygems/bad_rake.rb +1 -0
  176. data/test/rubygems/bogussources.rb +1 -0
  177. data/test/rubygems/fake_certlib/openssl.rb +1 -0
  178. data/test/rubygems/fix_openssl_warnings.rb +1 -0
  179. data/test/rubygems/foo/discover.rb +1 -0
  180. data/test/rubygems/good_rake.rb +1 -0
  181. data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -0
  182. data/test/rubygems/plugin/load/rubygems_plugin.rb +1 -0
  183. data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -0
  184. data/test/rubygems/rubygems/commands/crash_command.rb +1 -0
  185. data/test/rubygems/rubygems_plugin.rb +1 -0
  186. data/test/rubygems/sff/discover.rb +1 -0
  187. data/test/rubygems/simple_gem.rb +1 -0
  188. data/test/rubygems/test_bundled_ca.rb +39 -40
  189. data/test/rubygems/test_config.rb +1 -0
  190. data/test/rubygems/test_deprecate.rb +1 -0
  191. data/test/rubygems/test_gem.rb +1 -1
  192. data/test/rubygems/test_gem_available_set.rb +1 -0
  193. data/test/rubygems/test_gem_command.rb +1 -0
  194. data/test/rubygems/test_gem_command_manager.rb +1 -0
  195. data/test/rubygems/test_gem_commands_build_command.rb +11 -0
  196. data/test/rubygems/test_gem_commands_cert_command.rb +1 -0
  197. data/test/rubygems/test_gem_commands_check_command.rb +1 -0
  198. data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -0
  199. data/test/rubygems/test_gem_commands_contents_command.rb +1 -0
  200. data/test/rubygems/test_gem_commands_dependency_command.rb +1 -0
  201. data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
  202. data/test/rubygems/test_gem_commands_fetch_command.rb +1 -0
  203. data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -0
  204. data/test/rubygems/test_gem_commands_help_command.rb +1 -0
  205. data/test/rubygems/test_gem_commands_install_command.rb +1 -0
  206. data/test/rubygems/test_gem_commands_list_command.rb +1 -0
  207. data/test/rubygems/test_gem_commands_lock_command.rb +1 -0
  208. data/test/rubygems/test_gem_commands_mirror.rb +1 -0
  209. data/test/rubygems/test_gem_commands_open_command.rb +1 -0
  210. data/test/rubygems/test_gem_commands_outdated_command.rb +1 -0
  211. data/test/rubygems/test_gem_commands_owner_command.rb +1 -0
  212. data/test/rubygems/test_gem_commands_pristine_command.rb +1 -0
  213. data/test/rubygems/test_gem_commands_push_command.rb +28 -0
  214. data/test/rubygems/test_gem_commands_query_command.rb +24 -0
  215. data/test/rubygems/test_gem_commands_search_command.rb +1 -0
  216. data/test/rubygems/test_gem_commands_server_command.rb +1 -0
  217. data/test/rubygems/test_gem_commands_setup_command.rb +1 -1
  218. data/test/rubygems/test_gem_commands_sources_command.rb +1 -0
  219. data/test/rubygems/test_gem_commands_specification_command.rb +1 -0
  220. data/test/rubygems/test_gem_commands_stale_command.rb +1 -0
  221. data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -0
  222. data/test/rubygems/test_gem_commands_unpack_command.rb +1 -0
  223. data/test/rubygems/test_gem_commands_update_command.rb +1 -0
  224. data/test/rubygems/test_gem_commands_which_command.rb +1 -0
  225. data/test/rubygems/test_gem_commands_yank_command.rb +13 -10
  226. data/test/rubygems/test_gem_config_file.rb +24 -0
  227. data/test/rubygems/test_gem_dependency.rb +1 -0
  228. data/test/rubygems/test_gem_dependency_installer.rb +1 -0
  229. data/test/rubygems/test_gem_dependency_list.rb +1 -0
  230. data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -0
  231. data/test/rubygems/test_gem_doctor.rb +1 -0
  232. data/test/rubygems/test_gem_ext_builder.rb +6 -1
  233. data/test/rubygems/test_gem_ext_cmake_builder.rb +1 -0
  234. data/test/rubygems/test_gem_ext_configure_builder.rb +1 -0
  235. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +1 -0
  236. data/test/rubygems/test_gem_ext_rake_builder.rb +1 -0
  237. data/test/rubygems/test_gem_gem_runner.rb +1 -0
  238. data/test/rubygems/test_gem_gemcutter_utilities.rb +1 -0
  239. data/test/rubygems/test_gem_impossible_dependencies_error.rb +1 -0
  240. data/test/rubygems/test_gem_indexer.rb +1 -0
  241. data/test/rubygems/test_gem_install_update_options.rb +13 -0
  242. data/test/rubygems/test_gem_installer.rb +17 -4
  243. data/test/rubygems/test_gem_local_remote_options.rb +1 -0
  244. data/test/rubygems/test_gem_name_tuple.rb +1 -0
  245. data/test/rubygems/test_gem_package.rb +16 -9
  246. data/test/rubygems/test_gem_package_old.rb +1 -0
  247. data/test/rubygems/test_gem_package_tar_header.rb +1 -0
  248. data/test/rubygems/test_gem_package_tar_reader.rb +1 -0
  249. data/test/rubygems/test_gem_package_tar_reader_entry.rb +2 -1
  250. data/test/rubygems/test_gem_package_tar_writer.rb +1 -0
  251. data/test/rubygems/test_gem_package_task.rb +1 -0
  252. data/test/rubygems/test_gem_path_support.rb +1 -0
  253. data/test/rubygems/test_gem_platform.rb +1 -0
  254. data/test/rubygems/test_gem_rdoc.rb +1 -0
  255. data/test/rubygems/test_gem_remote_fetcher.rb +1 -0
  256. data/test/rubygems/test_gem_request.rb +1 -0
  257. data/test/rubygems/test_gem_request_connection_pools.rb +1 -0
  258. data/test/rubygems/test_gem_request_set.rb +3 -2
  259. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +34 -45
  260. data/test/rubygems/test_gem_request_set_lockfile.rb +1 -0
  261. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +9 -3
  262. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -0
  263. data/test/rubygems/test_gem_requirement.rb +1 -0
  264. data/test/rubygems/test_gem_resolver.rb +1 -0
  265. data/test/rubygems/test_gem_resolver_activation_request.rb +1 -0
  266. data/test/rubygems/test_gem_resolver_api_set.rb +1 -0
  267. data/test/rubygems/test_gem_resolver_api_specification.rb +1 -0
  268. data/test/rubygems/test_gem_resolver_best_set.rb +1 -0
  269. data/test/rubygems/test_gem_resolver_composed_set.rb +1 -0
  270. data/test/rubygems/test_gem_resolver_conflict.rb +1 -0
  271. data/test/rubygems/test_gem_resolver_dependency_request.rb +1 -0
  272. data/test/rubygems/test_gem_resolver_git_set.rb +1 -0
  273. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -0
  274. data/test/rubygems/test_gem_resolver_index_set.rb +1 -0
  275. data/test/rubygems/test_gem_resolver_index_specification.rb +1 -0
  276. data/test/rubygems/test_gem_resolver_installed_specification.rb +1 -0
  277. data/test/rubygems/test_gem_resolver_installer_set.rb +1 -0
  278. data/test/rubygems/test_gem_resolver_local_specification.rb +1 -0
  279. data/test/rubygems/test_gem_resolver_lock_set.rb +1 -0
  280. data/test/rubygems/test_gem_resolver_lock_specification.rb +7 -6
  281. data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -0
  282. data/test/rubygems/test_gem_resolver_specification.rb +1 -0
  283. data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -0
  284. data/test/rubygems/test_gem_resolver_vendor_specification.rb +1 -0
  285. data/test/rubygems/test_gem_security.rb +1 -0
  286. data/test/rubygems/test_gem_security_policy.rb +1 -0
  287. data/test/rubygems/test_gem_security_signer.rb +1 -0
  288. data/test/rubygems/test_gem_security_trust_dir.rb +1 -0
  289. data/test/rubygems/test_gem_server.rb +1 -0
  290. data/test/rubygems/test_gem_silent_ui.rb +1 -0
  291. data/test/rubygems/test_gem_source.rb +1 -0
  292. data/test/rubygems/test_gem_source_fetch_problem.rb +1 -0
  293. data/test/rubygems/test_gem_source_git.rb +1 -0
  294. data/test/rubygems/test_gem_source_installed.rb +1 -0
  295. data/test/rubygems/test_gem_source_list.rb +1 -0
  296. data/test/rubygems/test_gem_source_local.rb +1 -0
  297. data/test/rubygems/test_gem_source_lock.rb +1 -0
  298. data/test/rubygems/test_gem_source_specific_file.rb +1 -0
  299. data/test/rubygems/test_gem_source_vendor.rb +1 -0
  300. data/test/rubygems/test_gem_spec_fetcher.rb +1 -0
  301. data/test/rubygems/test_gem_specification.rb +80 -64
  302. data/test/rubygems/test_gem_stream_ui.rb +1 -0
  303. data/test/rubygems/test_gem_stub_specification.rb +1 -0
  304. data/test/rubygems/test_gem_text.rb +1 -0
  305. data/test/rubygems/test_gem_uninstaller.rb +1 -0
  306. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +1 -0
  307. data/test/rubygems/test_gem_uri_formatter.rb +1 -0
  308. data/test/rubygems/test_gem_util.rb +1 -0
  309. data/test/rubygems/test_gem_validator.rb +1 -0
  310. data/test/rubygems/test_gem_version.rb +1 -0
  311. data/test/rubygems/test_gem_version_option.rb +1 -0
  312. data/test/rubygems/test_kernel.rb +1 -0
  313. data/test/rubygems/test_require.rb +2 -1
  314. data/util/create_certs.rb +1 -0
  315. data/util/create_encrypted_key.rb +1 -0
  316. data/util/generate_spdx_license_list.rb +15 -0
  317. data/util/update_bundled_ca_certificates.rb +1 -1
  318. metadata +12 -28
  319. checksums.yaml.gz.sig +0 -0
  320. data.tar.gz.sig +0 -0
  321. data/.gemtest +0 -0
  322. metadata.gz.sig +0 -2
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'thread'
2
3
 
3
4
  class Gem::Request::ConnectionPools # :nodoc:
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A connection "pool" that only manages one connection for now. Provides
3
4
  # thread safe `checkout` and `checkin` methods. The pool consists of one
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  class Gem::Request::HTTPSPool < Gem::Request::HTTPPool # :nodoc:
2
3
  private
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'tsort'
2
3
 
3
4
  ##
@@ -76,6 +77,11 @@ class Gem::RequestSet
76
77
 
77
78
  attr_reader :vendor_set # :nodoc:
78
79
 
80
+ ##
81
+ # The set of source gems imported via load_gemdeps.
82
+
83
+ attr_reader :source_set
84
+
79
85
  ##
80
86
  # Creates a RequestSet for a list of Gem::Dependency objects, +deps+. You
81
87
  # can then #resolve and #install the resolved list of dependencies.
@@ -105,6 +111,7 @@ class Gem::RequestSet
105
111
  @sorted = nil
106
112
  @specs = nil
107
113
  @vendor_set = nil
114
+ @source_set = nil
108
115
 
109
116
  yield self if block_given?
110
117
  end
@@ -142,7 +149,6 @@ class Gem::RequestSet
142
149
  return requests
143
150
  end
144
151
 
145
- cache_dir = options[:cache_dir] || Gem.dir
146
152
  @prerelease = options[:prerelease]
147
153
 
148
154
  requests = []
@@ -157,13 +163,11 @@ class Gem::RequestSet
157
163
  end
158
164
  end
159
165
 
160
- path = req.download cache_dir
161
-
162
- inst = Gem::Installer.at path, options
163
-
164
- yield req, inst if block_given?
166
+ spec = req.spec.install options do |installer|
167
+ yield req, installer if block_given?
168
+ end
165
169
 
166
- requests << inst.install
170
+ requests << spec
167
171
  end
168
172
 
169
173
  return requests if options[:gemdeps]
@@ -271,10 +275,11 @@ class Gem::RequestSet
271
275
  def load_gemdeps path, without_groups = [], installing = false
272
276
  @git_set = Gem::Resolver::GitSet.new
273
277
  @vendor_set = Gem::Resolver::VendorSet.new
278
+ @source_set = Gem::Resolver::SourceSet.new
274
279
 
275
280
  @git_set.root_dir = @install_dir
276
281
 
277
- lock_file = "#{File.expand_path(path)}.lock".untaint
282
+ lock_file = "#{File.expand_path(path)}.lock".dup.untaint
278
283
  begin
279
284
  tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file
280
285
  parser = tokenizer.make_parser self, []
@@ -338,6 +343,7 @@ class Gem::RequestSet
338
343
  @sets << set
339
344
  @sets << @git_set
340
345
  @sets << @vendor_set
346
+ @sets << @source_set
341
347
 
342
348
  set = Gem::Resolver.compose_sets(*@sets)
343
349
  set.remote = @remote
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies
3
4
  # files.
@@ -204,6 +205,7 @@ class Gem::RequestSet::GemDependencyAPI
204
205
  @installing = false
205
206
  @requires = Hash.new { |h, name| h[name] = [] }
206
207
  @vendor_set = @set.vendor_set
208
+ @source_set = @set.source_set
207
209
  @gem_sources = {}
208
210
  @without_groups = []
209
211
 
@@ -362,6 +364,7 @@ class Gem::RequestSet::GemDependencyAPI
362
364
  source_set ||= gem_path name, options
363
365
  source_set ||= gem_git name, options
364
366
  source_set ||= gem_git_source name, options
367
+ source_set ||= gem_source name, options
365
368
 
366
369
  duplicate = @dependencies.include? name
367
370
 
@@ -407,11 +410,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
407
410
 
408
411
  pin_gem_source name, :git, repository
409
412
 
410
- reference = nil
411
- reference ||= options.delete :ref
412
- reference ||= options.delete :branch
413
- reference ||= options.delete :tag
414
- reference ||= 'master'
413
+ reference = gem_git_reference options
415
414
 
416
415
  submodules = options.delete :submodules
417
416
 
@@ -420,6 +419,36 @@ Gem dependencies file #{@path} requires #{name} more than once.
420
419
  true
421
420
  end
422
421
 
422
+ ##
423
+ # Handles the git options from +options+ for git gem.
424
+ #
425
+ # Returns reference for the git gem.
426
+
427
+ def gem_git_reference options # :nodoc:
428
+ ref = options.delete :ref
429
+ branch = options.delete :branch
430
+ tag = options.delete :tag
431
+
432
+ reference = nil
433
+ reference ||= ref
434
+ reference ||= branch
435
+ reference ||= tag
436
+ reference ||= 'master'
437
+
438
+ if ref && branch
439
+ warn <<-WARNING
440
+ Gem dependencies file #{@path} includes git reference for both ref and branch but only ref is used.
441
+ WARNING
442
+ end
443
+ if (ref||branch) && tag
444
+ warn <<-WARNING
445
+ Gem dependencies file #{@path} includes git reference for both ref/branch and tag but only ref/branch is used.
446
+ WARNING
447
+ end
448
+
449
+ reference
450
+ end
451
+
423
452
  private :gem_git
424
453
 
425
454
  ##
@@ -480,6 +509,23 @@ Gem dependencies file #{@path} requires #{name} more than once.
480
509
 
481
510
  private :gem_path
482
511
 
512
+ ##
513
+ # Handles the source: option from +options+ for gem +name+.
514
+ #
515
+ # Returns +true+ if the source option was handled.
516
+
517
+ def gem_source name, options # :nodoc:
518
+ return unless source = options.delete(:source)
519
+
520
+ pin_gem_source name, :source, source
521
+
522
+ @source_set.add_source_gem name, source
523
+
524
+ true
525
+ end
526
+
527
+ private :gem_source
528
+
483
529
  ##
484
530
  # Handles the platforms: option from +options+. Returns true if the
485
531
  # platform matches the current platform.
@@ -526,6 +572,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
526
572
  else
527
573
  @requires[name] << name
528
574
  end
575
+ raise ArgumentError, "Unhandled gem options #{options.inspect}" unless options.empty?
529
576
  end
530
577
 
531
578
  private :gem_requires
@@ -611,6 +658,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
611
658
 
612
659
  add_dependencies groups, spec.development_dependencies
613
660
 
661
+ @vendor_set.add_vendor_gem spec.name, path
614
662
  gem_requires spec.name, options
615
663
  end
616
664
 
@@ -650,6 +698,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
650
698
  when :default then '(default)'
651
699
  when :path then "path: #{source}"
652
700
  when :git then "git: #{source}"
701
+ when :source then "source: #{source}"
653
702
  else '(unknown)'
654
703
  end
655
704
 
@@ -798,4 +847,3 @@ Gem dependencies file #{@path} requires #{name} more than once.
798
847
  Gem::RequestSet::GemDepedencyAPI = self # :nodoc:
799
848
 
800
849
  end
801
-
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # Parses a gem.deps.rb.lock file and constructs a LockSet containing the
3
4
  # dependencies found inside. If the lock file is missing no LockSet is
@@ -129,8 +130,8 @@ class Gem::RequestSet::Lockfile
129
130
  [source.repository, source.rev_parse]
130
131
  end
131
132
 
132
- out << "GIT"
133
133
  by_repository_revision.each do |(repository, revision), requests|
134
+ out << "GIT"
134
135
  out << " remote: #{repository}"
135
136
  out << " revision: #{revision}"
136
137
  out << " specs:"
@@ -143,9 +144,8 @@ class Gem::RequestSet::Lockfile
143
144
  out << " #{dep.name}#{dep.requirement.for_lockfile}"
144
145
  end
145
146
  end
147
+ out << nil
146
148
  end
147
-
148
- out << nil
149
149
  end
150
150
 
151
151
  def relative_path_from dest, base # :nodoc:
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  class Gem::RequestSet::Lockfile::Parser
2
3
  ###
3
4
  # Parses lockfiles
@@ -324,15 +325,24 @@ class Gem::RequestSet::Lockfile::Parser
324
325
  @tokens.peek
325
326
  end
326
327
 
327
- def pinned_requirement name # :nodoc:
328
- spec = @set.sets.select { |set|
329
- Gem::Resolver::GitSet === set or
330
- Gem::Resolver::VendorSet === set
331
- }.map { |set|
332
- set.specs[name]
333
- }.compact.first
328
+ if [].respond_to? :flat_map
329
+ def pinned_requirement name # :nodoc:
330
+ requirement = Gem::Dependency.new name
331
+ specification = @set.sets.flat_map { |set|
332
+ set.find_all(requirement)
333
+ }.compact.first
334
334
 
335
- spec.version
335
+ specification && specification.version
336
+ end
337
+ else # FIXME: remove when 1.8 is dropped
338
+ def pinned_requirement name # :nodoc:
339
+ requirement = Gem::Dependency.new name
340
+ specification = @set.sets.map { |set|
341
+ set.find_all(requirement)
342
+ }.flatten(1).compact.first
343
+
344
+ specification && specification.version
345
+ end
336
346
  end
337
347
 
338
348
  ##
@@ -342,4 +352,3 @@ class Gem::RequestSet::Lockfile::Parser
342
352
  @tokens.unshift token
343
353
  end
344
354
  end
345
-
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'strscan'
2
3
  require 'rubygems/request_set/lockfile/parser'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "rubygems/version"
2
3
  require "rubygems/deprecate"
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/dependency'
2
3
  require 'rubygems/exceptions'
3
4
  require 'rubygems/util'
@@ -278,6 +279,7 @@ require 'rubygems/resolver/index_set'
278
279
  require 'rubygems/resolver/installer_set'
279
280
  require 'rubygems/resolver/lock_set'
280
281
  require 'rubygems/resolver/vendor_set'
282
+ require 'rubygems/resolver/source_set'
281
283
 
282
284
  require 'rubygems/resolver/specification'
283
285
  require 'rubygems/resolver/spec_specification'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # Specifies a Specification object that should be activated. Also contains a
3
4
  # dependency that was used to introduce this activation.
@@ -49,15 +50,27 @@ class Gem::Resolver::ActivationRequest
49
50
  # Downloads a gem at +path+ and returns the file path.
50
51
 
51
52
  def download path
52
- if @spec.respond_to? :source
53
+ Gem.ensure_gem_subdirectories path
54
+
55
+ if @spec.respond_to? :sources
56
+ exception = nil
57
+ path = @spec.sources.find{ |source|
58
+ begin
59
+ source.download full_spec, path
60
+ rescue exception
61
+ end
62
+ }
63
+ return path if path
64
+ raise exception if exception
65
+
66
+ elsif @spec.respond_to? :source
53
67
  source = @spec.source
68
+ source.download full_spec, path
69
+
54
70
  else
55
71
  source = Gem.sources.first
72
+ source.download full_spec, path
56
73
  end
57
-
58
- Gem.ensure_gem_subdirectories path
59
-
60
- source.download full_spec, path
61
74
  end
62
75
 
63
76
  ##
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # The global rubygems pool, available via the rubygems.org API.
3
4
  # Returns instances of APISpecification.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # Represents a specification retrieved via the rubygems.org API.
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # The BestSet chooses the best available method to query a remote index.
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A ComposedSet allows multiple sets to be queried like a single set.
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # Used internally to indicate that a dependency conflicted
3
4
  # with a spec that would be activated.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A set which represents the installed gems. Respects
3
4
  # all the normal settings that control where to look
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # Used Internally. Wraps a Dependency object to also track which spec
3
4
  # contained the Dependency.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A GitSet represents gems that are sourced from git repositories.
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A GitSpecification represents a gem that is sourced from a git repository
3
4
  # and is being loaded through a gem dependencies file through the +git:+
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # The global rubygems pool represented via the traditional
3
4
  # source index.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # Represents a possible Specification object returned from IndexSet. Used to
3
4
  # delay needed to download full Specification objects when only the +name+
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # An InstalledSpecification represents a gem that is already installed
3
4
  # locally.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A set of gems for installation sourced from remote sources and local .gem
3
4
  # files
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A LocalSpecification comes from a .gem file on the local filesystem.
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # A set of gems from a gem dependencies lockfile.
3
4
 
@@ -27,11 +28,9 @@ class Gem::Resolver::LockSet < Gem::Resolver::Set
27
28
 
28
29
  def add name, version, platform # :nodoc:
29
30
  version = Gem::Version.new version
30
-
31
- specs = @sources.map do |source|
32
- Gem::Resolver::LockSpecification.new self, name, version, source,
33
- platform
34
- end
31
+ specs = [
32
+ Gem::Resolver::LockSpecification.new(self, name, version, @sources, platform)
33
+ ]
35
34
 
36
35
  @specs.concat specs
37
36
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ##
2
3
  # The LockSpecification comes from a lockfile (Gem::RequestSet::Lockfile).
3
4
  #
@@ -6,13 +7,16 @@
6
7
 
7
8
  class Gem::Resolver::LockSpecification < Gem::Resolver::Specification
8
9
 
9
- def initialize set, name, version, source, platform
10
+ attr_reader :sources
11
+
12
+ def initialize set, name, version, sources, platform
10
13
  super()
11
14
 
12
15
  @name = name
13
16
  @platform = platform
14
17
  @set = set
15
- @source = source
18
+ @source = sources.first
19
+ @sources = sources
16
20
  @version = version
17
21
 
18
22
  @dependencies = []