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 'rubygems/test_case'
2
3
  require 'rubygems/local_remote_options'
3
4
  require 'rubygems/command'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/name_tuple'
3
4
 
@@ -1,4 +1,5 @@
1
1
  # coding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'rubygems/package/tar_test_case'
4
5
  require 'rubygems/simple_gem'
@@ -427,19 +428,25 @@ class TestGemPackage < Gem::Package::TarTestCase
427
428
  "#{@destination} is not allowed", e.message)
428
429
  end
429
430
 
430
- def test_extract_tar_gz_symlink_absolute
431
+ def test_extract_tar_gz_symlink_relative_path
432
+ skip 'symlink not supported' if Gem.win_platform?
433
+
431
434
  package = Gem::Package.new @gem
432
435
 
433
436
  tgz_io = util_tar_gz do |tar|
434
- tar.add_symlink 'code.rb', '/absolute.rb', 0644
437
+ tar.add_file 'relative.rb', 0644 do |io| io.write 'hi' end
438
+ tar.mkdir 'lib', 0755
439
+ tar.add_symlink 'lib/foo.rb', '../relative.rb', 0644
435
440
  end
436
441
 
437
- e = assert_raises Gem::Package::PathError do
438
- package.extract_tar_gz tgz_io, @destination
439
- end
442
+ package.extract_tar_gz tgz_io, @destination
440
443
 
441
- assert_equal("installing into parent path /absolute.rb of " +
442
- "#{@destination} is not allowed", e.message)
444
+ extracted = File.join @destination, 'lib/foo.rb'
445
+ assert_path_exists extracted
446
+ assert_equal '../relative.rb',
447
+ File.readlink(extracted)
448
+ assert_equal 'hi',
449
+ File.read(extracted)
443
450
  end
444
451
 
445
452
  def test_extract_tar_gz_directory
@@ -489,7 +496,7 @@ class TestGemPackage < Gem::Package::TarTestCase
489
496
  def test_install_location
490
497
  package = Gem::Package.new @gem
491
498
 
492
- file = 'file.rb'
499
+ file = 'file.rb'.dup
493
500
  file.taint
494
501
 
495
502
  destination = package.install_location file, @destination
@@ -529,7 +536,7 @@ class TestGemPackage < Gem::Package::TarTestCase
529
536
  skip 'no File.realpath on 1.8' if RUBY_VERSION < '1.9'
530
537
  package = Gem::Package.new @gem
531
538
 
532
- file = 'foo//file.rb'
539
+ file = 'foo//file.rb'.dup
533
540
  file.taint
534
541
 
535
542
  destination = @destination.sub '/', '//'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/simple_gem'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/package/tar_test_case'
2
3
  require 'rubygems/package'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/package/tar_test_case'
2
3
  require 'rubygems/package'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/package/tar_test_case'
2
3
  require 'rubygems/package'
3
4
 
@@ -8,7 +9,7 @@ class TestGemPackageTarReaderEntry < Gem::Package::TarTestCase
8
9
 
9
10
  @contents = ('a'..'z').to_a.join * 100
10
11
 
11
- @tar = ''
12
+ @tar = String.new
12
13
  @tar << tar_file_header("lib/foo", "", 0, @contents.size, Time.now)
13
14
  @tar << @contents
14
15
  @tar << "\0" * (512 - (@tar.size % 512))
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/package/tar_test_case'
2
3
  require 'rubygems/package/tar_writer'
3
4
  require 'minitest/mock'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems'
3
4
  begin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems'
3
4
  require 'fileutils'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/platform'
3
4
  require 'rbconfig'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems'
2
3
  require 'rubygems/test_case'
3
4
  require 'rubygems/rdoc'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  require 'webrick'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/request'
3
4
  require 'ostruct'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/request'
3
4
  require 'timeout'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/request_set'
3
4
 
@@ -354,7 +355,7 @@ ruby "0"
354
355
 
355
356
  assert_equal %w[a-1], names
356
357
 
357
- assert_equal [@DR::BestSet, @DR::GitSet, @DR::VendorSet],
358
+ assert_equal [@DR::BestSet, @DR::GitSet, @DR::VendorSet, @DR::SourceSet],
358
359
  rs.sets.map { |set| set.class }
359
360
  end
360
361
 
@@ -418,7 +419,7 @@ ruby "0"
418
419
 
419
420
  assert_equal ["a-1", "b-2"], names
420
421
 
421
- assert_equal [@DR::BestSet, @DR::GitSet, @DR::VendorSet],
422
+ assert_equal [@DR::BestSet, @DR::GitSet, @DR::VendorSet, @DR::SourceSet],
422
423
  rs.sets.map { |set| set.class }
423
424
  end
424
425
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/request_set'
3
4
 
@@ -51,22 +52,14 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
51
52
  end
52
53
 
53
54
  def test_gempspec_with_multiple_runtime_deps
54
- gda = Class.new(@GDA) do
55
- # implement find_gemspec so we don't need one on the FS
56
- def find_gemspec name, path
57
- Gem::Specification.new do |s|
58
- s.name = 'foo'
59
- s.version = '1.0'
60
- s.add_runtime_dependency 'bar', '>= 1.6.0', '< 1.6.4'
61
- end
62
- end
55
+ save_gemspec 'foo', '1.0' do |s|
56
+ s.add_runtime_dependency 'bar', '>= 1.6.0', '< 1.6.4'
63
57
  end
64
- instance = gda.new @set, __FILE__
65
- instance.gemspec
58
+ @gda.gemspec
66
59
  assert_equal %w{ foo bar }.sort, @set.dependencies.map(&:name).sort
67
60
  bar = @set.dependencies.find { |d| d.name == 'bar' }
68
- assert_equal [[">=", Gem::Version.create('1.6.0')],
69
- ["<", Gem::Version.create('1.6.4')]], bar.requirement.requirements
61
+ assert_equal [["<", Gem::Version.create('1.6.4')],
62
+ [">=", Gem::Version.create('1.6.0')]], bar.requirement.requirements.sort
70
63
  end
71
64
 
72
65
  def test_gemspec_without_group
@@ -144,7 +137,11 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
144
137
  end
145
138
 
146
139
  def test_gem_git_branch
147
- @gda.gem 'a', :git => 'git/a', :branch => 'other', :tag => 'v1'
140
+ _, err = capture_io do
141
+ @gda.gem 'a', :git => 'git/a', :branch => 'other', :tag => 'v1'
142
+ end
143
+ expected = "Gem dependencies file gem.deps.rb includes git reference for both ref/branch and tag but only ref/branch is used."
144
+ assert_match expected, err
148
145
 
149
146
  assert_equal [dep('a')], @set.dependencies
150
147
 
@@ -161,7 +158,11 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
161
158
  end
162
159
 
163
160
  def test_gem_git_ref
164
- @gda.gem 'a', :git => 'git/a', :ref => 'abcd123', :branch => 'other'
161
+ _, err = capture_io do
162
+ @gda.gem 'a', :git => 'git/a', :ref => 'abcd123', :branch => 'other'
163
+ end
164
+ expected = "Gem dependencies file gem.deps.rb includes git reference for both ref and branch but only ref is used."
165
+ assert_match expected, err
165
166
 
166
167
  assert_equal [dep('a')], @set.dependencies
167
168
 
@@ -470,11 +471,9 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
470
471
  end
471
472
 
472
473
  def test_gemspec
473
- spec = util_spec 'a', 1, 'b' => 2
474
- spec.add_development_dependency 'c', 3
475
-
476
- open 'a.gemspec', 'w' do |io|
477
- io.write spec.to_ruby_for_cache
474
+ save_gemspec 'a', 1 do |s|
475
+ s.add_dependency 'b', 2
476
+ s.add_development_dependency 'c', 3
478
477
  end
479
478
 
480
479
  @gda.gemspec
@@ -506,11 +505,9 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
506
505
  end
507
506
 
508
507
  def test_gemspec_development_group
509
- spec = util_spec 'a', 1, 'b' => 2
510
- spec.add_development_dependency 'c', 3
511
-
512
- open 'a.gemspec', 'w' do |io|
513
- io.write spec.to_ruby_for_cache
508
+ save_gemspec 'a', 1 do |s|
509
+ s.add_dependency 'b', 2
510
+ s.add_development_dependency 'c', 3
514
511
  end
515
512
 
516
513
  @gda.without_groups << :other
@@ -523,14 +520,12 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
523
520
  end
524
521
 
525
522
  def test_gemspec_multiple
526
- open 'a.gemspec', 'w' do |io|
527
- spec = util_spec 'a', 1, 'b' => 2
528
- io.write spec.to_ruby_for_cache
523
+ save_gemspec 'a', 1 do |s|
524
+ s.add_dependency 'b', 2
529
525
  end
530
526
 
531
- open 'b.gemspec', 'w' do |io|
532
- spec = util_spec 'b', 2, 'c' => 3
533
- io.write spec.to_ruby_for_cache
527
+ save_gemspec 'b', 2 do |s|
528
+ s.add_dependency 'c', 3
534
529
  end
535
530
 
536
531
  e = assert_raises ArgumentError do
@@ -541,14 +536,12 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
541
536
  end
542
537
 
543
538
  def test_gemspec_name
544
- open 'a.gemspec', 'w' do |io|
545
- spec = util_spec 'a', 1, 'b' => 2
546
- io.write spec.to_ruby_for_cache
539
+ save_gemspec 'a', 1 do |s|
540
+ s.add_dependency 'b', 2
547
541
  end
548
542
 
549
- open 'b.gemspec', 'w' do |io|
550
- spec = util_spec 'b', 2, 'c' => 3
551
- io.write spec.to_ruby_for_cache
543
+ save_gemspec 'b', 2 do |s|
544
+ s.add_dependency 'c', 3
552
545
  end
553
546
 
554
547
  @gda.gemspec :name => 'b'
@@ -557,10 +550,8 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
557
550
  end
558
551
 
559
552
  def test_gemspec_named
560
- spec = util_spec 'a', 1, 'b' => 2
561
-
562
- open 'other.gemspec', 'w' do |io|
563
- io.write spec.to_ruby_for_cache
553
+ save_gemspec 'a', 1 do |s|
554
+ s.add_dependency 'b', 2
564
555
  end
565
556
 
566
557
  @gda.gemspec
@@ -577,12 +568,10 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
577
568
  end
578
569
 
579
570
  def test_gemspec_path
580
- spec = util_spec 'a', 1, 'b' => 2
581
-
582
571
  FileUtils.mkdir 'other'
583
572
 
584
- open 'other/a.gemspec', 'w' do |io|
585
- io.write spec.to_ruby_for_cache
573
+ save_gemspec 'a', 1, 'other' do |s|
574
+ s.add_dependency 'b', 2
586
575
  end
587
576
 
588
577
  @gda.gemspec :path => 'other'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/request_set'
3
4
  require 'rubygems/request_set/lockfile'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/request_set'
3
4
  require 'rubygems/request_set/lockfile'
@@ -245,10 +246,15 @@ DEPENDENCIES
245
246
 
246
247
  assert lockfile_set, 'found a LockSet'
247
248
 
248
- assert_equal %w[a-2 a-2], lockfile_set.specs.map { |s| s.full_name }
249
+ assert_equal %w[a-2], lockfile_set.specs.map { |s| s.full_name }
249
250
 
250
- assert_equal %w[https://gems.example/ https://other.example/],
251
- lockfile_set.specs.map { |s| s.source.uri.to_s }
251
+ if [].respond_to? :flat_map
252
+ assert_equal %w[https://gems.example/ https://other.example/],
253
+ lockfile_set.specs.flat_map { |s| s.sources.map{ |src| src.uri.to_s } }
254
+ else # FIXME: remove when 1.8 is dropped
255
+ assert_equal %w[https://gems.example/ https://other.example/],
256
+ lockfile_set.specs.map { |s| s.sources.map{ |src| src.uri.to_s } }.flatten(1)
257
+ end
252
258
  end
253
259
 
254
260
  def test_parse_GIT
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/request_set'
3
4
  require 'rubygems/request_set/lockfile'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require "rubygems/requirement"
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolver < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverActivationRequest < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverAPISet < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverAPISpecification < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverBestSet < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverComposedSet < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverConflict < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverDependencyRequest < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverGitSet < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/installer'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverIndexSet < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/available_set'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverInstalledSpecification < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
 
3
4
  class TestGemResolverInstallerSet < Gem::TestCase
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems/available_set'
3
4