rubygems-update 3.3.18 → 3.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +65 -0
  3. data/Manifest.txt +11 -0
  4. data/bin/gem +2 -2
  5. data/bin/update_rubygems +4 -4
  6. data/bundler/CHANGELOG.md +100 -0
  7. data/bundler/UPGRADING.md +11 -4
  8. data/bundler/bundler.gemspec +6 -8
  9. data/bundler/lib/bundler/build_metadata.rb +2 -2
  10. data/bundler/lib/bundler/cli/common.rb +1 -0
  11. data/bundler/lib/bundler/cli/install.rb +5 -2
  12. data/bundler/lib/bundler/cli/outdated.rb +12 -3
  13. data/bundler/lib/bundler/cli/platform.rb +1 -1
  14. data/bundler/lib/bundler/cli.rb +7 -4
  15. data/bundler/lib/bundler/current_ruby.rb +14 -5
  16. data/bundler/lib/bundler/definition.rb +102 -31
  17. data/bundler/lib/bundler/dependency.rb +18 -85
  18. data/bundler/lib/bundler/dsl.rb +2 -2
  19. data/bundler/lib/bundler/endpoint_specification.rb +2 -13
  20. data/bundler/lib/bundler/feature_flag.rb +0 -1
  21. data/bundler/lib/bundler/fetcher.rb +6 -6
  22. data/bundler/lib/bundler/gem_helpers.rb +7 -1
  23. data/bundler/lib/bundler/gem_version_promoter.rb +8 -18
  24. data/bundler/lib/bundler/index.rb +10 -12
  25. data/bundler/lib/bundler/injector.rb +2 -1
  26. data/bundler/lib/bundler/inline.rb +1 -1
  27. data/bundler/lib/bundler/installer/standalone.rb +1 -1
  28. data/bundler/lib/bundler/installer.rb +14 -12
  29. data/bundler/lib/bundler/lazy_specification.rb +30 -23
  30. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  31. data/bundler/lib/bundler/man/bundle-add.1 +6 -2
  32. data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
  33. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-cache.1 +7 -1
  35. data/bundler/lib/bundler/man/bundle-cache.1.ronn +7 -0
  36. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-config.1 +25 -6
  39. data/bundler/lib/bundler/man/bundle-config.1.ronn +16 -6
  40. data/bundler/lib/bundler/man/bundle-console.1 +53 -0
  41. data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
  42. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
  44. data/bundler/lib/bundler/man/bundle-exec.1.ronn +1 -1
  45. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-help.1 +13 -0
  47. data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
  48. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-inject.1 +5 -2
  51. data/bundler/lib/bundler/man/bundle-inject.1.ronn +3 -1
  52. data/bundler/lib/bundler/man/bundle-install.1 +5 -1
  53. data/bundler/lib/bundler/man/bundle-install.1.ronn +6 -0
  54. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  55. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  56. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-platform.1 +16 -6
  59. data/bundler/lib/bundler/man/bundle-platform.1.ronn +14 -7
  60. data/bundler/lib/bundler/man/bundle-plugin.1 +81 -0
  61. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
  62. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  66. data/bundler/lib/bundler/man/bundle-version.1 +35 -0
  67. data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
  68. data/bundler/lib/bundler/man/bundle-viz.1 +4 -1
  69. data/bundler/lib/bundler/man/bundle-viz.1.ronn +2 -0
  70. data/bundler/lib/bundler/man/bundle.1 +15 -10
  71. data/bundler/lib/bundler/man/bundle.1.ronn +12 -7
  72. data/bundler/lib/bundler/man/gemfile.5 +23 -47
  73. data/bundler/lib/bundler/man/gemfile.5.ronn +32 -43
  74. data/bundler/lib/bundler/man/index.txt +4 -0
  75. data/bundler/lib/bundler/match_metadata.rb +13 -0
  76. data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
  77. data/bundler/lib/bundler/plugin.rb +2 -0
  78. data/bundler/lib/bundler/remote_specification.rb +6 -11
  79. data/bundler/lib/bundler/resolver/base.rb +50 -0
  80. data/bundler/lib/bundler/resolver/spec_group.rb +11 -8
  81. data/bundler/lib/bundler/resolver.rb +95 -90
  82. data/bundler/lib/bundler/ruby_dsl.rb +1 -1
  83. data/bundler/lib/bundler/ruby_version.rb +5 -5
  84. data/bundler/lib/bundler/rubygems_ext.rb +52 -1
  85. data/bundler/lib/bundler/rubygems_gem_installer.rb +19 -12
  86. data/bundler/lib/bundler/settings.rb +1 -1
  87. data/bundler/lib/bundler/source/metadata.rb +1 -1
  88. data/bundler/lib/bundler/source_list.rb +4 -0
  89. data/bundler/lib/bundler/spec_set.rb +48 -33
  90. data/bundler/lib/bundler/version.rb +1 -1
  91. data/bundler/lib/bundler.rb +3 -3
  92. data/lib/rubygems/available_set.rb +3 -3
  93. data/lib/rubygems/basic_specification.rb +4 -4
  94. data/lib/rubygems/command.rb +25 -25
  95. data/lib/rubygems/command_manager.rb +9 -9
  96. data/lib/rubygems/commands/build_command.rb +8 -8
  97. data/lib/rubygems/commands/cert_command.rb +33 -33
  98. data/lib/rubygems/commands/check_command.rb +20 -20
  99. data/lib/rubygems/commands/cleanup_command.rb +17 -17
  100. data/lib/rubygems/commands/contents_command.rb +13 -13
  101. data/lib/rubygems/commands/dependency_command.rb +16 -16
  102. data/lib/rubygems/commands/environment_command.rb +5 -5
  103. data/lib/rubygems/commands/fetch_command.rb +8 -8
  104. data/lib/rubygems/commands/generate_index_command.rb +17 -17
  105. data/lib/rubygems/commands/help_command.rb +3 -3
  106. data/lib/rubygems/commands/info_command.rb +3 -3
  107. data/lib/rubygems/commands/install_command.rb +20 -20
  108. data/lib/rubygems/commands/list_command.rb +3 -3
  109. data/lib/rubygems/commands/lock_command.rb +4 -4
  110. data/lib/rubygems/commands/mirror_command.rb +3 -3
  111. data/lib/rubygems/commands/open_command.rb +9 -9
  112. data/lib/rubygems/commands/outdated_command.rb +5 -5
  113. data/lib/rubygems/commands/owner_command.rb +11 -11
  114. data/lib/rubygems/commands/pristine_command.rb +36 -36
  115. data/lib/rubygems/commands/push_command.rb +8 -8
  116. data/lib/rubygems/commands/query_command.rb +8 -8
  117. data/lib/rubygems/commands/rdoc_command.rb +17 -17
  118. data/lib/rubygems/commands/search_command.rb +3 -3
  119. data/lib/rubygems/commands/server_command.rb +3 -3
  120. data/lib/rubygems/commands/setup_command.rb +96 -106
  121. data/lib/rubygems/commands/signin_command.rb +9 -9
  122. data/lib/rubygems/commands/signout_command.rb +7 -7
  123. data/lib/rubygems/commands/sources_command.rb +21 -21
  124. data/lib/rubygems/commands/specification_command.rb +13 -13
  125. data/lib/rubygems/commands/stale_command.rb +2 -2
  126. data/lib/rubygems/commands/uninstall_command.rb +40 -40
  127. data/lib/rubygems/commands/unpack_command.rb +12 -12
  128. data/lib/rubygems/commands/update_command.rb +40 -56
  129. data/lib/rubygems/commands/which_command.rb +7 -7
  130. data/lib/rubygems/commands/yank_command.rb +11 -11
  131. data/lib/rubygems/config_file.rb +21 -21
  132. data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
  133. data/lib/rubygems/core_ext/kernel_require.rb +1 -1
  134. data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
  135. data/lib/rubygems/core_ext/tcpsocket_init.rb +1 -1
  136. data/lib/rubygems/defaults.rb +16 -16
  137. data/lib/rubygems/dependency.rb +9 -9
  138. data/lib/rubygems/dependency_installer.rb +13 -13
  139. data/lib/rubygems/dependency_list.rb +6 -6
  140. data/lib/rubygems/doctor.rb +18 -18
  141. data/lib/rubygems/errors.rb +2 -2
  142. data/lib/rubygems/exceptions.rb +5 -5
  143. data/lib/rubygems/ext/build_error.rb +1 -1
  144. data/lib/rubygems/ext/builder.rb +16 -16
  145. data/lib/rubygems/ext/cargo_builder.rb +7 -7
  146. data/lib/rubygems/ext/cmake_builder.rb +2 -2
  147. data/lib/rubygems/ext/configure_builder.rb +1 -1
  148. data/lib/rubygems/ext/ext_conf_builder.rb +8 -8
  149. data/lib/rubygems/ext/rake_builder.rb +3 -3
  150. data/lib/rubygems/ext.rb +7 -7
  151. data/lib/rubygems/gem_runner.rb +5 -5
  152. data/lib/rubygems/gemcutter_utilities.rb +31 -28
  153. data/lib/rubygems/indexer.rb +27 -27
  154. data/lib/rubygems/install_default_message.rb +2 -2
  155. data/lib/rubygems/install_message.rb +2 -2
  156. data/lib/rubygems/install_update_options.rb +55 -55
  157. data/lib/rubygems/installer.rb +32 -40
  158. data/lib/rubygems/installer_uninstaller_utils.rb +2 -2
  159. data/lib/rubygems/local_remote_options.rb +18 -20
  160. data/lib/rubygems/mock_gem_ui.rb +2 -2
  161. data/lib/rubygems/name_tuple.rb +4 -4
  162. data/lib/rubygems/optparse.rb +1 -1
  163. data/lib/rubygems/package/file_source.rb +2 -2
  164. data/lib/rubygems/package/old.rb +8 -8
  165. data/lib/rubygems/package/tar_header.rb +50 -50
  166. data/lib/rubygems/package/tar_reader/entry.rb +2 -2
  167. data/lib/rubygems/package/tar_reader.rb +1 -1
  168. data/lib/rubygems/package/tar_writer.rb +7 -7
  169. data/lib/rubygems/package.rb +54 -43
  170. data/lib/rubygems/package_task.rb +4 -4
  171. data/lib/rubygems/platform.rb +66 -55
  172. data/lib/rubygems/psych_tree.rb +1 -1
  173. data/lib/rubygems/query_utils.rb +35 -35
  174. data/lib/rubygems/rdoc.rb +2 -2
  175. data/lib/rubygems/remote_fetcher.rb +22 -22
  176. data/lib/rubygems/request/connection_pools.rb +4 -4
  177. data/lib/rubygems/request/http_pool.rb +1 -1
  178. data/lib/rubygems/request.rb +22 -22
  179. data/lib/rubygems/request_set/gem_dependency_api.rb +18 -18
  180. data/lib/rubygems/request_set/lockfile/parser.rb +26 -26
  181. data/lib/rubygems/request_set/lockfile/tokenizer.rb +4 -4
  182. data/lib/rubygems/request_set/lockfile.rb +5 -5
  183. data/lib/rubygems/request_set.rb +17 -17
  184. data/lib/rubygems/requirement.rb +6 -6
  185. data/lib/rubygems/resolver/activation_request.rb +3 -3
  186. data/lib/rubygems/resolver/api_set.rb +4 -4
  187. data/lib/rubygems/resolver/api_specification.rb +6 -6
  188. data/lib/rubygems/resolver/best_set.rb +5 -5
  189. data/lib/rubygems/resolver/conflict.rb +10 -10
  190. data/lib/rubygems/resolver/dependency_request.rb +2 -2
  191. data/lib/rubygems/resolver/git_set.rb +2 -2
  192. data/lib/rubygems/resolver/git_specification.rb +6 -6
  193. data/lib/rubygems/resolver/index_set.rb +3 -3
  194. data/lib/rubygems/resolver/index_specification.rb +6 -5
  195. data/lib/rubygems/resolver/installed_specification.rb +4 -4
  196. data/lib/rubygems/resolver/installer_set.rb +11 -16
  197. data/lib/rubygems/resolver/local_specification.rb +2 -2
  198. data/lib/rubygems/resolver/lock_set.rb +4 -4
  199. data/lib/rubygems/resolver/lock_specification.rb +4 -4
  200. data/lib/rubygems/resolver/molinillo.rb +1 -1
  201. data/lib/rubygems/resolver/specification.rb +1 -1
  202. data/lib/rubygems/resolver/vendor_set.rb +1 -1
  203. data/lib/rubygems/resolver/vendor_specification.rb +3 -3
  204. data/lib/rubygems/resolver.rb +39 -39
  205. data/lib/rubygems/s3_uri_signer.rb +6 -6
  206. data/lib/rubygems/safe_yaml.rb +2 -2
  207. data/lib/rubygems/security/policies.rb +11 -11
  208. data/lib/rubygems/security/policy.rb +18 -18
  209. data/lib/rubygems/security/signer.rb +5 -5
  210. data/lib/rubygems/security/trust_dir.rb +3 -3
  211. data/lib/rubygems/security.rb +28 -28
  212. data/lib/rubygems/security_option.rb +5 -5
  213. data/lib/rubygems/source/git.rb +21 -21
  214. data/lib/rubygems/source/installed.rb +1 -1
  215. data/lib/rubygems/source/local.rb +2 -2
  216. data/lib/rubygems/source/specific_file.rb +1 -1
  217. data/lib/rubygems/source.rb +16 -16
  218. data/lib/rubygems/spec_fetcher.rb +9 -9
  219. data/lib/rubygems/specification.rb +63 -62
  220. data/lib/rubygems/specification_policy.rb +15 -15
  221. data/lib/rubygems/stub_specification.rb +5 -5
  222. data/lib/rubygems/tsort.rb +1 -1
  223. data/lib/rubygems/uninstaller.rb +18 -18
  224. data/lib/rubygems/uri.rb +4 -4
  225. data/lib/rubygems/uri_formatter.rb +1 -1
  226. data/lib/rubygems/user_interaction.rb +33 -19
  227. data/lib/rubygems/util/licenses.rb +3 -3
  228. data/lib/rubygems/util.rb +10 -10
  229. data/lib/rubygems/validator.rb +5 -5
  230. data/lib/rubygems/version.rb +15 -9
  231. data/lib/rubygems/version_option.rb +3 -3
  232. data/lib/rubygems.rb +62 -61
  233. data/rubygems-update.gemspec +2 -2
  234. data/setup.rb +9 -9
  235. data/test/rubygems/helper.rb +132 -134
  236. data/test/rubygems/installer_test_case.rb +13 -13
  237. data/test/rubygems/package/tar_test_case.rb +2 -2
  238. data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
  239. data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
  240. data/test/rubygems/rubygems_plugin.rb +2 -2
  241. data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +4 -4
  242. data/test/rubygems/test_bundled_ca.rb +10 -10
  243. data/test/rubygems/test_config.rb +3 -3
  244. data/test/rubygems/test_deprecate.rb +3 -3
  245. data/test/rubygems/test_exit.rb +2 -2
  246. data/test/rubygems/test_gem.rb +342 -342
  247. data/test/rubygems/test_gem_available_set.rb +21 -21
  248. data/test/rubygems/test_gem_bundler_version_finder.rb +1 -1
  249. data/test/rubygems/test_gem_command.rb +44 -44
  250. data/test/rubygems/test_gem_command_manager.rb +29 -29
  251. data/test/rubygems/test_gem_commands_build_command.rb +63 -63
  252. data/test/rubygems/test_gem_commands_cert_command.rb +97 -99
  253. data/test/rubygems/test_gem_commands_check_command.rb +4 -4
  254. data/test/rubygems/test_gem_commands_cleanup_command.rb +40 -40
  255. data/test/rubygems/test_gem_commands_contents_command.rb +27 -27
  256. data/test/rubygems/test_gem_commands_dependency_command.rb +36 -36
  257. data/test/rubygems/test_gem_commands_environment_command.rb +16 -16
  258. data/test/rubygems/test_gem_commands_fetch_command.rb +37 -37
  259. data/test/rubygems/test_gem_commands_generate_index_command.rb +7 -7
  260. data/test/rubygems/test_gem_commands_help_command.rb +13 -13
  261. data/test/rubygems/test_gem_commands_info_command.rb +28 -2
  262. data/test/rubygems/test_gem_commands_install_command.rb +131 -131
  263. data/test/rubygems/test_gem_commands_list_command.rb +4 -4
  264. data/test/rubygems/test_gem_commands_lock_command.rb +10 -10
  265. data/test/rubygems/test_gem_commands_mirror.rb +2 -2
  266. data/test/rubygems/test_gem_commands_open_command.rb +4 -4
  267. data/test/rubygems/test_gem_commands_outdated_command.rb +9 -9
  268. data/test/rubygems/test_gem_commands_owner_command.rb +41 -41
  269. data/test/rubygems/test_gem_commands_pristine_command.rb +92 -92
  270. data/test/rubygems/test_gem_commands_push_command.rb +54 -54
  271. data/test/rubygems/test_gem_commands_query_command.rb +73 -73
  272. data/test/rubygems/test_gem_commands_search_command.rb +2 -2
  273. data/test/rubygems/test_gem_commands_server_command.rb +2 -2
  274. data/test/rubygems/test_gem_commands_setup_command.rb +119 -85
  275. data/test/rubygems/test_gem_commands_signin_command.rb +45 -31
  276. data/test/rubygems/test_gem_commands_signout_command.rb +3 -3
  277. data/test/rubygems/test_gem_commands_sources_command.rb +28 -29
  278. data/test/rubygems/test_gem_commands_specification_command.rb +32 -32
  279. data/test/rubygems/test_gem_commands_stale_command.rb +4 -4
  280. data/test/rubygems/test_gem_commands_uninstall_command.rb +75 -75
  281. data/test/rubygems/test_gem_commands_unpack_command.rb +31 -31
  282. data/test/rubygems/test_gem_commands_update_command.rb +89 -89
  283. data/test/rubygems/test_gem_commands_which_command.rb +6 -6
  284. data/test/rubygems/test_gem_commands_yank_command.rb +40 -40
  285. data/test/rubygems/test_gem_config_file.rb +93 -81
  286. data/test/rubygems/test_gem_dependency.rb +73 -73
  287. data/test/rubygems/test_gem_dependency_installer.rb +165 -165
  288. data/test/rubygems/test_gem_dependency_list.rb +47 -47
  289. data/test/rubygems/test_gem_dependency_resolution_error.rb +4 -4
  290. data/test/rubygems/test_gem_doctor.rb +26 -26
  291. data/test/rubygems/test_gem_ext_builder.rb +59 -59
  292. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +6 -6
  293. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  294. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +8 -8
  295. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +1 -1
  296. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +6 -6
  297. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  298. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +8 -8
  299. data/test/rubygems/test_gem_ext_cargo_builder.rb +26 -26
  300. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +3 -3
  301. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +23 -23
  302. data/test/rubygems/test_gem_ext_cmake_builder.rb +15 -15
  303. data/test/rubygems/test_gem_ext_configure_builder.rb +13 -13
  304. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +51 -52
  305. data/test/rubygems/test_gem_ext_rake_builder.rb +15 -15
  306. data/test/rubygems/test_gem_gem_runner.rb +7 -7
  307. data/test/rubygems/test_gem_gemcutter_utilities.rb +66 -66
  308. data/test/rubygems/test_gem_impossible_dependencies_error.rb +4 -4
  309. data/test/rubygems/test_gem_indexer.rb +48 -48
  310. data/test/rubygems/test_gem_install_update_options.rb +16 -16
  311. data/test/rubygems/test_gem_installer.rb +303 -300
  312. data/test/rubygems/test_gem_local_remote_options.rb +10 -10
  313. data/test/rubygems/test_gem_name_tuple.rb +4 -4
  314. data/test/rubygems/test_gem_package.rb +228 -206
  315. data/test/rubygems/test_gem_package_old.rb +13 -13
  316. data/test/rubygems/test_gem_package_tar_header.rb +42 -42
  317. data/test/rubygems/test_gem_package_tar_reader.rb +8 -8
  318. data/test/rubygems/test_gem_package_tar_reader_entry.rb +10 -10
  319. data/test/rubygems/test_gem_package_tar_writer.rb +76 -76
  320. data/test/rubygems/test_gem_package_task.rb +18 -18
  321. data/test/rubygems/test_gem_path_support.rb +14 -14
  322. data/test/rubygems/test_gem_platform.rb +298 -227
  323. data/test/rubygems/test_gem_rdoc.rb +14 -14
  324. data/test/rubygems/test_gem_remote_fetcher.rb +149 -149
  325. data/test/rubygems/test_gem_request.rb +55 -55
  326. data/test/rubygems/test_gem_request_connection_pools.rb +29 -29
  327. data/test/rubygems/test_gem_request_set.rb +99 -99
  328. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +204 -206
  329. data/test/rubygems/test_gem_request_set_lockfile.rb +86 -86
  330. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +56 -56
  331. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +62 -62
  332. data/test/rubygems/test_gem_requirement.rb +47 -41
  333. data/test/rubygems/test_gem_resolver.rb +133 -99
  334. data/test/rubygems/test_gem_resolver_activation_request.rb +6 -6
  335. data/test/rubygems/test_gem_resolver_api_set.rb +33 -33
  336. data/test/rubygems/test_gem_resolver_api_specification.rb +47 -47
  337. data/test/rubygems/test_gem_resolver_best_set.rb +22 -22
  338. data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
  339. data/test/rubygems/test_gem_resolver_conflict.rb +12 -12
  340. data/test/rubygems/test_gem_resolver_dependency_request.rb +15 -15
  341. data/test/rubygems/test_gem_resolver_git_set.rb +21 -21
  342. data/test/rubygems/test_gem_resolver_git_specification.rb +21 -21
  343. data/test/rubygems/test_gem_resolver_index_set.rb +12 -12
  344. data/test/rubygems/test_gem_resolver_index_specification.rb +16 -16
  345. data/test/rubygems/test_gem_resolver_installed_specification.rb +5 -5
  346. data/test/rubygems/test_gem_resolver_installer_set.rb +78 -34
  347. data/test/rubygems/test_gem_resolver_local_specification.rb +7 -7
  348. data/test/rubygems/test_gem_resolver_lock_set.rb +12 -12
  349. data/test/rubygems/test_gem_resolver_lock_specification.rb +17 -17
  350. data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
  351. data/test/rubygems/test_gem_resolver_specification.rb +8 -8
  352. data/test/rubygems/test_gem_resolver_vendor_set.rb +6 -6
  353. data/test/rubygems/test_gem_resolver_vendor_specification.rb +10 -10
  354. data/test/rubygems/test_gem_security.rb +67 -67
  355. data/test/rubygems/test_gem_security_policy.rb +62 -62
  356. data/test/rubygems/test_gem_security_signer.rb +28 -28
  357. data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
  358. data/test/rubygems/test_gem_silent_ui.rb +38 -32
  359. data/test/rubygems/test_gem_source.rb +44 -44
  360. data/test/rubygems/test_gem_source_fetch_problem.rb +9 -9
  361. data/test/rubygems/test_gem_source_git.rb +59 -59
  362. data/test/rubygems/test_gem_source_installed.rb +16 -16
  363. data/test/rubygems/test_gem_source_list.rb +5 -5
  364. data/test/rubygems/test_gem_source_local.rb +14 -14
  365. data/test/rubygems/test_gem_source_lock.rb +31 -31
  366. data/test/rubygems/test_gem_source_specific_file.rb +17 -17
  367. data/test/rubygems/test_gem_source_subpath_problem.rb +7 -7
  368. data/test/rubygems/test_gem_source_vendor.rb +13 -13
  369. data/test/rubygems/test_gem_spec_fetcher.rb +72 -72
  370. data/test/rubygems/test_gem_specification.rb +444 -436
  371. data/test/rubygems/test_gem_stream_ui.rb +19 -19
  372. data/test/rubygems/test_gem_stub_specification.rb +32 -32
  373. data/test/rubygems/test_gem_text.rb +1 -1
  374. data/test/rubygems/test_gem_uninstaller.rb +112 -112
  375. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +3 -3
  376. data/test/rubygems/test_gem_uri.rb +4 -4
  377. data/test/rubygems/test_gem_uri_formatter.rb +14 -14
  378. data/test/rubygems/test_gem_util.rb +23 -23
  379. data/test/rubygems/test_gem_validator.rb +8 -8
  380. data/test/rubygems/test_gem_version.rb +22 -15
  381. data/test/rubygems/test_gem_version_option.rb +15 -15
  382. data/test/rubygems/test_kernel.rb +31 -31
  383. data/test/rubygems/test_project_sanity.rb +1 -1
  384. data/test/rubygems/test_remote_fetch_error.rb +6 -6
  385. data/test/rubygems/test_require.rb +43 -43
  386. data/test/rubygems/test_rubygems.rb +8 -8
  387. data/test/rubygems/utilities.rb +19 -19
  388. metadata +14 -3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require_relative '../command'
2
+ require_relative "../command"
3
3
 
4
4
  ##
5
5
  # Installs RubyGems itself. This command is ordinarily only available from a
@@ -12,47 +12,47 @@ class Gem::Commands::SetupCommand < Gem::Command
12
12
  ENV_PATHS = %w[/usr/bin/env /bin/env].freeze
13
13
 
14
14
  def initialize
15
- super 'setup', 'Install RubyGems',
15
+ super "setup", "Install RubyGems",
16
16
  :format_executable => false, :document => %w[ri],
17
17
  :force => true,
18
- :site_or_vendor => 'sitelibdir',
19
- :destdir => '', :prefix => '', :previous_version => '',
18
+ :site_or_vendor => "sitelibdir",
19
+ :destdir => "", :prefix => "", :previous_version => "",
20
20
  :regenerate_binstubs => true,
21
21
  :regenerate_plugins => true
22
22
 
23
- add_option '--previous-version=VERSION',
24
- 'Previous version of RubyGems',
25
- 'Used for changelog processing' do |version, options|
23
+ add_option "--previous-version=VERSION",
24
+ "Previous version of RubyGems",
25
+ "Used for changelog processing" do |version, options|
26
26
  options[:previous_version] = version
27
27
  end
28
28
 
29
- add_option '--prefix=PREFIX',
30
- 'Prefix path for installing RubyGems',
31
- 'Will not affect gem repository location' do |prefix, options|
29
+ add_option "--prefix=PREFIX",
30
+ "Prefix path for installing RubyGems",
31
+ "Will not affect gem repository location" do |prefix, options|
32
32
  options[:prefix] = File.expand_path prefix
33
33
  end
34
34
 
35
- add_option '--destdir=DESTDIR',
36
- 'Root directory to install RubyGems into',
37
- 'Mainly used for packaging RubyGems' do |destdir, options|
35
+ add_option "--destdir=DESTDIR",
36
+ "Root directory to install RubyGems into",
37
+ "Mainly used for packaging RubyGems" do |destdir, options|
38
38
  options[:destdir] = File.expand_path destdir
39
39
  end
40
40
 
41
- add_option '--[no-]vendor',
42
- 'Install into vendorlibdir not sitelibdir' do |vendor, options|
43
- options[:site_or_vendor] = vendor ? 'vendorlibdir' : 'sitelibdir'
41
+ add_option "--[no-]vendor",
42
+ "Install into vendorlibdir not sitelibdir" do |vendor, options|
43
+ options[:site_or_vendor] = vendor ? "vendorlibdir" : "sitelibdir"
44
44
  end
45
45
 
46
- add_option '--[no-]format-executable',
47
- 'Makes `gem` match ruby',
48
- 'If Ruby is ruby18, gem will be gem18' do |value, options|
46
+ add_option "--[no-]format-executable",
47
+ "Makes `gem` match ruby",
48
+ "If Ruby is ruby18, gem will be gem18" do |value, options|
49
49
  options[:format_executable] = value
50
50
  end
51
51
 
52
- add_option '--[no-]document [TYPES]', Array,
53
- 'Generate documentation for RubyGems',
54
- 'List the documentation types you wish to',
55
- 'generate. For example: rdoc,ri' do |value, options|
52
+ add_option "--[no-]document [TYPES]", Array,
53
+ "Generate documentation for RubyGems",
54
+ "List the documentation types you wish to",
55
+ "generate. For example: rdoc,ri" do |value, options|
56
56
  options[:document] = case value
57
57
  when nil then %w[rdoc ri]
58
58
  when false then []
@@ -60,46 +60,46 @@ class Gem::Commands::SetupCommand < Gem::Command
60
60
  end
61
61
  end
62
62
 
63
- add_option '--[no-]rdoc',
64
- 'Generate RDoc documentation for RubyGems' do |value, options|
63
+ add_option "--[no-]rdoc",
64
+ "Generate RDoc documentation for RubyGems" do |value, options|
65
65
  if value
66
- options[:document] << 'rdoc'
66
+ options[:document] << "rdoc"
67
67
  else
68
- options[:document].delete 'rdoc'
68
+ options[:document].delete "rdoc"
69
69
  end
70
70
 
71
71
  options[:document].uniq!
72
72
  end
73
73
 
74
- add_option '--[no-]ri',
75
- 'Generate RI documentation for RubyGems' do |value, options|
74
+ add_option "--[no-]ri",
75
+ "Generate RI documentation for RubyGems" do |value, options|
76
76
  if value
77
- options[:document] << 'ri'
77
+ options[:document] << "ri"
78
78
  else
79
- options[:document].delete 'ri'
79
+ options[:document].delete "ri"
80
80
  end
81
81
 
82
82
  options[:document].uniq!
83
83
  end
84
84
 
85
- add_option '--[no-]regenerate-binstubs',
86
- 'Regenerate gem binstubs' do |value, options|
85
+ add_option "--[no-]regenerate-binstubs",
86
+ "Regenerate gem binstubs" do |value, options|
87
87
  options[:regenerate_binstubs] = value
88
88
  end
89
89
 
90
- add_option '--[no-]regenerate-plugins',
91
- 'Regenerate gem plugins' do |value, options|
90
+ add_option "--[no-]regenerate-plugins",
91
+ "Regenerate gem plugins" do |value, options|
92
92
  options[:regenerate_plugins] = value
93
93
  end
94
94
 
95
- add_option '-f', '--[no-]force',
96
- 'Forcefully overwrite binstubs' do |value, options|
95
+ add_option "-f", "--[no-]force",
96
+ "Forcefully overwrite binstubs" do |value, options|
97
97
  options[:force] = value
98
98
  end
99
99
 
100
- add_option('-E', '--[no-]env-shebang',
101
- 'Rewrite executables with a shebang',
102
- 'of /usr/bin/env') do |value, options|
100
+ add_option("-E", "--[no-]env-shebang",
101
+ "Rewrite executables with a shebang",
102
+ "of /usr/bin/env") do |value, options|
103
103
  options[:env_shebang] = value
104
104
  end
105
105
 
@@ -107,7 +107,7 @@ class Gem::Commands::SetupCommand < Gem::Command
107
107
  end
108
108
 
109
109
  def check_ruby_version
110
- required_version = Gem::Requirement.new '>= 2.3.0'
110
+ required_version = Gem::Requirement.new ">= 2.3.0"
111
111
 
112
112
  unless required_version.satisfied_by? Gem.ruby_version
113
113
  alert_error "Expected Ruby version #{required_version}, is #{Gem.ruby_version}"
@@ -149,7 +149,7 @@ By default, this RubyGems will install gem as:
149
149
 
150
150
  check_ruby_version
151
151
 
152
- require 'fileutils'
152
+ require "fileutils"
153
153
  if Gem.configuration.really_verbose
154
154
  extend FileUtils::Verbose
155
155
  else
@@ -194,7 +194,7 @@ By default, this RubyGems will install gem as:
194
194
  end
195
195
 
196
196
  if options[:previous_version].empty?
197
- options[:previous_version] = Gem::VERSION.sub(/[0-9]+$/, '0')
197
+ options[:previous_version] = Gem::VERSION.sub(/[0-9]+$/, "0")
198
198
  end
199
199
 
200
200
  options[:previous_version] = Gem::Version.new(options[:previous_version])
@@ -216,7 +216,7 @@ By default, this RubyGems will install gem as:
216
216
  end
217
217
 
218
218
  if documentation_success
219
- if options[:document].include? 'rdoc'
219
+ if options[:document].include? "rdoc"
220
220
  say "Rdoc documentation was installed. You may now invoke:"
221
221
  say " gem server"
222
222
  say "and then peruse beautifully formatted documentation for your gems"
@@ -227,7 +227,7 @@ By default, this RubyGems will install gem as:
227
227
  say
228
228
  end
229
229
 
230
- if options[:document].include? 'ri'
230
+ if options[:document].include? "ri"
231
231
  say "Ruby Interactive (ri) documentation was installed. ri is kind of like man "
232
232
  say "pages for Ruby libraries. You may access it like this:"
233
233
  say " ri Classname"
@@ -244,14 +244,14 @@ By default, this RubyGems will install gem as:
244
244
  def install_executables(bin_dir)
245
245
  prog_mode = options[:prog_mode] || 0755
246
246
 
247
- executables = { 'gem' => 'bin' }
247
+ executables = { "gem" => "bin" }
248
248
  executables.each do |tool, path|
249
249
  say "Installing #{tool} executable" if @verbose
250
250
 
251
251
  Dir.chdir path do
252
252
  bin_file = "gem"
253
253
 
254
- require 'tmpdir'
254
+ require "tmpdir"
255
255
 
256
256
  dest_file = target_bin_path(bin_dir, bin_file)
257
257
  bin_tmp_file = File.join Dir.tmpdir, "#{bin_file}.#{$$}"
@@ -260,7 +260,7 @@ By default, this RubyGems will install gem as:
260
260
  bin = File.readlines bin_file
261
261
  bin[0] = shebang
262
262
 
263
- File.open bin_tmp_file, 'w' do |fp|
263
+ File.open bin_tmp_file, "w" do |fp|
264
264
  fp.puts bin.join
265
265
  end
266
266
 
@@ -275,7 +275,7 @@ By default, this RubyGems will install gem as:
275
275
  begin
276
276
  bin_cmd_file = File.join Dir.tmpdir, "#{bin_file}.bat"
277
277
 
278
- File.open bin_cmd_file, 'w' do |file|
278
+ File.open bin_cmd_file, "w" do |file|
279
279
  file.puts <<-TEXT
280
280
  @ECHO OFF
281
281
  IF NOT "%~f0" == "~f0" GOTO :WinNT
@@ -296,7 +296,7 @@ By default, this RubyGems will install gem as:
296
296
 
297
297
  def shebang
298
298
  if options[:env_shebang]
299
- ruby_name = RbConfig::CONFIG['ruby_install_name']
299
+ ruby_name = RbConfig::CONFIG["ruby_install_name"]
300
300
  @env_path ||= ENV_PATHS.find {|env_path| File.executable? env_path }
301
301
  "#!#{@env_path} #{ruby_name}\n"
302
302
  else
@@ -305,8 +305,8 @@ By default, this RubyGems will install gem as:
305
305
  end
306
306
 
307
307
  def install_lib(lib_dir)
308
- libs = { 'RubyGems' => 'lib' }
309
- libs['Bundler'] = 'bundler/lib'
308
+ libs = { "RubyGems" => "lib" }
309
+ libs["Bundler"] = "bundler/lib"
310
310
  libs.each do |tool, path|
311
311
  say "Installing #{tool}" if @verbose
312
312
 
@@ -319,7 +319,7 @@ By default, this RubyGems will install gem as:
319
319
  end
320
320
 
321
321
  def install_rdoc
322
- gem_doc_dir = File.join Gem.dir, 'doc'
322
+ gem_doc_dir = File.join Gem.dir, "doc"
323
323
  rubygems_name = "rubygems-#{Gem::VERSION}"
324
324
  rubygems_doc_dir = File.join gem_doc_dir, rubygems_name
325
325
 
@@ -329,23 +329,23 @@ By default, this RubyGems will install gem as:
329
329
  # ignore
330
330
  end
331
331
 
332
- if File.writable? gem_doc_dir and
333
- (not File.exist? rubygems_doc_dir or
334
- File.writable? rubygems_doc_dir)
332
+ if File.writable?(gem_doc_dir) &&
333
+ (!File.exist?(rubygems_doc_dir) ||
334
+ File.writable?(rubygems_doc_dir))
335
335
  say "Removing old RubyGems RDoc and ri" if @verbose
336
- Dir[File.join(Gem.dir, 'doc', 'rubygems-[0-9]*')].each do |dir|
336
+ Dir[File.join(Gem.dir, "doc", "rubygems-[0-9]*")].each do |dir|
337
337
  rm_rf dir
338
338
  end
339
339
 
340
- require_relative '../rdoc'
340
+ require_relative "../rdoc"
341
341
 
342
- fake_spec = Gem::Specification.new 'rubygems', Gem::VERSION
342
+ fake_spec = Gem::Specification.new "rubygems", Gem::VERSION
343
343
  def fake_spec.full_gem_path
344
- File.expand_path '../../..', __dir__
344
+ File.expand_path "../../..", __dir__
345
345
  end
346
346
 
347
- generate_ri = options[:document].include? 'ri'
348
- generate_rdoc = options[:document].include? 'rdoc'
347
+ generate_ri = options[:document].include? "ri"
348
+ generate_rdoc = options[:document].include? "rdoc"
349
349
 
350
350
  rdoc = Gem::RDoc.new fake_spec, generate_rdoc, generate_ri
351
351
  rdoc.generate
@@ -360,34 +360,24 @@ By default, this RubyGems will install gem as:
360
360
  end
361
361
 
362
362
  def install_default_bundler_gem(bin_dir)
363
- specs_dir = File.join(default_dir, "specifications", "default")
364
- mkdir_p specs_dir, :mode => 0755
365
-
366
- bundler_spec = Dir.chdir("bundler") { Gem::Specification.load("bundler.gemspec") }
367
-
368
363
  current_default_spec = Gem::Specification.default_stubs.find {|s| s.name == "bundler" }
369
- if current_default_spec
370
- File.delete(current_default_spec.loaded_from)
364
+ specs_dir = if current_default_spec && default_dir == Gem.default_dir
371
365
  Gem::Specification.remove_spec current_default_spec
366
+ loaded_from = current_default_spec.loaded_from
367
+ File.delete(loaded_from)
368
+ File.dirname(loaded_from)
369
+ else
370
+ target_specs_dir = File.join(default_dir, "specifications", "default")
371
+ mkdir_p target_specs_dir, :mode => 0755
372
+ target_specs_dir
372
373
  end
373
374
 
375
+ bundler_spec = Dir.chdir("bundler") { Gem::Specification.load("bundler.gemspec") }
374
376
  default_spec_path = File.join(specs_dir, "#{bundler_spec.full_name}.gemspec")
375
377
  Gem.write_binary(default_spec_path, bundler_spec.to_ruby)
376
378
 
377
379
  bundler_spec = Gem::Specification.load(default_spec_path)
378
380
 
379
- # The base_dir value for a specification is inferred by walking up from the
380
- # folder where the spec was `loaded_from`. In the case of default gems, we
381
- # walk up two levels, because they live at `specifications/default/`, whereas
382
- # in the case of regular gems we walk up just one level because they live at
383
- # `specifications/`. However, in this case, the gem we are installing is
384
- # misdetected as a regular gem, when it's a default gem in reality. This is
385
- # because when there's a `:destdir`, the `loaded_from` path has changed and
386
- # doesn't match `Gem.default_specifications_dir` which is the criteria to
387
- # tag a gem as a default gem. So, in that case, write the correct
388
- # `@base_dir` directly.
389
- bundler_spec.instance_variable_set(:@base_dir, File.dirname(File.dirname(specs_dir)))
390
-
391
381
  # Remove gemspec that was same version of vendored bundler.
392
382
  normal_gemspec = File.join(default_dir, "specifications", "bundler-#{bundler_spec.version}.gemspec")
393
383
  if File.file? normal_gemspec
@@ -407,7 +397,7 @@ By default, this RubyGems will install gem as:
407
397
  cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e)
408
398
  end
409
399
 
410
- require_relative '../installer'
400
+ require_relative "../installer"
411
401
 
412
402
  Dir.chdir("bundler") do
413
403
  built_gem = Gem::Package.build(bundler_spec)
@@ -449,10 +439,10 @@ By default, this RubyGems will install gem as:
449
439
  prefix = options[:prefix]
450
440
 
451
441
  if prefix.empty?
452
- man_dir = RbConfig::CONFIG['mandir']
442
+ man_dir = RbConfig::CONFIG["mandir"]
453
443
  return unless man_dir
454
444
  else
455
- man_dir = File.join prefix, 'man'
445
+ man_dir = File.join prefix, "man"
456
446
  end
457
447
 
458
448
  prepend_destdir_if_present(man_dir)
@@ -464,10 +454,10 @@ By default, this RubyGems will install gem as:
464
454
 
465
455
  if prefix.empty?
466
456
  lib_dir = RbConfig::CONFIG[site_or_vendor]
467
- bin_dir = RbConfig::CONFIG['bindir']
457
+ bin_dir = RbConfig::CONFIG["bindir"]
468
458
  else
469
- lib_dir = File.join prefix, 'lib'
470
- bin_dir = File.join prefix, 'bin'
459
+ lib_dir = File.join prefix, "lib"
460
+ bin_dir = File.join prefix, "bin"
471
461
  end
472
462
 
473
463
  [prepend_destdir_if_present(lib_dir), prepend_destdir_if_present(bin_dir)]
@@ -475,19 +465,19 @@ By default, this RubyGems will install gem as:
475
465
 
476
466
  def files_in(dir)
477
467
  Dir.chdir dir do
478
- Dir.glob(File.join('**', '*'), File::FNM_DOTMATCH).
468
+ Dir.glob(File.join("**", "*"), File::FNM_DOTMATCH).
479
469
  select {|f| !File.directory?(f) }
480
470
  end
481
471
  end
482
472
 
483
473
  def remove_old_bin_files(bin_dir)
484
474
  old_bin_files = {
485
- 'gem_mirror' => 'gem mirror',
486
- 'gem_server' => 'gem server',
487
- 'gemlock' => 'gem lock',
488
- 'gemri' => 'ri',
489
- 'gemwhich' => 'gem which',
490
- 'index_gem_repository.rb' => 'gem generate_index',
475
+ "gem_mirror" => "gem mirror",
476
+ "gem_server" => "gem server",
477
+ "gemlock" => "gem lock",
478
+ "gemri" => "ri",
479
+ "gemwhich" => "gem which",
480
+ "index_gem_repository.rb" => "gem generate_index",
491
481
  }
492
482
 
493
483
  old_bin_files.each do |old_bin_file, new_name|
@@ -496,7 +486,7 @@ By default, this RubyGems will install gem as:
496
486
 
497
487
  deprecation_message = "`#{old_bin_file}` has been deprecated. Use `#{new_name}` instead."
498
488
 
499
- File.open old_bin_path, 'w' do |fp|
489
+ File.open old_bin_path, "w" do |fp|
500
490
  fp.write <<-EOF
501
491
  #!#{Gem.ruby}
502
492
 
@@ -506,15 +496,15 @@ abort "#{deprecation_message}"
506
496
 
507
497
  next unless Gem.win_platform?
508
498
 
509
- File.open "#{old_bin_path}.bat", 'w' do |fp|
499
+ File.open "#{old_bin_path}.bat", "w" do |fp|
510
500
  fp.puts %(@ECHO.#{deprecation_message})
511
501
  end
512
502
  end
513
503
  end
514
504
 
515
505
  def remove_old_lib_files(lib_dir)
516
- lib_dirs = { File.join(lib_dir, 'rubygems') => 'lib/rubygems' }
517
- lib_dirs[File.join(lib_dir, 'bundler')] = 'bundler/lib/bundler'
506
+ lib_dirs = { File.join(lib_dir, "rubygems") => "lib/rubygems" }
507
+ lib_dirs[File.join(lib_dir, "bundler")] = "bundler/lib/bundler"
518
508
  lib_dirs.each do |old_lib_dir, new_lib_dir|
519
509
  lib_files = files_in(new_lib_dir)
520
510
 
@@ -522,11 +512,11 @@ abort "#{deprecation_message}"
522
512
 
523
513
  to_remove = old_lib_files - lib_files
524
514
 
525
- gauntlet_rubygems = File.join(lib_dir, 'gauntlet_rubygems.rb')
515
+ gauntlet_rubygems = File.join(lib_dir, "gauntlet_rubygems.rb")
526
516
  to_remove << gauntlet_rubygems if File.exist? gauntlet_rubygems
527
517
 
528
518
  to_remove.delete_if do |file|
529
- file.start_with? 'defaults'
519
+ file.start_with? "defaults"
530
520
  end
531
521
 
532
522
  remove_file_list(to_remove, old_lib_dir)
@@ -552,7 +542,7 @@ abort "#{deprecation_message}"
552
542
  end
553
543
 
554
544
  def show_release_notes
555
- release_notes = File.join Dir.pwd, 'CHANGELOG.md'
545
+ release_notes = File.join Dir.pwd, "CHANGELOG.md"
556
546
 
557
547
  release_notes =
558
548
  if File.exist? release_notes
@@ -569,7 +559,7 @@ abort "#{deprecation_message}"
569
559
 
570
560
  history_string = ""
571
561
 
572
- until versions.length == 0 or
562
+ until versions.length == 0 ||
573
563
  versions.shift <= options[:previous_version] do
574
564
  history_string += version_lines.shift + text.shift
575
565
  end
@@ -583,10 +573,10 @@ abort "#{deprecation_message}"
583
573
  end
584
574
 
585
575
  def uninstall_old_gemcutter
586
- require_relative '../uninstaller'
576
+ require_relative "../uninstaller"
587
577
 
588
- ui = Gem::Uninstaller.new('gemcutter', :all => true, :ignore => true,
589
- :version => '< 0.4')
578
+ ui = Gem::Uninstaller.new("gemcutter", :all => true, :ignore => true,
579
+ :version => "< 0.4")
590
580
  ui.uninstall
591
581
  rescue Gem::InstallError
592
582
  end
@@ -635,7 +625,7 @@ abort "#{deprecation_message}"
635
625
  destdir = options[:destdir]
636
626
  return path if destdir.empty?
637
627
 
638
- File.join(options[:destdir], path.gsub(/^[a-zA-Z]:/, ''))
628
+ File.join(options[:destdir], path.gsub(/^[a-zA-Z]:/, ""))
639
629
  end
640
630
 
641
631
  def install_file_list(files, dest_dir)
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
- require_relative '../command'
3
- require_relative '../gemcutter_utilities'
2
+ require_relative "../command"
3
+ require_relative "../gemcutter_utilities"
4
4
 
5
5
  class Gem::Commands::SigninCommand < Gem::Command
6
6
  include Gem::GemcutterUtilities
7
7
 
8
8
  def initialize
9
- super 'signin', 'Sign in to any gemcutter-compatible host. '\
10
- 'It defaults to https://rubygems.org'
9
+ super "signin", "Sign in to any gemcutter-compatible host. "\
10
+ "It defaults to https://rubygems.org"
11
11
 
12
- add_option('--host HOST', 'Push to another gemcutter-compatible host') do |value, options|
12
+ add_option("--host HOST", "Push to another gemcutter-compatible host") do |value, options|
13
13
  options[:host] = value
14
14
  end
15
15
 
@@ -17,10 +17,10 @@ class Gem::Commands::SigninCommand < Gem::Command
17
17
  end
18
18
 
19
19
  def description # :nodoc:
20
- 'The signin command executes host sign in for a push server (the default is'\
21
- ' https://rubygems.org). The host can be provided with the host flag or can'\
22
- ' be inferred from the provided gem. Host resolution matches the resolution'\
23
- ' strategy for the push command.'
20
+ "The signin command executes host sign in for a push server (the default is"\
21
+ " https://rubygems.org). The host can be provided with the host flag or can"\
22
+ " be inferred from the provided gem. Host resolution matches the resolution"\
23
+ " strategy for the push command."
24
24
  end
25
25
 
26
26
  def usage # :nodoc:
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
- require_relative '../command'
2
+ require_relative "../command"
3
3
 
4
4
  class Gem::Commands::SignoutCommand < Gem::Command
5
5
  def initialize
6
- super 'signout', 'Sign out from all the current sessions.'
6
+ super "signout", "Sign out from all the current sessions."
7
7
  end
8
8
 
9
9
  def description # :nodoc:
10
- 'The `signout` command is used to sign out from all current sessions,'\
11
- ' allowing you to sign in using a different set of credentials.'
10
+ "The `signout` command is used to sign out from all current sessions,"\
11
+ " allowing you to sign in using a different set of credentials."
12
12
  end
13
13
 
14
14
  def usage # :nodoc:
@@ -19,13 +19,13 @@ class Gem::Commands::SignoutCommand < Gem::Command
19
19
  credentials_path = Gem.configuration.credentials_path
20
20
 
21
21
  if !File.exist?(credentials_path)
22
- alert_error 'You are not currently signed in.'
22
+ alert_error "You are not currently signed in."
23
23
  elsif !File.writable?(credentials_path)
24
24
  alert_error "File '#{Gem.configuration.credentials_path}' is read-only."\
25
- ' Please make sure it is writable.'
25
+ " Please make sure it is writable."
26
26
  else
27
27
  Gem.configuration.unset_api_key!
28
- say 'You have successfully signed out from all sessions.'
28
+ say "You have successfully signed out from all sessions."
29
29
  end
30
30
  end
31
31
  end
@@ -1,40 +1,40 @@
1
1
  # frozen_string_literal: true
2
- require_relative '../command'
3
- require_relative '../remote_fetcher'
4
- require_relative '../spec_fetcher'
5
- require_relative '../local_remote_options'
2
+ require_relative "../command"
3
+ require_relative "../remote_fetcher"
4
+ require_relative "../spec_fetcher"
5
+ require_relative "../local_remote_options"
6
6
 
7
7
  class Gem::Commands::SourcesCommand < Gem::Command
8
8
  include Gem::LocalRemoteOptions
9
9
 
10
10
  def initialize
11
- require 'fileutils'
11
+ require "fileutils"
12
12
 
13
- super 'sources',
14
- 'Manage the sources and cache file RubyGems uses to search for gems'
13
+ super "sources",
14
+ "Manage the sources and cache file RubyGems uses to search for gems"
15
15
 
16
- add_option '-a', '--add SOURCE_URI', 'Add source' do |value, options|
16
+ add_option "-a", "--add SOURCE_URI", "Add source" do |value, options|
17
17
  options[:add] = value
18
18
  end
19
19
 
20
- add_option '-l', '--list', 'List sources' do |value, options|
20
+ add_option "-l", "--list", "List sources" do |value, options|
21
21
  options[:list] = value
22
22
  end
23
23
 
24
- add_option '-r', '--remove SOURCE_URI', 'Remove source' do |value, options|
24
+ add_option "-r", "--remove SOURCE_URI", "Remove source" do |value, options|
25
25
  options[:remove] = value
26
26
  end
27
27
 
28
- add_option '-c', '--clear-all',
29
- 'Remove all sources (clear the cache)' do |value, options|
28
+ add_option "-c", "--clear-all",
29
+ "Remove all sources (clear the cache)" do |value, options|
30
30
  options[:clear_all] = value
31
31
  end
32
32
 
33
- add_option '-u', '--update', 'Update source cache' do |value, options|
33
+ add_option "-u", "--update", "Update source cache" do |value, options|
34
34
  options[:update] = value
35
35
  end
36
36
 
37
- add_option '-f', '--[no-]force', "Do not show any confirmation prompts and behave as if 'yes' was always answered" do |value, options|
37
+ add_option "-f", "--[no-]force", "Do not show any confirmation prompts and behave as if 'yes' was always answered" do |value, options|
38
38
  options[:force] = value
39
39
  end
40
40
 
@@ -82,8 +82,8 @@ Do you want to add this source?
82
82
  def check_rubygems_https(source_uri) # :nodoc:
83
83
  uri = URI source_uri
84
84
 
85
- if uri.scheme and uri.scheme.downcase == 'http' and
86
- uri.host.downcase == 'rubygems.org'
85
+ if uri.scheme && uri.scheme.downcase == "http" &&
86
+ uri.host.downcase == "rubygems.org"
87
87
  question = <<-QUESTION.chomp
88
88
  https://rubygems.org is recommended for security over #{uri}
89
89
 
@@ -112,7 +112,7 @@ Do you want to add this insecure source?
112
112
  end
113
113
 
114
114
  def defaults_str # :nodoc:
115
- '--list'
115
+ "--list"
116
116
  end
117
117
 
118
118
  def description # :nodoc:
@@ -138,8 +138,8 @@ do not recognize you should remove them.
138
138
  RubyGems has been configured to serve gems via the following URLs through
139
139
  its history:
140
140
 
141
- * http://gems.rubyforge.org (RubyGems 1.3.6 and earlier)
142
- * https://rubygems.org/ (RubyGems 1.3.7 through 1.8.25)
141
+ * http://gems.rubyforge.org (RubyGems 1.3.5 and earlier)
142
+ * http://rubygems.org (RubyGems 1.3.6 through 1.8.30, and 2.0.0)
143
143
  * https://rubygems.org (RubyGems 2.0.1 and newer)
144
144
 
145
145
  Since all of these sources point to the same set of gems you only need one
@@ -215,9 +215,9 @@ To remove a source use the --remove argument:
215
215
  def remove_cache_file(desc, path) # :nodoc:
216
216
  FileUtils.rm_rf path
217
217
 
218
- if not File.exist?(path)
218
+ if !File.exist?(path)
219
219
  say "*** Removed #{desc} source cache ***"
220
- elsif not File.writable?(path)
220
+ elsif !File.writable?(path)
221
221
  say "*** Unable to remove #{desc} source cache (write protected) ***"
222
222
  else
223
223
  say "*** Unable to remove #{desc} source cache ***"