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,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
- require_relative 'helper'
2
+ require_relative "helper"
3
3
 
4
- require 'webrick'
5
- require 'webrick/https' if Gem::HAVE_OPENSSL
4
+ require "webrick"
5
+ require "webrick/https" if Gem::HAVE_OPENSSL
6
6
 
7
7
  unless Gem::HAVE_OPENSSL
8
- warn 'Skipping Gem::RemoteFetcher tests. openssl not found.'
8
+ warn "Skipping Gem::RemoteFetcher tests. openssl not found."
9
9
  end
10
10
 
11
- require 'rubygems/remote_fetcher'
12
- require 'rubygems/package'
11
+ require "rubygems/remote_fetcher"
12
+ require "rubygems/package"
13
13
 
14
14
  # = Testing Proxy Settings
15
15
  #
@@ -69,7 +69,7 @@ gems:
69
69
  dependencies: []
70
70
  EOY
71
71
 
72
- PROXY_DATA = SERVER_DATA.gsub(/0.4.11/, '0.4.2')
72
+ PROXY_DATA = SERVER_DATA.gsub(/0.4.11/, "0.4.2")
73
73
 
74
74
  # Generated via:
75
75
  # x = OpenSSL::PKey::DH.new(2048) # wait a while...
@@ -104,11 +104,11 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
104
104
  @cache_dir = File.join @gemhome, "cache"
105
105
 
106
106
  # TODO: why does the remote fetcher need it written to disk?
107
- @a1, @a1_gem = util_gem 'a', '1' do |s|
108
- s.executables << 'a_bin'
107
+ @a1, @a1_gem = util_gem "a", "1" do |s|
108
+ s.executables << "a_bin"
109
109
  end
110
110
 
111
- @a1.loaded_from = File.join(@gemhome, 'specifications', @a1.full_name)
111
+ @a1.loaded_from = File.join(@gemhome, "specifications", @a1.full_name)
112
112
 
113
113
  Gem::RemoteFetcher.fetcher = nil
114
114
  @stub_ui = Gem::MockGemUi.new
@@ -130,7 +130,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
130
130
  end
131
131
 
132
132
  def test_self_fetcher_with_proxy
133
- proxy_uri = 'http://proxy.example.com'
133
+ proxy_uri = "http://proxy.example.com"
134
134
  Gem.configuration[:http_proxy] = proxy_uri
135
135
  Gem::RemoteFetcher.fetcher = nil
136
136
 
@@ -149,34 +149,34 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
149
149
  @fetcher.fetch_path("gems.example.com/yaml", nil, true)
150
150
  end
151
151
 
152
- assert_equal 'uri scheme is invalid: nil', e.message
152
+ assert_equal "uri scheme is invalid: nil", e.message
153
153
  end
154
154
 
155
155
  def test_no_proxy
156
156
  use_ui @stub_ui do
157
157
  assert_data_from_server @fetcher.fetch_path(@server_uri)
158
158
  response = @fetcher.fetch_path(@server_uri, nil, true)
159
- assert_equal SERVER_DATA.size, response['content-length'].to_i
159
+ assert_equal SERVER_DATA.size, response["content-length"].to_i
160
160
  end
161
161
  end
162
162
 
163
163
  def test_cache_update_path
164
- uri = URI 'http://example/file'
165
- path = File.join @tempdir, 'file'
164
+ uri = URI "http://example/file"
165
+ path = File.join @tempdir, "file"
166
166
 
167
- fetcher = util_fuck_with_fetcher 'hello'
167
+ fetcher = util_fuck_with_fetcher "hello"
168
168
 
169
169
  data = fetcher.cache_update_path uri, path
170
170
 
171
- assert_equal 'hello', data
171
+ assert_equal "hello", data
172
172
 
173
- assert_equal 'hello', File.read(path)
173
+ assert_equal "hello", File.read(path)
174
174
  end
175
175
 
176
176
  def test_cache_update_path_with_utf8_internal_encoding
177
- with_internal_encoding('UTF-8') do
178
- uri = URI 'http://example/file'
179
- path = File.join @tempdir, 'file'
177
+ with_internal_encoding("UTF-8") do
178
+ uri = URI "http://example/file"
179
+ path = File.join @tempdir, "file"
180
180
  data = String.new("\xC8").force_encoding(Encoding::BINARY)
181
181
 
182
182
  fetcher = util_fuck_with_fetcher data
@@ -189,14 +189,14 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
189
189
  end
190
190
 
191
191
  def test_cache_update_path_no_update
192
- uri = URI 'http://example/file'
193
- path = File.join @tempdir, 'file'
192
+ uri = URI "http://example/file"
193
+ path = File.join @tempdir, "file"
194
194
 
195
- fetcher = util_fuck_with_fetcher 'hello'
195
+ fetcher = util_fuck_with_fetcher "hello"
196
196
 
197
197
  data = fetcher.cache_update_path uri, path, false
198
198
 
199
- assert_equal 'hello', data
199
+ assert_equal "hello", data
200
200
 
201
201
  assert_path_not_exist path
202
202
  end
@@ -219,7 +219,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
219
219
  @test_data
220
220
  end
221
221
 
222
- raise Gem::RemoteFetcher::FetchError.new("haha!", '')
222
+ raise Gem::RemoteFetcher::FetchError.new("haha!", "")
223
223
  end
224
224
  end
225
225
 
@@ -228,14 +228,14 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
228
228
 
229
229
  def test_download
230
230
  a1_data = nil
231
- File.open @a1_gem, 'rb' do |fp|
231
+ File.open @a1_gem, "rb" do |fp|
232
232
  a1_data = fp.read
233
233
  end
234
234
 
235
235
  fetcher = util_fuck_with_fetcher a1_data
236
236
 
237
237
  a1_cache_gem = @a1.cache_file
238
- assert_equal a1_cache_gem, fetcher.download(@a1, 'http://gems.example.com')
238
+ assert_equal a1_cache_gem, fetcher.download(@a1, "http://gems.example.com")
239
239
  assert_equal("http://gems.example.com/gems/a-1.gem",
240
240
  fetcher.instance_variable_get(:@test_arg).to_s)
241
241
  assert File.exist?(a1_cache_gem)
@@ -243,14 +243,14 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
243
243
 
244
244
  def test_download_with_auth
245
245
  a1_data = nil
246
- File.open @a1_gem, 'rb' do |fp|
246
+ File.open @a1_gem, "rb" do |fp|
247
247
  a1_data = fp.read
248
248
  end
249
249
 
250
250
  fetcher = util_fuck_with_fetcher a1_data
251
251
 
252
252
  a1_cache_gem = @a1.cache_file
253
- assert_equal a1_cache_gem, fetcher.download(@a1, 'http://user:password@gems.example.com')
253
+ assert_equal a1_cache_gem, fetcher.download(@a1, "http://user:password@gems.example.com")
254
254
  assert_equal("http://user:password@gems.example.com/gems/a-1.gem",
255
255
  fetcher.instance_variable_get(:@test_arg).to_s)
256
256
  assert File.exist?(a1_cache_gem)
@@ -258,14 +258,14 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
258
258
 
259
259
  def test_download_with_token
260
260
  a1_data = nil
261
- File.open @a1_gem, 'rb' do |fp|
261
+ File.open @a1_gem, "rb" do |fp|
262
262
  a1_data = fp.read
263
263
  end
264
264
 
265
265
  fetcher = util_fuck_with_fetcher a1_data
266
266
 
267
267
  a1_cache_gem = @a1.cache_file
268
- assert_equal a1_cache_gem, fetcher.download(@a1, 'http://token@gems.example.com')
268
+ assert_equal a1_cache_gem, fetcher.download(@a1, "http://token@gems.example.com")
269
269
  assert_equal("http://token@gems.example.com/gems/a-1.gem",
270
270
  fetcher.instance_variable_get(:@test_arg).to_s)
271
271
  assert File.exist?(a1_cache_gem)
@@ -273,14 +273,14 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
273
273
 
274
274
  def test_download_with_x_oauth_basic
275
275
  a1_data = nil
276
- File.open @a1_gem, 'rb' do |fp|
276
+ File.open @a1_gem, "rb" do |fp|
277
277
  a1_data = fp.read
278
278
  end
279
279
 
280
280
  fetcher = util_fuck_with_fetcher a1_data
281
281
 
282
282
  a1_cache_gem = @a1.cache_file
283
- assert_equal a1_cache_gem, fetcher.download(@a1, 'http://token:x-oauth-basic@gems.example.com')
283
+ assert_equal a1_cache_gem, fetcher.download(@a1, "http://token:x-oauth-basic@gems.example.com")
284
284
  assert_equal("http://token:x-oauth-basic@gems.example.com/gems/a-1.gem",
285
285
  fetcher.instance_variable_get(:@test_arg).to_s)
286
286
  assert File.exist?(a1_cache_gem)
@@ -288,14 +288,14 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
288
288
 
289
289
  def test_download_with_encoded_auth
290
290
  a1_data = nil
291
- File.open @a1_gem, 'rb' do |fp|
291
+ File.open @a1_gem, "rb" do |fp|
292
292
  a1_data = fp.read
293
293
  end
294
294
 
295
295
  fetcher = util_fuck_with_fetcher a1_data
296
296
 
297
297
  a1_cache_gem = @a1.cache_file
298
- assert_equal a1_cache_gem, fetcher.download(@a1, 'http://user:%25pas%25sword@gems.example.com')
298
+ assert_equal a1_cache_gem, fetcher.download(@a1, "http://user:%25pas%25sword@gems.example.com")
299
299
  assert_equal("http://user:%25pas%25sword@gems.example.com/gems/a-1.gem",
300
300
  fetcher.instance_variable_get(:@test_arg).to_s)
301
301
  assert File.exist?(a1_cache_gem)
@@ -306,7 +306,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
306
306
 
307
307
  inst = Gem::RemoteFetcher.fetcher
308
308
 
309
- assert_equal @a1.cache_file, inst.download(@a1, 'http://gems.example.com')
309
+ assert_equal @a1.cache_file, inst.download(@a1, "http://gems.example.com")
310
310
  end
311
311
 
312
312
  def test_download_local
@@ -322,7 +322,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
322
322
  end
323
323
 
324
324
  def test_download_local_space
325
- space_path = File.join @tempdir, 'space path'
325
+ space_path = File.join @tempdir, "space path"
326
326
  FileUtils.mkdir space_path
327
327
  FileUtils.mv @a1_gem, space_path
328
328
  local_path = File.join space_path, @a1.file_name
@@ -336,17 +336,17 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
336
336
  end
337
337
 
338
338
  def test_download_install_dir
339
- a1_data = File.open @a1_gem, 'rb' do |fp|
339
+ a1_data = File.open @a1_gem, "rb" do |fp|
340
340
  fp.read
341
341
  end
342
342
 
343
343
  fetcher = util_fuck_with_fetcher a1_data
344
344
 
345
- install_dir = File.join @tempdir, 'more_gems'
345
+ install_dir = File.join @tempdir, "more_gems"
346
346
 
347
347
  a1_cache_gem = File.join install_dir, "cache", @a1.file_name
348
348
  FileUtils.mkdir_p(File.dirname(a1_cache_gem))
349
- actual = fetcher.download(@a1, 'http://gems.example.com', install_dir)
349
+ actual = fetcher.download(@a1, "http://gems.example.com", install_dir)
350
350
 
351
351
  assert_equal a1_cache_gem, actual
352
352
  assert_equal("http://gems.example.com/gems/a-1.gem",
@@ -380,7 +380,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
380
380
  FileUtils.chmod 0555, @gemhome
381
381
 
382
382
  fetcher = util_fuck_with_fetcher File.read(@a1_gem)
383
- fetcher.download(@a1, 'http://gems.example.com')
383
+ fetcher.download(@a1, "http://gems.example.com")
384
384
  a1_cache_gem = File.join Gem.user_dir, "cache", @a1.file_name
385
385
  assert File.exist? a1_cache_gem
386
386
  ensure
@@ -390,16 +390,16 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
390
390
  end
391
391
 
392
392
  def test_download_platform_legacy
393
- original_platform = 'old-platform'
393
+ original_platform = "old-platform"
394
394
 
395
- e1, e1_gem = util_gem 'e', '1' do |s|
395
+ e1, e1_gem = util_gem "e", "1" do |s|
396
396
  s.platform = Gem::Platform::CURRENT
397
397
  s.instance_variable_set :@original_platform, original_platform
398
398
  end
399
- e1.loaded_from = File.join(@gemhome, 'specifications', e1.full_name)
399
+ e1.loaded_from = File.join(@gemhome, "specifications", e1.full_name)
400
400
 
401
401
  e1_data = nil
402
- File.open e1_gem, 'rb' do |fp|
402
+ File.open e1_gem, "rb" do |fp|
403
403
  e1_data = fp.read
404
404
  end
405
405
 
@@ -407,7 +407,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
407
407
 
408
408
  e1_cache_gem = e1.cache_file
409
409
 
410
- assert_equal e1_cache_gem, fetcher.download(e1, 'http://gems.example.com')
410
+ assert_equal e1_cache_gem, fetcher.download(e1, "http://gems.example.com")
411
411
 
412
412
  assert_equal("http://gems.example.com/gems/#{e1.original_name}.gem",
413
413
  fetcher.instance_variable_get(:@test_arg).to_s)
@@ -435,14 +435,14 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
435
435
  inst = Gem::RemoteFetcher.fetcher
436
436
 
437
437
  e = assert_raise ArgumentError do
438
- inst.download @a1, 'ftp://gems.rubyforge.org'
438
+ inst.download @a1, "ftp://gems.rubyforge.org"
439
439
  end
440
440
 
441
- assert_equal 'unsupported URI scheme ftp', e.message
441
+ assert_equal "unsupported URI scheme ftp", e.message
442
442
  end
443
443
 
444
444
  def test_download_to_cache
445
- @a2, @a2_gem = util_gem 'a', '2'
445
+ @a2, @a2_gem = util_gem "a", "2"
446
446
 
447
447
  util_setup_spec_fetcher @a1, @a2
448
448
  @fetcher.instance_variable_set :@a1, @a1
@@ -458,7 +458,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
458
458
  end
459
459
  end
460
460
 
461
- gem = Gem::RemoteFetcher.fetcher.download_to_cache dep 'a'
461
+ gem = Gem::RemoteFetcher.fetcher.download_to_cache dep "a"
462
462
 
463
463
  assert_equal @a2.file_name, File.basename(gem)
464
464
  end
@@ -468,10 +468,10 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
468
468
  @fetcher = fetcher
469
469
 
470
470
  def fetcher.fetch_http(uri, mtime, head = nil)
471
- Gem::Util.gzip 'foo'
471
+ Gem::Util.gzip "foo"
472
472
  end
473
473
 
474
- assert_equal 'foo', fetcher.fetch_path(@uri + 'foo.gz')
474
+ assert_equal "foo", fetcher.fetch_path(@uri + "foo.gz")
475
475
  end
476
476
 
477
477
  def test_fetch_path_gzip_unmodified
@@ -482,7 +482,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
482
482
  nil
483
483
  end
484
484
 
485
- assert_nil fetcher.fetch_path(@uri + 'foo.gz', Time.at(0))
485
+ assert_nil fetcher.fetch_path(@uri + "foo.gz", Time.at(0))
486
486
  end
487
487
 
488
488
  def test_fetch_path_io_error
@@ -493,7 +493,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
493
493
  raise EOFError
494
494
  end
495
495
 
496
- url = 'http://example.com/uri'
496
+ url = "http://example.com/uri"
497
497
 
498
498
  e = assert_raise Gem::RemoteFetcher::FetchError do
499
499
  fetcher.fetch_path url
@@ -511,7 +511,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
511
511
  raise SocketError
512
512
  end
513
513
 
514
- url = 'http://example.com/uri'
514
+ url = "http://example.com/uri"
515
515
 
516
516
  e = assert_raise Gem::RemoteFetcher::FetchError do
517
517
  fetcher.fetch_path url
@@ -526,10 +526,10 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
526
526
  @fetcher = fetcher
527
527
 
528
528
  def fetcher.fetch_http(uri, mtime = nil, head = nil)
529
- raise Errno::ECONNREFUSED, 'connect(2)'
529
+ raise Errno::ECONNREFUSED, "connect(2)"
530
530
  end
531
531
 
532
- url = 'http://example.com/uri'
532
+ url = "http://example.com/uri"
533
533
 
534
534
  e = assert_raise Gem::RemoteFetcher::FetchError do
535
535
  fetcher.fetch_path url
@@ -545,10 +545,10 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
545
545
  @fetcher = fetcher
546
546
 
547
547
  def fetcher.fetch_http(uri, mtime = nil, head = nil)
548
- raise Timeout::Error, 'timed out'
548
+ raise Timeout::Error, "timed out"
549
549
  end
550
550
 
551
- url = 'http://example.com/uri'
551
+ url = "http://example.com/uri"
552
552
 
553
553
  e = assert_raise Gem::RemoteFetcher::FetchError do
554
554
  fetcher.fetch_path url
@@ -564,10 +564,10 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
564
564
  @fetcher = fetcher
565
565
 
566
566
  def fetcher.fetch_http(uri, mtime = nil, head = nil)
567
- raise SocketError, 'getaddrinfo: nodename nor servname provided'
567
+ raise SocketError, "getaddrinfo: nodename nor servname provided"
568
568
  end
569
569
 
570
- url = 'http://example.com/uri'
570
+ url = "http://example.com/uri"
571
571
 
572
572
  e = assert_raise Gem::RemoteFetcher::FetchError do
573
573
  fetcher.fetch_path url
@@ -586,7 +586,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
586
586
  raise OpenSSL::SSL::SSLError
587
587
  end
588
588
 
589
- url = 'http://example.com/uri'
589
+ url = "http://example.com/uri"
590
590
 
591
591
  e = assert_raise Gem::RemoteFetcher::FetchError do
592
592
  fetcher.fetch_path url
@@ -609,7 +609,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
609
609
 
610
610
  def test_implicit_no_proxy
611
611
  use_ui @stub_ui do
612
- ENV['http_proxy'] = 'http://fakeurl:12345'
612
+ ENV["http_proxy"] = "http://fakeurl:12345"
613
613
  fetcher = Gem::RemoteFetcher.new :no_proxy
614
614
  @fetcher = fetcher
615
615
  assert_data_from_server fetcher.fetch_path(@server_uri)
@@ -618,7 +618,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
618
618
 
619
619
  def test_implicit_proxy
620
620
  use_ui @stub_ui do
621
- ENV['http_proxy'] = @proxy_uri
621
+ ENV["http_proxy"] = @proxy_uri
622
622
  fetcher = Gem::RemoteFetcher.new nil
623
623
  @fetcher = fetcher
624
624
  assert_data_from_proxy fetcher.fetch_path(@server_uri)
@@ -627,7 +627,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
627
627
 
628
628
  def test_implicit_upper_case_proxy
629
629
  use_ui @stub_ui do
630
- ENV['HTTP_PROXY'] = @proxy_uri
630
+ ENV["HTTP_PROXY"] = @proxy_uri
631
631
  fetcher = Gem::RemoteFetcher.new nil
632
632
  @fetcher = fetcher
633
633
  assert_data_from_proxy fetcher.fetch_path(@server_uri)
@@ -645,36 +645,36 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
645
645
  def test_fetch_http
646
646
  fetcher = Gem::RemoteFetcher.new nil
647
647
  @fetcher = fetcher
648
- url = 'http://gems.example.com/redirect'
648
+ url = "http://gems.example.com/redirect"
649
649
 
650
650
  def fetcher.request(uri, request_class, last_modified = nil)
651
- url = 'http://gems.example.com/redirect'
651
+ url = "http://gems.example.com/redirect"
652
652
  unless defined? @requested
653
653
  @requested = true
654
654
  res = Net::HTTPMovedPermanently.new nil, 301, nil
655
- res.add_field 'Location', url
655
+ res.add_field "Location", url
656
656
  res
657
657
  else
658
658
  res = Net::HTTPOK.new nil, 200, nil
659
- def res.body() 'real_path' end
659
+ def res.body() "real_path" end
660
660
  res
661
661
  end
662
662
  end
663
663
 
664
664
  data = fetcher.fetch_http URI.parse(url)
665
665
 
666
- assert_equal 'real_path', data
666
+ assert_equal "real_path", data
667
667
  end
668
668
 
669
669
  def test_fetch_http_redirects
670
670
  fetcher = Gem::RemoteFetcher.new nil
671
671
  @fetcher = fetcher
672
- url = 'http://gems.example.com/redirect'
672
+ url = "http://gems.example.com/redirect"
673
673
 
674
674
  def fetcher.request(uri, request_class, last_modified = nil)
675
- url = 'http://gems.example.com/redirect'
675
+ url = "http://gems.example.com/redirect"
676
676
  res = Net::HTTPMovedPermanently.new nil, 301, nil
677
- res.add_field 'Location', url
677
+ res.add_field "Location", url
678
678
  res
679
679
  end
680
680
 
@@ -688,7 +688,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
688
688
  def test_fetch_http_redirects_without_location
689
689
  fetcher = Gem::RemoteFetcher.new nil
690
690
  @fetcher = fetcher
691
- url = 'http://gems.example.com/redirect'
691
+ url = "http://gems.example.com/redirect"
692
692
 
693
693
  def fetcher.request(uri, request_class, last_modified = nil)
694
694
  res = Net::HTTPMovedPermanently.new nil, 301, nil
@@ -710,7 +710,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
710
710
  assert_equal "murphy", fetcher.fetch_path(@server_uri)
711
711
  end
712
712
 
713
- def assert_fetch_s3(url, signature, token=nil, region='us-east-1', instance_profile_json=nil)
713
+ def assert_fetch_s3(url, signature, token=nil, region="us-east-1", instance_profile_json=nil)
714
714
  fetcher = Gem::RemoteFetcher.new nil
715
715
  @fetcher = fetcher
716
716
  $fetched_uri = nil
@@ -719,12 +719,12 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
719
719
  def fetcher.request(uri, request_class, last_modified = nil)
720
720
  $fetched_uri = uri
721
721
  res = Net::HTTPOK.new nil, 200, nil
722
- def res.body() 'success' end
722
+ def res.body() "success" end
723
723
  res
724
724
  end
725
725
 
726
726
  def fetcher.s3_uri_signer(uri)
727
- require 'json'
727
+ require "json"
728
728
  s3_uri_signer = Gem::S3URISigner.new(uri)
729
729
  def s3_uri_signer.ec2_metadata_credentials_json
730
730
  JSON.parse($instance_profile)
@@ -738,18 +738,18 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
738
738
  data = fetcher.fetch_s3 URI.parse(url)
739
739
 
740
740
  assert_equal "https://my-bucket.s3.#{region}.amazonaws.com/gems/specs.4.8.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=testuser%2F20190624%2F#{region}%2Fs3%2Faws4_request&X-Amz-Date=20190624T050641Z&X-Amz-Expires=86400#{token ? "&X-Amz-Security-Token=" + token : ""}&X-Amz-SignedHeaders=host&X-Amz-Signature=#{signature}", $fetched_uri.to_s
741
- assert_equal 'success', data
741
+ assert_equal "success", data
742
742
  ensure
743
743
  $fetched_uri = nil
744
744
  end
745
745
 
746
746
  def test_fetch_s3_config_creds
747
747
  Gem.configuration[:s3_source] = {
748
- 'my-bucket' => { :id => 'testuser', :secret => 'testpass' },
748
+ "my-bucket" => { :id => "testuser", :secret => "testpass" },
749
749
  }
750
- url = 's3://my-bucket/gems/specs.4.8.gz'
750
+ url = "s3://my-bucket/gems/specs.4.8.gz"
751
751
  Time.stub :now, Time.at(1561353581) do
752
- assert_fetch_s3 url, '20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b'
752
+ assert_fetch_s3 url, "20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b"
753
753
  end
754
754
  ensure
755
755
  Gem.configuration[:s3_source] = nil
@@ -757,11 +757,11 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
757
757
 
758
758
  def test_fetch_s3_config_creds_with_region
759
759
  Gem.configuration[:s3_source] = {
760
- 'my-bucket' => { :id => 'testuser', :secret => 'testpass', :region => 'us-west-2' },
760
+ "my-bucket" => { :id => "testuser", :secret => "testpass", :region => "us-west-2" },
761
761
  }
762
- url = 's3://my-bucket/gems/specs.4.8.gz'
762
+ url = "s3://my-bucket/gems/specs.4.8.gz"
763
763
  Time.stub :now, Time.at(1561353581) do
764
- assert_fetch_s3 url, '4afc3010757f1fd143e769f1d1dabd406476a4fc7c120e9884fd02acbb8f26c9', nil, 'us-west-2'
764
+ assert_fetch_s3 url, "4afc3010757f1fd143e769f1d1dabd406476a4fc7c120e9884fd02acbb8f26c9", nil, "us-west-2"
765
765
  end
766
766
  ensure
767
767
  Gem.configuration[:s3_source] = nil
@@ -769,79 +769,79 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
769
769
 
770
770
  def test_fetch_s3_config_creds_with_token
771
771
  Gem.configuration[:s3_source] = {
772
- 'my-bucket' => { :id => 'testuser', :secret => 'testpass', :security_token => 'testtoken' },
772
+ "my-bucket" => { :id => "testuser", :secret => "testpass", :security_token => "testtoken" },
773
773
  }
774
- url = 's3://my-bucket/gems/specs.4.8.gz'
774
+ url = "s3://my-bucket/gems/specs.4.8.gz"
775
775
  Time.stub :now, Time.at(1561353581) do
776
- assert_fetch_s3 url, '935160a427ef97e7630f799232b8f208c4a4e49aad07d0540572a2ad5fe9f93c', 'testtoken'
776
+ assert_fetch_s3 url, "935160a427ef97e7630f799232b8f208c4a4e49aad07d0540572a2ad5fe9f93c", "testtoken"
777
777
  end
778
778
  ensure
779
779
  Gem.configuration[:s3_source] = nil
780
780
  end
781
781
 
782
782
  def test_fetch_s3_env_creds
783
- ENV['AWS_ACCESS_KEY_ID'] = 'testuser'
784
- ENV['AWS_SECRET_ACCESS_KEY'] = 'testpass'
785
- ENV['AWS_SESSION_TOKEN'] = nil
783
+ ENV["AWS_ACCESS_KEY_ID"] = "testuser"
784
+ ENV["AWS_SECRET_ACCESS_KEY"] = "testpass"
785
+ ENV["AWS_SESSION_TOKEN"] = nil
786
786
  Gem.configuration[:s3_source] = {
787
- 'my-bucket' => { :provider => 'env' },
787
+ "my-bucket" => { :provider => "env" },
788
788
  }
789
- url = 's3://my-bucket/gems/specs.4.8.gz'
789
+ url = "s3://my-bucket/gems/specs.4.8.gz"
790
790
  Time.stub :now, Time.at(1561353581) do
791
- assert_fetch_s3 url, '20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b'
791
+ assert_fetch_s3 url, "20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b"
792
792
  end
793
793
  ensure
794
- ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS') }
794
+ ENV.each_key {|key| ENV.delete(key) if key.start_with?("AWS") }
795
795
  Gem.configuration[:s3_source] = nil
796
796
  end
797
797
 
798
798
  def test_fetch_s3_env_creds_with_region
799
- ENV['AWS_ACCESS_KEY_ID'] = 'testuser'
800
- ENV['AWS_SECRET_ACCESS_KEY'] = 'testpass'
801
- ENV['AWS_SESSION_TOKEN'] = nil
799
+ ENV["AWS_ACCESS_KEY_ID"] = "testuser"
800
+ ENV["AWS_SECRET_ACCESS_KEY"] = "testpass"
801
+ ENV["AWS_SESSION_TOKEN"] = nil
802
802
  Gem.configuration[:s3_source] = {
803
- 'my-bucket' => { :provider => 'env', :region => 'us-west-2' },
803
+ "my-bucket" => { :provider => "env", :region => "us-west-2" },
804
804
  }
805
- url = 's3://my-bucket/gems/specs.4.8.gz'
805
+ url = "s3://my-bucket/gems/specs.4.8.gz"
806
806
  Time.stub :now, Time.at(1561353581) do
807
- assert_fetch_s3 url, '4afc3010757f1fd143e769f1d1dabd406476a4fc7c120e9884fd02acbb8f26c9', nil, 'us-west-2'
807
+ assert_fetch_s3 url, "4afc3010757f1fd143e769f1d1dabd406476a4fc7c120e9884fd02acbb8f26c9", nil, "us-west-2"
808
808
  end
809
809
  ensure
810
- ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS') }
810
+ ENV.each_key {|key| ENV.delete(key) if key.start_with?("AWS") }
811
811
  Gem.configuration[:s3_source] = nil
812
812
  end
813
813
 
814
814
  def test_fetch_s3_env_creds_with_token
815
- ENV['AWS_ACCESS_KEY_ID'] = 'testuser'
816
- ENV['AWS_SECRET_ACCESS_KEY'] = 'testpass'
817
- ENV['AWS_SESSION_TOKEN'] = 'testtoken'
815
+ ENV["AWS_ACCESS_KEY_ID"] = "testuser"
816
+ ENV["AWS_SECRET_ACCESS_KEY"] = "testpass"
817
+ ENV["AWS_SESSION_TOKEN"] = "testtoken"
818
818
  Gem.configuration[:s3_source] = {
819
- 'my-bucket' => { :provider => 'env' },
819
+ "my-bucket" => { :provider => "env" },
820
820
  }
821
- url = 's3://my-bucket/gems/specs.4.8.gz'
821
+ url = "s3://my-bucket/gems/specs.4.8.gz"
822
822
  Time.stub :now, Time.at(1561353581) do
823
- assert_fetch_s3 url, '935160a427ef97e7630f799232b8f208c4a4e49aad07d0540572a2ad5fe9f93c', 'testtoken'
823
+ assert_fetch_s3 url, "935160a427ef97e7630f799232b8f208c4a4e49aad07d0540572a2ad5fe9f93c", "testtoken"
824
824
  end
825
825
  ensure
826
- ENV.each_key {|key| ENV.delete(key) if key.start_with?('AWS') }
826
+ ENV.each_key {|key| ENV.delete(key) if key.start_with?("AWS") }
827
827
  Gem.configuration[:s3_source] = nil
828
828
  end
829
829
 
830
830
  def test_fetch_s3_url_creds
831
- url = 's3://testuser:testpass@my-bucket/gems/specs.4.8.gz'
831
+ url = "s3://testuser:testpass@my-bucket/gems/specs.4.8.gz"
832
832
  Time.stub :now, Time.at(1561353581) do
833
- assert_fetch_s3 url, '20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b'
833
+ assert_fetch_s3 url, "20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b"
834
834
  end
835
835
  end
836
836
 
837
837
  def test_fetch_s3_instance_profile_creds
838
838
  Gem.configuration[:s3_source] = {
839
- 'my-bucket' => { :provider => 'instance_profile' },
839
+ "my-bucket" => { :provider => "instance_profile" },
840
840
  }
841
841
 
842
- url = 's3://my-bucket/gems/specs.4.8.gz'
842
+ url = "s3://my-bucket/gems/specs.4.8.gz"
843
843
  Time.stub :now, Time.at(1561353581) do
844
- assert_fetch_s3 url, '20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b', nil, 'us-east-1',
844
+ assert_fetch_s3 url, "20f974027db2f3cd6193565327a7c73457a138efb1a63ea248d185ce6827d41b", nil, "us-east-1",
845
845
  '{"AccessKeyId": "testuser", "SecretAccessKey": "testpass"}'
846
846
  end
847
847
  ensure
@@ -850,12 +850,12 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
850
850
 
851
851
  def test_fetch_s3_instance_profile_creds_with_region
852
852
  Gem.configuration[:s3_source] = {
853
- 'my-bucket' => { :provider => 'instance_profile', :region => 'us-west-2' },
853
+ "my-bucket" => { :provider => "instance_profile", :region => "us-west-2" },
854
854
  }
855
855
 
856
- url = 's3://my-bucket/gems/specs.4.8.gz'
856
+ url = "s3://my-bucket/gems/specs.4.8.gz"
857
857
  Time.stub :now, Time.at(1561353581) do
858
- assert_fetch_s3 url, '4afc3010757f1fd143e769f1d1dabd406476a4fc7c120e9884fd02acbb8f26c9', nil, 'us-west-2',
858
+ assert_fetch_s3 url, "4afc3010757f1fd143e769f1d1dabd406476a4fc7c120e9884fd02acbb8f26c9", nil, "us-west-2",
859
859
  '{"AccessKeyId": "testuser", "SecretAccessKey": "testpass"}'
860
860
  end
861
861
  ensure
@@ -864,12 +864,12 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
864
864
 
865
865
  def test_fetch_s3_instance_profile_creds_with_token
866
866
  Gem.configuration[:s3_source] = {
867
- 'my-bucket' => { :provider => 'instance_profile' },
867
+ "my-bucket" => { :provider => "instance_profile" },
868
868
  }
869
869
 
870
- url = 's3://my-bucket/gems/specs.4.8.gz'
870
+ url = "s3://my-bucket/gems/specs.4.8.gz"
871
871
  Time.stub :now, Time.at(1561353581) do
872
- assert_fetch_s3 url, '935160a427ef97e7630f799232b8f208c4a4e49aad07d0540572a2ad5fe9f93c', 'testtoken', 'us-east-1',
872
+ assert_fetch_s3 url, "935160a427ef97e7630f799232b8f208c4a4e49aad07d0540572a2ad5fe9f93c", "testtoken", "us-east-1",
873
873
  '{"AccessKeyId": "testuser", "SecretAccessKey": "testpass", "Token": "testtoken"}'
874
874
  end
875
875
  ensure
@@ -888,35 +888,35 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
888
888
  end
889
889
 
890
890
  def test_fetch_s3_no_source_key
891
- url = 's3://my-bucket/gems/specs.4.8.gz'
892
- refute_fetch_s3 url, 'no s3_source key exists in .gemrc'
891
+ url = "s3://my-bucket/gems/specs.4.8.gz"
892
+ refute_fetch_s3 url, "no s3_source key exists in .gemrc"
893
893
  end
894
894
 
895
895
  def test_fetch_s3_no_host
896
896
  Gem.configuration[:s3_source] = {
897
- 'my-bucket' => { :id => 'testuser', :secret => 'testpass' },
897
+ "my-bucket" => { :id => "testuser", :secret => "testpass" },
898
898
  }
899
899
 
900
- url = 's3://other-bucket/gems/specs.4.8.gz'
901
- refute_fetch_s3 url, 'no key for host other-bucket in s3_source in .gemrc'
900
+ url = "s3://other-bucket/gems/specs.4.8.gz"
901
+ refute_fetch_s3 url, "no key for host other-bucket in s3_source in .gemrc"
902
902
  ensure
903
903
  Gem.configuration[:s3_source] = nil
904
904
  end
905
905
 
906
906
  def test_fetch_s3_no_id
907
- Gem.configuration[:s3_source] = { 'my-bucket' => { :secret => 'testpass' } }
907
+ Gem.configuration[:s3_source] = { "my-bucket" => { :secret => "testpass" } }
908
908
 
909
- url = 's3://my-bucket/gems/specs.4.8.gz'
910
- refute_fetch_s3 url, 's3_source for my-bucket missing id or secret'
909
+ url = "s3://my-bucket/gems/specs.4.8.gz"
910
+ refute_fetch_s3 url, "s3_source for my-bucket missing id or secret"
911
911
  ensure
912
912
  Gem.configuration[:s3_source] = nil
913
913
  end
914
914
 
915
915
  def test_fetch_s3_no_secret
916
- Gem.configuration[:s3_source] = { 'my-bucket' => { :id => 'testuser' } }
916
+ Gem.configuration[:s3_source] = { "my-bucket" => { :id => "testuser" } }
917
917
 
918
- url = 's3://my-bucket/gems/specs.4.8.gz'
919
- refute_fetch_s3 url, 's3_source for my-bucket missing id or secret'
918
+ url = "s3://my-bucket/gems/specs.4.8.gz"
919
+ refute_fetch_s3 url, "s3_source for my-bucket missing id or secret"
920
920
  ensure
921
921
  Gem.configuration[:s3_source] = nil
922
922
  end
@@ -946,7 +946,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
946
946
  @fetcher = fetcher
947
947
 
948
948
  assert_throws :block_called do
949
- fetcher.request URI('http://example'), Net::HTTP::Get do |req|
949
+ fetcher.request URI("http://example"), Net::HTTP::Get do |req|
950
950
  assert_kind_of Net::HTTPGenericRequest, req
951
951
  throw :block_called
952
952
  end
@@ -964,7 +964,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
964
964
 
965
965
  def test_ssl_connection
966
966
  ssl_server = start_ssl_server
967
- temp_ca_cert = File.join(__dir__, 'ca_cert.pem')
967
+ temp_ca_cert = File.join(__dir__, "ca_cert.pem")
968
968
  with_configured_fetcher(":ssl_ca_cert: #{temp_ca_cert}") do |fetcher|
969
969
  fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
970
970
  end
@@ -975,8 +975,8 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
975
975
  :SSLVerifyClient =>
976
976
  OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT })
977
977
 
978
- temp_ca_cert = File.join(__dir__, 'ca_cert.pem')
979
- temp_client_cert = File.join(__dir__, 'client.pem')
978
+ temp_ca_cert = File.join(__dir__, "ca_cert.pem")
979
+ temp_client_cert = File.join(__dir__, "client.pem")
980
980
 
981
981
  with_configured_fetcher(
982
982
  ":ssl_ca_cert: #{temp_ca_cert}\n" +
@@ -990,8 +990,8 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
990
990
  :SSLVerifyClient =>
991
991
  OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT })
992
992
 
993
- temp_ca_cert = File.join(__dir__, 'ca_cert.pem')
994
- temp_client_cert = File.join(__dir__, 'invalid_client.pem')
993
+ temp_ca_cert = File.join(__dir__, "ca_cert.pem")
994
+ temp_client_cert = File.join(__dir__, "invalid_client.pem")
995
995
 
996
996
  with_configured_fetcher(
997
997
  ":ssl_ca_cert: #{temp_ca_cert}\n" +
@@ -1020,7 +1020,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
1020
1020
 
1021
1021
  def test_do_not_follow_insecure_redirect
1022
1022
  ssl_server = start_ssl_server
1023
- temp_ca_cert = File.join(__dir__, 'ca_cert.pem')
1023
+ temp_ca_cert = File.join(__dir__, "ca_cert.pem")
1024
1024
  expected_error_message =
1025
1025
  "redirecting to non-https resource: #{@server_uri} (https://localhost:#{ssl_server.config[:Port]}/insecure_redirect?to=#{@server_uri})"
1026
1026
 
@@ -1046,8 +1046,8 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
1046
1046
 
1047
1047
  def with_configured_fetcher(config_str = nil, &block)
1048
1048
  if config_str
1049
- temp_conf = File.join @tempdir, '.gemrc'
1050
- File.open temp_conf, 'w' do |fp|
1049
+ temp_conf = File.join @tempdir, ".gemrc"
1050
+ File.open temp_conf, "w" do |fp|
1051
1051
  fp.puts config_str
1052
1052
  end
1053
1053
  Gem.configuration = Gem::ConfigFile.new %W[--config-file #{temp_conf}]
@@ -1136,9 +1136,9 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
1136
1136
  :Logger => null_logger,
1137
1137
  :AccessLog => [],
1138
1138
  :SSLEnable => true,
1139
- :SSLCACertificateFile => File.join(__dir__, 'ca_cert.pem'),
1140
- :SSLCertificate => cert('ssl_cert.pem'),
1141
- :SSLPrivateKey => key('ssl_key.pem'),
1139
+ :SSLCACertificateFile => File.join(__dir__, "ca_cert.pem"),
1140
+ :SSLCertificate => cert("ssl_cert.pem"),
1141
+ :SSLPrivateKey => key("ssl_key.pem"),
1142
1142
  :SSLVerifyClient => nil,
1143
1143
  :SSLCertName => nil,
1144
1144
  }.merge(config))
@@ -1146,7 +1146,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
1146
1146
  res.body = "--- true\n"
1147
1147
  end
1148
1148
  server.mount_proc("/insecure_redirect") do |req, res|
1149
- res.set_redirect(WEBrick::HTTPStatus::MovedPermanently, req.query['to'])
1149
+ res.set_redirect(WEBrick::HTTPStatus::MovedPermanently, req.query["to"])
1150
1150
  end
1151
1151
  server.ssl_context.tmp_dh_callback = proc { TEST_KEY_DH2048 }
1152
1152
  t = Thread.new do
@@ -1185,22 +1185,22 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
1185
1185
  res.body = req["X-Captain"]
1186
1186
  elsif @enable_yaml
1187
1187
  res.body = data
1188
- res['Content-Type'] = 'text/plain'
1189
- res['content-length'] = data.size
1188
+ res["Content-Type"] = "text/plain"
1189
+ res["content-length"] = data.size
1190
1190
  else
1191
1191
  res.status = "404"
1192
1192
  res.body = "<h1>NOT FOUND</h1>"
1193
- res['Content-Type'] = 'text/html'
1193
+ res["Content-Type"] = "text/html"
1194
1194
  end
1195
1195
  end
1196
1196
  s.mount_proc("/yaml.Z") do |req, res|
1197
1197
  if @enable_zip
1198
1198
  res.body = Zlib::Deflate.deflate(data)
1199
- res['Content-Type'] = 'text/plain'
1199
+ res["Content-Type"] = "text/plain"
1200
1200
  else
1201
1201
  res.status = "404"
1202
1202
  res.body = "<h1>NOT FOUND</h1>"
1203
- res['Content-Type'] = 'text/html'
1203
+ res["Content-Type"] = "text/html"
1204
1204
  end
1205
1205
  end
1206
1206
  th = Thread.new do