rubygems-update 3.1.6 → 3.2.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) hide show
  1. checksums.yaml +4 -4
  2. data/CODE_OF_CONDUCT.md +55 -19
  3. data/CONTRIBUTING.md +1 -2
  4. data/History.txt +122 -14
  5. data/Manifest.txt +13 -25
  6. data/POLICIES.md +2 -9
  7. data/README.md +1 -1
  8. data/Rakefile +31 -33
  9. data/bin/update_rubygems +1 -1
  10. data/bundler/CHANGELOG.md +806 -741
  11. data/bundler/README.md +6 -8
  12. data/bundler/UPGRADING.md +16 -30
  13. data/bundler/bundler.gemspec +3 -3
  14. data/bundler/exe/bundle +3 -0
  15. data/bundler/lib/bundler.rb +15 -4
  16. data/bundler/lib/bundler/build_metadata.rb +2 -2
  17. data/bundler/lib/bundler/cli.rb +32 -11
  18. data/bundler/lib/bundler/cli/console.rb +1 -1
  19. data/bundler/lib/bundler/cli/gem.rb +83 -10
  20. data/bundler/lib/bundler/cli/info.rb +13 -3
  21. data/bundler/lib/bundler/cli/init.rb +1 -1
  22. data/bundler/lib/bundler/cli/install.rb +5 -14
  23. data/bundler/lib/bundler/cli/issue.rb +2 -2
  24. data/bundler/lib/bundler/cli/list.rb +11 -9
  25. data/bundler/lib/bundler/cli/outdated.rb +88 -65
  26. data/bundler/lib/bundler/cli/plugin.rb +10 -0
  27. data/bundler/lib/bundler/cli/pristine.rb +5 -0
  28. data/bundler/lib/bundler/definition.rb +32 -32
  29. data/bundler/lib/bundler/dependency.rb +0 -9
  30. data/bundler/lib/bundler/dsl.rb +1 -5
  31. data/bundler/lib/bundler/environment_preserver.rb +26 -2
  32. data/bundler/lib/bundler/errors.rb +1 -0
  33. data/bundler/lib/bundler/feature_flag.rb +0 -2
  34. data/bundler/lib/bundler/fetcher.rb +1 -0
  35. data/bundler/lib/bundler/friendly_errors.rb +4 -10
  36. data/bundler/lib/bundler/gem_helper.rb +17 -10
  37. data/bundler/lib/bundler/gem_version_promoter.rb +1 -1
  38. data/bundler/lib/bundler/injector.rb +14 -3
  39. data/bundler/lib/bundler/inline.rb +1 -1
  40. data/bundler/lib/bundler/installer.rb +29 -28
  41. data/bundler/lib/bundler/installer/gem_installer.rb +2 -2
  42. data/bundler/lib/bundler/installer/parallel_installer.rb +9 -9
  43. data/bundler/lib/bundler/lazy_specification.rb +16 -3
  44. data/bundler/lib/bundler/plugin.rb +26 -0
  45. data/bundler/lib/bundler/plugin/index.rb +9 -0
  46. data/bundler/lib/bundler/psyched_yaml.rb +0 -15
  47. data/bundler/lib/bundler/remote_specification.rb +4 -1
  48. data/bundler/lib/bundler/resolver.rb +31 -8
  49. data/bundler/lib/bundler/resolver/spec_group.rb +26 -5
  50. data/bundler/lib/bundler/rubygems_ext.rb +7 -8
  51. data/bundler/lib/bundler/rubygems_gem_installer.rb +1 -7
  52. data/bundler/lib/bundler/rubygems_integration.rb +3 -48
  53. data/bundler/lib/bundler/runtime.rb +2 -12
  54. data/bundler/lib/bundler/settings.rb +0 -3
  55. data/bundler/lib/bundler/shared_helpers.rb +1 -1
  56. data/bundler/lib/bundler/source/git.rb +4 -4
  57. data/bundler/lib/bundler/source/git/git_proxy.rb +53 -58
  58. data/bundler/lib/bundler/source/path.rb +5 -1
  59. data/bundler/lib/bundler/source/path/installer.rb +7 -9
  60. data/bundler/lib/bundler/source/rubygems.rb +11 -14
  61. data/bundler/lib/bundler/stub_specification.rb +16 -4
  62. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
  63. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +9 -1
  64. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +19 -5
  65. data/bundler/lib/bundler/templates/newgem/bin/console.tt +2 -0
  66. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
  67. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
  68. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
  69. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  70. data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -0
  71. data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
  72. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -4
  73. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +10 -0
  74. data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
  75. data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  76. data/bundler/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
  77. data/bundler/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
  78. data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  79. data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  80. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +75 -189
  81. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +0 -7
  82. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
  83. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
  84. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  85. data/bundler/lib/bundler/version.rb +1 -1
  86. data/bundler/man/bundle-add.1 +1 -1
  87. data/bundler/man/bundle-add.1.txt +15 -15
  88. data/bundler/man/bundle-binstubs.1 +1 -1
  89. data/bundler/man/bundle-binstubs.1.txt +10 -10
  90. data/bundler/man/bundle-cache.1 +1 -1
  91. data/bundler/man/bundle-cache.1.txt +15 -15
  92. data/bundler/man/bundle-check.1 +1 -1
  93. data/bundler/man/bundle-check.1.txt +8 -8
  94. data/bundler/man/bundle-clean.1 +1 -1
  95. data/bundler/man/bundle-clean.1.txt +6 -6
  96. data/bundler/man/bundle-config.1 +3 -9
  97. data/bundler/man/bundle-config.1.txt +271 -272
  98. data/bundler/man/bundle-config.ronn +5 -9
  99. data/bundler/man/bundle-doctor.1 +1 -1
  100. data/bundler/man/bundle-doctor.1.txt +9 -9
  101. data/bundler/man/bundle-exec.1 +1 -1
  102. data/bundler/man/bundle-exec.1.txt +84 -81
  103. data/bundler/man/bundle-gem.1 +25 -3
  104. data/bundler/man/bundle-gem.1.txt +65 -39
  105. data/bundler/man/bundle-gem.ronn +30 -7
  106. data/bundler/man/bundle-info.1 +1 -1
  107. data/bundler/man/bundle-info.1.txt +2 -2
  108. data/bundler/man/bundle-init.1 +1 -1
  109. data/bundler/man/bundle-init.1.txt +9 -9
  110. data/bundler/man/bundle-inject.1 +1 -1
  111. data/bundler/man/bundle-inject.1.txt +4 -4
  112. data/bundler/man/bundle-install.1 +1 -1
  113. data/bundler/man/bundle-install.1.txt +169 -169
  114. data/bundler/man/bundle-list.1 +7 -7
  115. data/bundler/man/bundle-list.1.txt +12 -11
  116. data/bundler/man/bundle-list.ronn +6 -6
  117. data/bundler/man/bundle-lock.1 +1 -1
  118. data/bundler/man/bundle-lock.1.txt +28 -28
  119. data/bundler/man/bundle-open.1 +1 -1
  120. data/bundler/man/bundle-open.1.txt +3 -3
  121. data/bundler/man/bundle-outdated.1 +1 -1
  122. data/bundler/man/bundle-outdated.1.txt +34 -34
  123. data/bundler/man/bundle-platform.1 +1 -1
  124. data/bundler/man/bundle-platform.1.txt +16 -16
  125. data/bundler/man/bundle-pristine.1 +1 -1
  126. data/bundler/man/bundle-pristine.1.txt +8 -8
  127. data/bundler/man/bundle-remove.1 +1 -1
  128. data/bundler/man/bundle-remove.1.txt +9 -9
  129. data/bundler/man/bundle-show.1 +1 -1
  130. data/bundler/man/bundle-show.1.txt +8 -8
  131. data/bundler/man/bundle-update.1 +1 -1
  132. data/bundler/man/bundle-update.1.txt +149 -148
  133. data/bundler/man/bundle-viz.1 +1 -1
  134. data/bundler/man/bundle-viz.1.txt +11 -11
  135. data/bundler/man/bundle.1 +1 -1
  136. data/bundler/man/bundle.1.txt +31 -31
  137. data/bundler/man/gemfile.5 +1 -1
  138. data/bundler/man/gemfile.5.txt +218 -216
  139. data/lib/rubygems.rb +68 -148
  140. data/lib/rubygems/available_set.rb +4 -4
  141. data/lib/rubygems/basic_specification.rb +11 -5
  142. data/lib/rubygems/bundler_version_finder.rb +14 -9
  143. data/lib/rubygems/command.rb +16 -14
  144. data/lib/rubygems/command_manager.rb +4 -3
  145. data/lib/rubygems/commands/cert_command.rb +1 -1
  146. data/lib/rubygems/commands/cleanup_command.rb +3 -3
  147. data/lib/rubygems/commands/contents_command.rb +4 -4
  148. data/lib/rubygems/commands/dependency_command.rb +6 -6
  149. data/lib/rubygems/commands/fetch_command.rb +2 -2
  150. data/lib/rubygems/commands/help_command.rb +1 -1
  151. data/lib/rubygems/commands/info_command.rb +9 -4
  152. data/lib/rubygems/commands/install_command.rb +3 -3
  153. data/lib/rubygems/commands/list_command.rb +9 -6
  154. data/lib/rubygems/commands/lock_command.rb +1 -1
  155. data/lib/rubygems/commands/open_command.rb +0 -2
  156. data/lib/rubygems/commands/pristine_command.rb +10 -2
  157. data/lib/rubygems/commands/push_command.rb +4 -42
  158. data/lib/rubygems/commands/query_command.rb +7 -352
  159. data/lib/rubygems/commands/search_command.rb +8 -6
  160. data/lib/rubygems/commands/setup_command.rb +128 -32
  161. data/lib/rubygems/commands/specification_command.rb +2 -2
  162. data/lib/rubygems/commands/stale_command.rb +1 -1
  163. data/lib/rubygems/commands/uninstall_command.rb +1 -1
  164. data/lib/rubygems/commands/unpack_command.rb +1 -1
  165. data/lib/rubygems/commands/update_command.rb +40 -10
  166. data/lib/rubygems/config_file.rb +11 -2
  167. data/lib/rubygems/core_ext/kernel_require.rb +2 -2
  168. data/lib/rubygems/defaults.rb +99 -5
  169. data/lib/rubygems/dependency.rb +2 -5
  170. data/lib/rubygems/dependency_installer.rb +1 -73
  171. data/lib/rubygems/dependency_list.rb +7 -7
  172. data/lib/rubygems/deprecate.rb +46 -1
  173. data/lib/rubygems/doctor.rb +4 -2
  174. data/lib/rubygems/errors.rb +3 -2
  175. data/lib/rubygems/exceptions.rb +2 -13
  176. data/lib/rubygems/ext.rb +6 -6
  177. data/lib/rubygems/ext/build_error.rb +2 -0
  178. data/lib/rubygems/ext/builder.rb +1 -1
  179. data/lib/rubygems/ext/cmake_builder.rb +1 -1
  180. data/lib/rubygems/ext/ext_conf_builder.rb +6 -7
  181. data/lib/rubygems/gem_runner.rb +3 -8
  182. data/lib/rubygems/gemcutter_utilities.rb +1 -1
  183. data/lib/rubygems/indexer.rb +1 -19
  184. data/lib/rubygems/install_update_options.rb +5 -5
  185. data/lib/rubygems/installer.rb +45 -42
  186. data/lib/rubygems/installer_test_case.rb +19 -2
  187. data/lib/rubygems/installer_uninstaller_utils.rb +24 -0
  188. data/lib/rubygems/local_remote_options.rb +1 -1
  189. data/lib/rubygems/name_tuple.rb +2 -4
  190. data/lib/rubygems/package.rb +8 -13
  191. data/lib/rubygems/package/old.rb +1 -1
  192. data/lib/rubygems/package/tar_header.rb +3 -3
  193. data/lib/rubygems/package/tar_reader.rb +0 -1
  194. data/lib/rubygems/package/tar_reader/entry.rb +0 -1
  195. data/lib/rubygems/package/tar_test_case.rb +1 -1
  196. data/lib/rubygems/package/tar_writer.rb +2 -6
  197. data/lib/rubygems/package_task.rb +1 -5
  198. data/lib/rubygems/path_support.rb +1 -1
  199. data/lib/rubygems/platform.rb +3 -3
  200. data/lib/rubygems/query_utils.rb +362 -0
  201. data/lib/rubygems/rdoc.rb +0 -12
  202. data/lib/rubygems/remote_fetcher.rb +5 -19
  203. data/lib/rubygems/request/connection_pools.rb +1 -1
  204. data/lib/rubygems/request_set.rb +5 -5
  205. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  206. data/lib/rubygems/request_set/lockfile.rb +8 -8
  207. data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
  208. data/lib/rubygems/requirement.rb +14 -15
  209. data/lib/rubygems/resolver.rb +7 -8
  210. data/lib/rubygems/resolver/api_set.rb +3 -3
  211. data/lib/rubygems/resolver/composed_set.rb +3 -3
  212. data/lib/rubygems/resolver/conflict.rb +1 -1
  213. data/lib/rubygems/resolver/index_set.rb +1 -1
  214. data/lib/rubygems/resolver/installer_set.rb +3 -3
  215. data/lib/rubygems/resolver/lock_set.rb +1 -1
  216. data/lib/rubygems/safe_yaml.rb +4 -4
  217. data/lib/rubygems/security.rb +25 -25
  218. data/lib/rubygems/security/policy.rb +3 -3
  219. data/lib/rubygems/security/signer.rb +4 -4
  220. data/lib/rubygems/security/trust_dir.rb +1 -1
  221. data/lib/rubygems/server.rb +8 -8
  222. data/lib/rubygems/source/git.rb +7 -6
  223. data/lib/rubygems/source/local.rb +2 -2
  224. data/lib/rubygems/source_list.rb +4 -5
  225. data/lib/rubygems/spec_fetcher.rb +18 -15
  226. data/lib/rubygems/specification.rb +79 -104
  227. data/lib/rubygems/specification_policy.rb +79 -27
  228. data/lib/rubygems/ssl_certs/{rubygems.org → index.rubygems.org}/GlobalSignRootCA.pem +0 -0
  229. data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
  230. data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
  231. data/lib/rubygems/test_case.rb +63 -83
  232. data/lib/rubygems/test_utilities.rb +6 -6
  233. data/lib/rubygems/uninstaller.rb +35 -14
  234. data/lib/rubygems/user_interaction.rb +1 -10
  235. data/lib/rubygems/util.rb +10 -2
  236. data/lib/rubygems/util/licenses.rb +4 -4
  237. data/lib/rubygems/validator.rb +1 -1
  238. data/lib/rubygems/version.rb +4 -4
  239. data/rubygems-update.gemspec +2 -2
  240. data/setup.rb +2 -7
  241. data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -2
  242. data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +0 -2
  243. data/test/rubygems/test_bundled_ca.rb +4 -12
  244. data/test/rubygems/test_deprecate.rb +43 -4
  245. data/test/rubygems/test_gem.rb +79 -74
  246. data/test/rubygems/test_gem_available_set.rb +3 -3
  247. data/test/rubygems/test_gem_bundler_version_finder.rb +19 -1
  248. data/test/rubygems/test_gem_command.rb +24 -3
  249. data/test/rubygems/test_gem_command_manager.rb +37 -4
  250. data/test/rubygems/test_gem_commands_build_command.rb +7 -2
  251. data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
  252. data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
  253. data/test/rubygems/test_gem_commands_contents_command.rb +48 -15
  254. data/test/rubygems/test_gem_commands_environment_command.rb +21 -21
  255. data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -5
  256. data/test/rubygems/test_gem_commands_info_command.rb +6 -6
  257. data/test/rubygems/test_gem_commands_install_command.rb +31 -31
  258. data/test/rubygems/test_gem_commands_mirror.rb +1 -1
  259. data/test/rubygems/test_gem_commands_open_command.rb +4 -4
  260. data/test/rubygems/test_gem_commands_owner_command.rb +11 -3
  261. data/test/rubygems/test_gem_commands_pristine_command.rb +41 -8
  262. data/test/rubygems/test_gem_commands_push_command.rb +7 -2
  263. data/test/rubygems/test_gem_commands_query_command.rb +9 -5
  264. data/test/rubygems/test_gem_commands_setup_command.rb +160 -108
  265. data/test/rubygems/test_gem_commands_signin_command.rb +6 -4
  266. data/test/rubygems/test_gem_commands_signout_command.rb +0 -5
  267. data/test/rubygems/test_gem_commands_specification_command.rb +18 -18
  268. data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
  269. data/test/rubygems/test_gem_commands_update_command.rb +68 -5
  270. data/test/rubygems/test_gem_commands_which_command.rb +3 -3
  271. data/test/rubygems/test_gem_commands_yank_command.rb +14 -6
  272. data/test/rubygems/test_gem_config_file.rb +7 -10
  273. data/test/rubygems/test_gem_dependency_installer.rb +52 -189
  274. data/test/rubygems/test_gem_dependency_list.rb +8 -8
  275. data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -1
  276. data/test/rubygems/test_gem_doctor.rb +28 -0
  277. data/test/rubygems/test_gem_ext_builder.rb +14 -25
  278. data/test/rubygems/test_gem_ext_cmake_builder.rb +13 -12
  279. data/test/rubygems/test_gem_ext_configure_builder.rb +1 -9
  280. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -1
  281. data/test/rubygems/test_gem_ext_rake_builder.rb +9 -9
  282. data/test/rubygems/test_gem_gem_runner.rb +42 -0
  283. data/test/rubygems/test_gem_gemcutter_utilities.rb +5 -0
  284. data/test/rubygems/test_gem_indexer.rb +9 -13
  285. data/test/rubygems/test_gem_installer.rb +149 -45
  286. data/test/rubygems/test_gem_package.rb +13 -12
  287. data/test/rubygems/test_gem_package_tar_header.rb +19 -0
  288. data/test/rubygems/test_gem_package_tar_writer.rb +3 -3
  289. data/test/rubygems/test_gem_package_task.rb +46 -11
  290. data/test/rubygems/test_gem_remote_fetcher.rb +152 -190
  291. data/test/rubygems/test_gem_request.rb +11 -11
  292. data/test/rubygems/test_gem_request_set.rb +20 -20
  293. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
  294. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +9 -9
  295. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +118 -118
  296. data/test/rubygems/test_gem_requirement.rb +2 -2
  297. data/test/rubygems/test_gem_resolver.rb +6 -6
  298. data/test/rubygems/test_gem_resolver_api_set.rb +3 -3
  299. data/test/rubygems/test_gem_resolver_best_set.rb +2 -2
  300. data/test/rubygems/test_gem_resolver_index_set.rb +2 -2
  301. data/test/rubygems/test_gem_resolver_installer_set.rb +7 -7
  302. data/test/rubygems/test_gem_resolver_lock_set.rb +3 -3
  303. data/test/rubygems/test_gem_security.rb +20 -20
  304. data/test/rubygems/test_gem_security_policy.rb +5 -8
  305. data/test/rubygems/test_gem_security_signer.rb +8 -8
  306. data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
  307. data/test/rubygems/test_gem_server.rb +10 -10
  308. data/test/rubygems/test_gem_source.rb +12 -14
  309. data/test/rubygems/test_gem_source_git.rb +12 -11
  310. data/test/rubygems/test_gem_source_installed.rb +7 -7
  311. data/test/rubygems/test_gem_source_local.rb +8 -8
  312. data/test/rubygems/test_gem_source_lock.rb +10 -10
  313. data/test/rubygems/test_gem_source_specific_file.rb +7 -7
  314. data/test/rubygems/test_gem_source_vendor.rb +7 -7
  315. data/test/rubygems/test_gem_spec_fetcher.rb +11 -2
  316. data/test/rubygems/test_gem_specification.rb +143 -113
  317. data/test/rubygems/test_gem_stream_ui.rb +3 -1
  318. data/test/rubygems/test_gem_text.rb +1 -1
  319. data/test/rubygems/test_gem_uninstaller.rb +134 -10
  320. data/test/rubygems/test_gem_util.rb +7 -5
  321. data/test/rubygems/test_gem_version.rb +1 -1
  322. data/test/rubygems/test_kernel.rb +10 -12
  323. data/test/rubygems/test_project_sanity.rb +8 -1
  324. data/test/rubygems/test_require.rb +141 -43
  325. metadata +32 -45
  326. data/.bundle/config +0 -2
  327. data/.rubocop.yml +0 -91
  328. data/Gemfile +0 -8
  329. data/Gemfile.lock +0 -43
  330. data/bundler/CODE_OF_CONDUCT.md +0 -136
  331. data/lib/rubygems/source_local.rb +0 -7
  332. data/lib/rubygems/source_specific_file.rb +0 -6
  333. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +0 -21
  334. data/lib/ubygems.rb +0 -14
  335. data/tmp/.keep +0 -0
  336. data/util/CL2notes +0 -55
  337. data/util/bisect +0 -10
  338. data/util/ci.sh +0 -62
  339. data/util/cops/deprecations.rb +0 -52
  340. data/util/create_certs.rb +0 -171
  341. data/util/create_certs.sh +0 -27
  342. data/util/create_encrypted_key.rb +0 -16
  343. data/util/generate_spdx_license_list.rb +0 -63
  344. data/util/patch_with_prs.rb +0 -77
  345. data/util/rubocop +0 -8
  346. data/util/update_bundled_ca_certificates.rb +0 -137
  347. data/util/update_changelog.rb +0 -64
@@ -55,8 +55,6 @@ class TestGemSource < Gem::TestCase
55
55
  end
56
56
 
57
57
  def test_dependency_resolver_set_file_uri
58
- skip 'install builder gem' unless defined? Builder::XChar
59
-
60
58
  Gem::Indexer.new(@tempdir).generate_index
61
59
 
62
60
  source = Gem::Source.new "file://#{@tempdir}/"
@@ -125,7 +123,7 @@ class TestGemSource < Gem::TestCase
125
123
  end
126
124
 
127
125
  def test_load_specs
128
- released = @source.load_specs(:released).map { |spec| spec.full_name }
126
+ released = @source.load_specs(:released).map {|spec| spec.full_name }
129
127
  assert_equal %W[a-2 a-1 b-2], released
130
128
 
131
129
  cache_dir = File.join Gem.spec_cache_dir, 'gems.example.com%80'
@@ -199,30 +197,30 @@ class TestGemSource < Gem::TestCase
199
197
  installed = Gem::Source::Installed.new
200
198
  local = Gem::Source::Local.new
201
199
 
202
- assert_equal(0, remote. <=>(remote), 'remote <=> remote')
200
+ assert_equal(0, remote.<=>(remote), 'remote <=> remote')
203
201
 
204
- assert_equal(-1, remote. <=>(specific), 'remote <=> specific')
205
- assert_equal(1, specific. <=>(remote), 'specific <=> remote')
202
+ assert_equal(-1, remote.<=>(specific), 'remote <=> specific')
203
+ assert_equal(1, specific.<=>(remote), 'specific <=> remote')
206
204
 
207
- assert_equal(-1, remote. <=>(local), 'remote <=> local')
208
- assert_equal(1, local. <=>(remote), 'local <=> remote')
205
+ assert_equal(-1, remote.<=>(local), 'remote <=> local')
206
+ assert_equal(1, local.<=>(remote), 'local <=> remote')
209
207
 
210
- assert_equal(-1, remote. <=>(installed), 'remote <=> installed')
211
- assert_equal(1, installed.<=>(remote), 'installed <=> remote')
208
+ assert_equal(-1, remote.<=>(installed), 'remote <=> installed')
209
+ assert_equal(1, installed.<=>(remote), 'installed <=> remote')
212
210
 
213
211
  no_uri = @source.dup
214
212
  no_uri.instance_variable_set :@uri, nil
215
213
 
216
- assert_equal(-1, remote. <=>(no_uri), 'remote <=> no_uri')
214
+ assert_equal(-1, remote.<=>(no_uri), 'remote <=> no_uri')
217
215
  end
218
216
 
219
217
  def test_spaceship_order_is_preserved_when_uri_differs
220
218
  sourceA = Gem::Source.new "http://example.com/a"
221
219
  sourceB = Gem::Source.new "http://example.com/b"
222
220
 
223
- assert_equal(0, sourceA. <=>(sourceA), 'sourceA <=> sourceA')
224
- assert_equal(1, sourceA. <=>(sourceB), 'sourceA <=> sourceB')
225
- assert_equal(1, sourceB. <=>(sourceA), 'sourceB <=> sourceA')
221
+ assert_equal(0, sourceA.<=>(sourceA), 'sourceA <=> sourceA')
222
+ assert_equal(1, sourceA.<=>(sourceB), 'sourceA <=> sourceB')
223
+ assert_equal(1, sourceB.<=>(sourceA), 'sourceB <=> sourceA')
226
224
  end
227
225
 
228
226
  def test_update_cache_eh
@@ -69,8 +69,9 @@ class TestGemSourceGit < Gem::TestCase
69
69
  git_gem 'b'
70
70
 
71
71
  Dir.chdir 'git/a' do
72
- Gem::Util.silent_system @git, 'submodule', '--quiet',
73
- 'add', File.expand_path('../b'), 'b'
72
+ output, status = Open3.capture2e(@git, 'submodule', '--quiet', 'add', File.expand_path('../b'), 'b')
73
+ assert status.success?, output
74
+
74
75
  system @git, 'commit', '--quiet', '-m', 'add submodule b'
75
76
  end
76
77
 
@@ -187,7 +188,7 @@ class TestGemSourceGit < Gem::TestCase
187
188
  source.cache
188
189
 
189
190
  e = assert_raises Gem::Exception do
190
- capture_subprocess_io {source.rev_parse}
191
+ capture_subprocess_io { source.rev_parse }
191
192
  end
192
193
 
193
194
  assert_equal "unable to find reference nonexistent in #{@repository}",
@@ -208,16 +209,16 @@ class TestGemSourceGit < Gem::TestCase
208
209
  installed = Gem::Source::Installed.new
209
210
  vendor = Gem::Source::Vendor.new 'vendor/foo'
210
211
 
211
- assert_equal(0, git. <=>(git), 'git <=> git')
212
+ assert_equal(0, git.<=>(git), 'git <=> git')
212
213
 
213
- assert_equal(1, git. <=>(remote), 'git <=> remote')
214
- assert_equal(-1, remote. <=>(git), 'remote <=> git')
214
+ assert_equal(1, git.<=>(remote), 'git <=> remote')
215
+ assert_equal(-1, remote.<=>(git), 'remote <=> git')
215
216
 
216
- assert_equal(1, git. <=>(installed), 'git <=> installed')
217
- assert_equal(-1, installed.<=>(git), 'installed <=> git')
217
+ assert_equal(1, git.<=>(installed), 'git <=> installed')
218
+ assert_equal(-1, installed.<=>(git), 'installed <=> git')
218
219
 
219
- assert_equal(-1, git. <=>(vendor), 'git <=> vendor')
220
- assert_equal(1, vendor. <=>(git), 'vendor <=> git')
220
+ assert_equal(-1, git.<=>(vendor), 'git <=> vendor')
221
+ assert_equal(1, vendor.<=>(git), 'vendor <=> git')
221
222
  end
222
223
 
223
224
  def test_specs
@@ -244,7 +245,7 @@ class TestGemSourceGit < Gem::TestCase
244
245
  specs = source.specs
245
246
  end
246
247
 
247
- assert_equal %w[a-1 b-1], specs.map { |spec| spec.full_name }
248
+ assert_equal %w[a-1 b-1], specs.map {|spec| spec.full_name }
248
249
 
249
250
  a_spec = specs.shift
250
251
 
@@ -17,20 +17,20 @@ class TestGemSourceInstalled < Gem::TestCase
17
17
 
18
18
  assert_equal(0, installed.<=>(installed), 'installed <=> installed')
19
19
 
20
- assert_equal(-1, remote. <=>(installed), 'remote <=> installed')
20
+ assert_equal(-1, remote.<=>(installed), 'remote <=> installed')
21
21
  assert_equal(1, installed.<=>(remote), 'installed <=> remote')
22
22
 
23
23
  assert_equal(1, installed.<=>(local), 'installed <=> local')
24
- assert_equal(-1, local. <=>(installed), 'local <=> installed')
24
+ assert_equal(-1, local.<=>(installed), 'local <=> installed')
25
25
 
26
- assert_equal(-1, specific. <=>(installed), 'specific <=> installed')
26
+ assert_equal(-1, specific.<=>(installed), 'specific <=> installed')
27
27
  assert_equal(1, installed.<=>(specific), 'installed <=> specific')
28
28
 
29
- assert_equal(1, git. <=>(installed), 'git <=> installed')
30
- assert_equal(-1, installed.<=>(git), 'installed <=> git')
29
+ assert_equal(1, git. <=>(installed), 'git <=> installed')
30
+ assert_equal(-1, installed.<=>(git), 'installed <=> git')
31
31
 
32
- assert_equal(1, vendor. <=>(installed), 'vendor <=> installed')
33
- assert_equal(-1, installed.<=>(vendor), 'installed <=> vendor')
32
+ assert_equal(1, vendor.<=>(installed), 'vendor <=> installed')
33
+ assert_equal(-1, installed.<=>(vendor), 'installed <=> vendor')
34
34
  end
35
35
 
36
36
  end
@@ -73,7 +73,7 @@ class TestGemSourceLocal < Gem::TestCase
73
73
 
74
74
  @sl.load_specs :released
75
75
 
76
- inner = [@a, @ap, @b].map { |t| t.name_tuple }.inspect
76
+ inner = [@a, @ap, @b].map {|t| t.name_tuple }.inspect
77
77
 
78
78
  assert_equal "#<Gem::Source::Local specs: #{inner}>", @sl.inspect
79
79
  end
@@ -93,16 +93,16 @@ class TestGemSourceLocal < Gem::TestCase
93
93
  installed = Gem::Source::Installed.new
94
94
  local = Gem::Source::Local.new
95
95
 
96
- assert_equal(0, local. <=>(local), 'local <=> local')
96
+ assert_equal(0, local.<=>(local), 'local <=> local')
97
97
 
98
- assert_equal(-1, remote. <=>(local), 'remote <=> local')
99
- assert_equal(1, local. <=>(remote), 'local <=> remote')
98
+ assert_equal(-1, remote.<=>(local), 'remote <=> local')
99
+ assert_equal(1, local.<=>(remote), 'local <=> remote')
100
100
 
101
- assert_equal(1, installed.<=>(local), 'installed <=> local')
102
- assert_equal(-1, local. <=>(installed), 'local <=> installed')
101
+ assert_equal(1, installed.<=>(local), 'installed <=> local')
102
+ assert_equal(-1, local.<=>(installed), 'local <=> installed')
103
103
 
104
- assert_equal(-1, specific. <=>(local), 'specific <=> local')
105
- assert_equal(1, local. <=>(specific), 'local <=> specific')
104
+ assert_equal(-1, specific.<=>(local), 'specific <=> local')
105
+ assert_equal(1, local.<=>(specific), 'local <=> specific')
106
106
  end
107
107
 
108
108
  end
@@ -59,31 +59,31 @@ class TestGemSourceLock < Gem::TestCase
59
59
  lock = Gem::Source::Lock.new git
60
60
 
61
61
  assert_equal(1, lock.<=>(git), 'lock <=> git')
62
- assert_equal(-1, git .<=>(lock), 'git <=> lock')
62
+ assert_equal(-1, git.<=>(lock), 'git <=> lock')
63
63
  end
64
64
 
65
65
  def test_spaceship_installed
66
66
  installed = Gem::Source::Installed.new
67
67
  lock = Gem::Source::Lock.new installed
68
68
 
69
- assert_equal(1, lock. <=>(installed), 'lock <=> installed')
70
- assert_equal(-1, installed.<=>(lock), 'installed <=> lock')
69
+ assert_equal(1, lock.<=>(installed), 'lock <=> installed')
70
+ assert_equal(-1, installed.<=>(lock), 'installed <=> lock')
71
71
  end
72
72
 
73
73
  def test_spaceship_local
74
74
  local = Gem::Source::Local.new
75
75
  lock = Gem::Source::Lock.new local # nonsense
76
76
 
77
- assert_equal(1, lock. <=>(local), 'lock <=> local')
78
- assert_equal(-1, local.<=>(lock), 'local <=> lock')
77
+ assert_equal(1, lock.<=>(local), 'lock <=> local')
78
+ assert_equal(-1, local.<=>(lock), 'local <=> lock')
79
79
  end
80
80
 
81
81
  def test_spaceship_remote
82
82
  remote = Gem::Source.new @gem_repo
83
83
  lock = Gem::Source::Lock.new remote
84
84
 
85
- assert_equal(1, lock. <=>(remote), 'lock <=> remote')
86
- assert_equal(-1, remote.<=>(lock), 'remote <=> lock')
85
+ assert_equal(1, lock.<=>(remote), 'lock <=> remote')
86
+ assert_equal(-1, remote.<=>(lock), 'remote <=> lock')
87
87
  end
88
88
 
89
89
  def test_spaceship_specific_file
@@ -92,7 +92,7 @@ class TestGemSourceLock < Gem::TestCase
92
92
  specific = Gem::Source::SpecificFile.new gem
93
93
  lock = Gem::Source::Lock.new specific # nonsense
94
94
 
95
- assert_equal(1, lock .<=>(specific), 'lock <=> specific')
95
+ assert_equal(1, lock.<=>(specific), 'lock <=> specific')
96
96
  assert_equal(-1, specific.<=>(lock), 'specific <=> lock')
97
97
  end
98
98
 
@@ -100,8 +100,8 @@ class TestGemSourceLock < Gem::TestCase
100
100
  vendor = Gem::Source::Vendor.new 'vendor/a'
101
101
  lock = Gem::Source::Lock.new vendor
102
102
 
103
- assert_equal(1, lock. <=>(vendor), 'lock <=> vendor')
104
- assert_equal(-1, vendor.<=>(lock), 'vendor <=> lock')
103
+ assert_equal(1, lock.<=>(vendor), 'lock <=> vendor')
104
+ assert_equal(-1, vendor.<=>(lock), 'vendor <=> lock')
105
105
  end
106
106
 
107
107
  def test_uri
@@ -46,16 +46,16 @@ class TestGemSourceSpecificFile < Gem::TestCase
46
46
  installed = Gem::Source::Installed.new
47
47
  local = Gem::Source::Local.new
48
48
 
49
- assert_equal(0, specific. <=>(specific), 'specific <=> specific')
49
+ assert_equal(0, specific.<=>(specific), 'specific <=> specific')
50
50
 
51
- assert_equal(-1, remote. <=>(specific), 'remote <=> specific')
52
- assert_equal(1, specific. <=>(remote), 'specific <=> remote')
51
+ assert_equal(-1, remote.<=>(specific), 'remote <=> specific')
52
+ assert_equal(1, specific.<=>(remote), 'specific <=> remote')
53
53
 
54
- assert_equal(-1, specific. <=>(local), 'specific <=> local')
55
- assert_equal(1, local. <=>(specific), 'local <=> specific')
54
+ assert_equal(-1, specific.<=>(local), 'specific <=> local')
55
+ assert_equal(1, local. <=>(specific), 'local <=> specific')
56
56
 
57
- assert_equal(-1, specific. <=>(installed), 'specific <=> installed')
58
- assert_equal(1, installed.<=>(specific), 'installed <=> specific')
57
+ assert_equal(-1, specific. <=>(installed), 'specific <=> installed')
58
+ assert_equal(1, installed.<=>(specific), 'installed <=> specific')
59
59
 
60
60
  a2 = quick_gem 'a', '2'
61
61
  util_build_gem a2
@@ -16,16 +16,16 @@ class TestGemSourceVendor < Gem::TestCase
16
16
  git = Gem::Source::Git.new 'a', 'a', 'master'
17
17
  installed = Gem::Source::Installed.new
18
18
 
19
- assert_equal(0, vendor. <=>(vendor), 'vendor <=> vendor')
19
+ assert_equal(0, vendor.<=>(vendor), 'vendor <=> vendor')
20
20
 
21
- assert_equal(1, vendor. <=>(remote), 'vendor <=> remote')
22
- assert_equal(-1, remote. <=>(vendor), 'remote <=> vendor')
21
+ assert_equal(1, vendor.<=>(remote), 'vendor <=> remote')
22
+ assert_equal(-1, remote.<=>(vendor), 'remote <=> vendor')
23
23
 
24
- assert_equal(1, vendor. <=>(git), 'vendor <=> git')
25
- assert_equal(-1, git. <=>(vendor), 'git <=> vendor')
24
+ assert_equal(1, vendor.<=>(git), 'vendor <=> git')
25
+ assert_equal(-1, git.<=>(vendor), 'git <=> vendor')
26
26
 
27
- assert_equal(1, vendor. <=>(installed), 'vendor <=> installed')
28
- assert_equal(-1, installed.<=>(vendor), 'installed <=> vendor')
27
+ assert_equal(1, vendor.<=>(installed), 'vendor <=> installed')
28
+ assert_equal(-1, installed.<=>(vendor), 'installed <=> vendor')
29
29
  end
30
30
 
31
31
  end
@@ -173,10 +173,19 @@ class TestGemSpecFetcher < Gem::TestCase
173
173
  spec_fetcher do|fetcher|
174
174
  fetcher.spec 'example', 1
175
175
  fetcher.spec 'other-example', 1
176
+ fetcher.spec 'examp', 1
176
177
  end
177
178
 
178
- suggestions = @sf.suggest_gems_from_name('examplw')
179
+ suggestions = @sf.suggest_gems_from_name('examplw', :latest, 1)
179
180
  assert_equal ['example'], suggestions
181
+
182
+ suggestions = @sf.suggest_gems_from_name('other')
183
+ assert_equal ['other-example'], suggestions
184
+
185
+ suggestions = @sf.suggest_gems_from_name('exam')
186
+ assert suggestions.any? { ['examp'] }
187
+ assert suggestions.any? { ['example'] }
188
+ assert suggestions.any? { ['other-example'] }
180
189
  end
181
190
 
182
191
  def test_suggest_gems_from_name_prerelease
@@ -313,7 +322,7 @@ class TestGemSpecFetcher < Gem::TestCase
313
322
  specs, _ = @sf.available_specs(:prerelease)
314
323
 
315
324
  expected = Gem::NameTuple.from_list \
316
- [['a', v('2.a'), Gem::Platform::RUBY]]
325
+ [['a', v('2.a'), Gem::Platform::RUBY]]
317
326
 
318
327
  assert_equal expected, specs[@source]
319
328
  end
@@ -140,12 +140,12 @@ end
140
140
  install_specs c1, c2, b1, b2, a1
141
141
 
142
142
  a1.activate
143
- assert_equal %w(a-1), loaded_spec_names
143
+ assert_equal %w[a-1], loaded_spec_names
144
144
  assert_equal ["b (> 0)"], unresolved_names
145
145
 
146
146
  require "d#{$$}"
147
147
 
148
- assert_equal %w(a-1 b-2 c-2), loaded_spec_names
148
+ assert_equal %w[a-1 b-2 c-2], loaded_spec_names
149
149
  assert_equal [], unresolved_names
150
150
  end
151
151
  end
@@ -187,12 +187,12 @@ end
187
187
  install_specs c1, c2, b1, b2, a1
188
188
 
189
189
  a1.activate
190
- assert_equal %w(a-1), loaded_spec_names
190
+ assert_equal %w[a-1], loaded_spec_names
191
191
  assert_equal ["b (> 0)"], unresolved_names
192
192
 
193
193
  require "d#{$$}"
194
194
 
195
- assert_equal %w(a-1 b-2 c-2), loaded_spec_names
195
+ assert_equal %w[a-1 b-2 c-2], loaded_spec_names
196
196
  assert_equal [], unresolved_names
197
197
  end
198
198
  end
@@ -209,12 +209,12 @@ end
209
209
  install_specs c1, b1, a1, a2, c2, b2
210
210
 
211
211
  a2.activate
212
- assert_equal %w(a-2), loaded_spec_names
212
+ assert_equal %w[a-2], loaded_spec_names
213
213
  assert_equal ["b (> 0)"], unresolved_names
214
214
 
215
215
  require "d#{$$}"
216
216
 
217
- assert_equal %w(a-2 b-1 c-1), loaded_spec_names
217
+ assert_equal %w[a-2 b-1 c-1], loaded_spec_names
218
218
  assert_equal [], unresolved_names
219
219
  end
220
220
  end
@@ -231,12 +231,12 @@ end
231
231
  install_specs d1, c1, c2, b1, b2, a1
232
232
 
233
233
  a1.activate
234
- assert_equal %w(a-1), loaded_spec_names
234
+ assert_equal %w[a-1], loaded_spec_names
235
235
  assert_equal ["b (> 0)"], unresolved_names
236
236
 
237
237
  require "d#{$$}"
238
238
 
239
- assert_equal %w(a-1 d-1), loaded_spec_names
239
+ assert_equal %w[a-1 d-1], loaded_spec_names
240
240
  assert_equal ["b (> 0)"], unresolved_names
241
241
  end
242
242
  end
@@ -246,7 +246,7 @@ end
246
246
  a1 = util_spec "a", "1", "b" => "> 0"
247
247
  b1 = util_spec "b", "1", "c" => ">= 0" # unresolved
248
248
  b2 = util_spec "b", "2", "c" => ">= 0"
249
- c1 = util_spec "c", "1", nil, "lib/c#{$$}.rb" # 1st level
249
+ c1 = util_spec "c", "1", nil, "lib/c#{$$}.rb" # 1st level
250
250
  c2 = util_spec "c", "2", nil, "lib/c#{$$}.rb"
251
251
 
252
252
  install_specs c1, c2, b1, b2, a1
@@ -255,7 +255,7 @@ end
255
255
 
256
256
  require "c#{$$}"
257
257
 
258
- assert_equal %w(a-1 b-2 c-2), loaded_spec_names
258
+ assert_equal %w[a-1 b-2 c-2], loaded_spec_names
259
259
  end
260
260
  end
261
261
 
@@ -264,7 +264,7 @@ end
264
264
  a1 = util_spec "a", "1", "b" => "> 0"
265
265
  b1 = util_spec "b", "1", "c" => ">= 0" # unresolved
266
266
  b2 = util_spec "b", "2", "c" => ">= 0"
267
- c1 = util_spec "c", "1", "d" => ">= 0" # 1st level
267
+ c1 = util_spec "c", "1", "d" => ">= 0" # 1st level
268
268
  c2 = util_spec "c", "2", "d" => ">= 0"
269
269
  d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
270
270
  d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
@@ -275,7 +275,7 @@ end
275
275
 
276
276
  require "d#{$$}"
277
277
 
278
- assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
278
+ assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
279
279
  end
280
280
  end
281
281
 
@@ -296,7 +296,7 @@ end
296
296
 
297
297
  require "d#{$$}"
298
298
 
299
- assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
299
+ assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
300
300
  end
301
301
  end
302
302
 
@@ -318,7 +318,7 @@ end
318
318
 
319
319
  require "d#{$$}"
320
320
 
321
- assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
321
+ assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
322
322
  end
323
323
  end
324
324
 
@@ -336,12 +336,12 @@ end
336
336
  install_specs c1, c2, c3, b1, b2, a1, a2, base
337
337
 
338
338
  base.activate
339
- assert_equal %w(0-1), loaded_spec_names
339
+ assert_equal %w[0-1], loaded_spec_names
340
340
  assert_equal ["A (>= 1)"], unresolved_names
341
341
 
342
342
  require "d#{$$}"
343
343
 
344
- assert_equal %w(0-1 A-2 b-2 c-2), loaded_spec_names
344
+ assert_equal %w[0-1 A-2 b-2 c-2], loaded_spec_names
345
345
  assert_equal [], unresolved_names
346
346
  end
347
347
  end
@@ -364,7 +364,7 @@ end
364
364
 
365
365
  require "d#{$$}"
366
366
 
367
- assert_includes [%w(a-1 b-2 c-3 d-2),%w(a-1 b-2 d-2)], loaded_spec_names
367
+ assert_includes [%w[a-1 b-2 c-3 d-2],%w[a-1 b-2 d-2]], loaded_spec_names
368
368
  end
369
369
  end
370
370
 
@@ -386,7 +386,7 @@ end
386
386
 
387
387
  require "d#{$$}"
388
388
 
389
- assert_includes [%w(a-1 b-2 d-2 xc-3), %w(a-1 b-2 d-2)], loaded_spec_names
389
+ assert_includes [%w[a-1 b-2 d-2 xc-3], %w[a-1 b-2 d-2]], loaded_spec_names
390
390
  end
391
391
  end
392
392
 
@@ -515,16 +515,16 @@ end
515
515
  require "b/c"
516
516
  end
517
517
 
518
- assert_equal %w(a-1 b-1), loaded_spec_names
518
+ assert_equal %w[a-1 b-1], loaded_spec_names
519
519
  end
520
520
 
521
521
  def test_self_activate_via_require_wtf
522
522
  save_loaded_features do
523
- a1 = util_spec "a", "1", "b" => "> 0", "d" => "> 0" # this
523
+ a1 = util_spec "a", "1", "b" => "> 0", "d" => "> 0" # this
524
524
  b1 = util_spec "b", "1", { "c" => ">= 1" }, "lib/b#{$$}.rb"
525
525
  b2 = util_spec "b", "2", { "c" => ">= 2" }, "lib/b#{$$}.rb" # this
526
526
  c1 = util_spec "c", "1"
527
- c2 = util_spec "c", "2" # this
527
+ c2 = util_spec "c", "2" # this
528
528
  d1 = util_spec "d", "1", { "c" => "< 2" }, "lib/d#{$$}.rb"
529
529
  d2 = util_spec "d", "2", { "c" => "< 2" }, "lib/d#{$$}.rb" # this
530
530
 
@@ -532,7 +532,7 @@ end
532
532
 
533
533
  a1.activate
534
534
 
535
- assert_equal %w(a-1), loaded_spec_names
535
+ assert_equal %w[a-1], loaded_spec_names
536
536
  assert_equal ["b (> 0)", "d (> 0)"], unresolved_names
537
537
 
538
538
  require "b#{$$}"
@@ -543,7 +543,7 @@ end
543
543
 
544
544
  assert_equal "unable to find a version of 'd' to activate", e.message
545
545
 
546
- assert_equal %w(a-1 b-2 c-2), loaded_spec_names
546
+ assert_equal %w[a-1 b-2 c-2], loaded_spec_names
547
547
  assert_equal ["d (> 0)"], unresolved_names
548
548
  end
549
549
  end
@@ -558,7 +558,7 @@ end
558
558
  install_specs c1, c2, b1, b2, a1
559
559
 
560
560
  a1.activate
561
- assert_equal %w(a-1 b-1 c-1), loaded_spec_names
561
+ assert_equal %w[a-1 b-1 c-1], loaded_spec_names
562
562
  end
563
563
 
564
564
  def test_self_activate_loaded
@@ -720,7 +720,7 @@ end
720
720
  version
721
721
  ]
722
722
 
723
- actual_value = Gem::Specification.attribute_names.map { |a| a.to_s }.sort
723
+ actual_value = Gem::Specification.attribute_names.map {|a| a.to_s }.sort
724
724
 
725
725
  assert_equal expected_value, actual_value
726
726
  end
@@ -795,7 +795,7 @@ bindir:
795
795
  op = spec.dependencies.first.requirement.requirements.first.first
796
796
  refute_kind_of YAML::Syck::DefaultKey, op
797
797
 
798
- refute_match %r%DefaultKey%, spec.to_ruby
798
+ refute_match %r{DefaultKey}, spec.to_ruby
799
799
  end
800
800
 
801
801
  def test_self_from_yaml_cleans_up_defaultkey
@@ -829,7 +829,7 @@ bindir:
829
829
  op = spec.dependencies.first.requirement.requirements.first.first
830
830
  refute_kind_of YAML::Syck::DefaultKey, op
831
831
 
832
- refute_match %r%DefaultKey%, spec.to_ruby
832
+ refute_match %r{DefaultKey}, spec.to_ruby
833
833
  end
834
834
 
835
835
  def test_self_from_yaml_cleans_up_defaultkey_from_newer_192
@@ -863,7 +863,7 @@ bindir:
863
863
  op = spec.dependencies.first.requirement.requirements.first.first
864
864
  refute_kind_of YAML::Syck::DefaultKey, op
865
865
 
866
- refute_match %r%DefaultKey%, spec.to_ruby
866
+ refute_match %r{DefaultKey}, spec.to_ruby
867
867
  end
868
868
 
869
869
  def test_self_from_yaml_cleans_up_Date_objects
@@ -1113,13 +1113,13 @@ dependencies: []
1113
1113
  install_specs @a1
1114
1114
 
1115
1115
  assert_includes Gem::Specification.all_names, 'a-1'
1116
- assert_includes Gem::Specification.stubs.map { |s| s.full_name }, 'a-1'
1116
+ assert_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
1117
1117
 
1118
1118
  uninstall_gem @a1
1119
1119
  Gem::Specification.reset
1120
1120
 
1121
1121
  refute_includes Gem::Specification.all_names, 'a-1'
1122
- refute_includes Gem::Specification.stubs.map { |s| s.full_name }, 'a-1'
1122
+ refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
1123
1123
  end
1124
1124
 
1125
1125
  def test_self_remove_spec_removed
@@ -1134,48 +1134,30 @@ dependencies: []
1134
1134
  Gem::Specification.reset
1135
1135
 
1136
1136
  refute_includes Gem::Specification.all_names, 'a-1'
1137
- refute_includes Gem::Specification.stubs.map { |s| s.full_name }, 'a-1'
1137
+ refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
1138
1138
  end
1139
1139
 
1140
- def test_self_stubs
1140
+ def test_self_stubs_for_lazy_loading
1141
1141
  Gem.loaded_specs.clear
1142
1142
  Gem::Specification.class_variable_set(:@@stubs, nil)
1143
1143
 
1144
1144
  dir_standard_specs = File.join Gem.dir, 'specifications'
1145
- dir_default_specs = Gem.default_specifications_dir
1146
1145
 
1147
- # Create gemspecs in three locations used in stubs
1148
- loaded_spec = Gem::Specification.new 'a', '3'
1149
- Gem.loaded_specs['a'] = loaded_spec
1150
- save_gemspec 'a', '2', dir_default_specs
1151
- save_gemspec 'a', '1', dir_standard_specs
1146
+ save_gemspec('a-1', '1', dir_standard_specs){|s| s.name = 'a' }
1147
+ save_gemspec('b-1', '1', dir_standard_specs){|s| s.name = 'b' }
1152
1148
 
1153
- full_names = ['a-3', 'a-2', 'a-1']
1154
- assert_equal full_names, Gem::Specification.stubs.map { |s| s.full_name }
1155
-
1156
- Gem.loaded_specs.delete 'a'
1157
- Gem::Specification.class_variable_set(:@@stubs, nil)
1158
- end
1159
-
1160
- def test_self_stubs_for
1161
- Gem.loaded_specs.clear
1162
- Gem::Specification.class_variable_set(:@@stubs, nil)
1163
-
1164
- dir_standard_specs = File.join Gem.dir, 'specifications'
1165
- dir_default_specs = Gem.default_specifications_dir
1166
-
1167
- # Create gemspecs in three locations used in stubs
1168
- loaded_spec = Gem::Specification.new 'a', '3'
1169
- Gem.loaded_specs['a'] = loaded_spec
1170
- save_gemspec('a-2', '2', dir_default_specs) { |s| s.name = 'a' }
1171
- save_gemspec('a-1', '1', dir_standard_specs) { |s| s.name = 'a' }
1172
-
1173
- full_names = ['a-3', 'a-2', 'a-1']
1174
-
1175
- assert_equal full_names, Gem::Specification.stubs_for('a').map { |s| s.full_name }
1149
+ assert_equal ['a-1'], Gem::Specification.stubs_for('a').map {|s| s.full_name }
1176
1150
  assert_equal 1, Gem::Specification.class_variable_get(:@@stubs_by_name).length
1151
+ assert_equal ['b-1'], Gem::Specification.stubs_for('b').map {|s| s.full_name }
1152
+ assert_equal 2, Gem::Specification.class_variable_get(:@@stubs_by_name).length
1153
+
1154
+ assert_equal(
1155
+ Gem::Specification.stubs_for('a').map {|s| s.object_id },
1156
+ Gem::Specification.stubs_for('a').map {|s| s.object_id }
1157
+ )
1177
1158
 
1178
1159
  Gem.loaded_specs.delete 'a'
1160
+ Gem.loaded_specs.delete 'b'
1179
1161
  Gem::Specification.class_variable_set(:@@stubs, nil)
1180
1162
  end
1181
1163
 
@@ -1187,7 +1169,7 @@ dependencies: []
1187
1169
 
1188
1170
  # create user spec
1189
1171
  user_spec_dir = File.join Gem.user_dir, 'specifications'
1190
- FileUtils.mkdir_p(user_spec_dir) unless Dir.exist? user_spec_dir
1172
+ FileUtils.mkdir_p(user_spec_dir) unless Dir.exist? user_spec_dir
1191
1173
  # dirs doesn't include user ?
1192
1174
  Gem::Specification.dirs << user_spec_dir
1193
1175
 
@@ -1197,7 +1179,7 @@ dependencies: []
1197
1179
 
1198
1180
  #create specs
1199
1181
  platforms.each do |plat|
1200
- spec = Gem::Specification.new(gem, v) { |s| s.platform = plat }
1182
+ spec = Gem::Specification.new(gem, v) {|s| s.platform = plat }
1201
1183
  File.open File.join(user_spec_dir, "#{gem}-#{v}-#{plat}.gemspec"), 'w' do |io|
1202
1184
  io.write spec.to_ruby
1203
1185
  end
@@ -1388,12 +1370,12 @@ dependencies: []
1388
1370
  awesome.add_dependency :gem_name
1389
1371
  end
1390
1372
 
1391
- assert_equal %w[true gem_name], gem.dependencies.map { |dep| dep.name }
1373
+ assert_equal %w[true gem_name], gem.dependencies.map {|dep| dep.name }
1392
1374
  end
1393
1375
 
1394
1376
  def test_add_dependency_from_existing_dependency
1395
1377
  dep = Gem::Dependency.new("existing_dep", Gem::Requirement.new('> 1'), :runtime)
1396
- spec = Gem::Specification.new { |s| s.add_dependency dep }
1378
+ spec = Gem::Specification.new {|s| s.add_dependency dep }
1397
1379
  assert_equal dep, spec.dependencies.first
1398
1380
  end
1399
1381
 
@@ -1402,7 +1384,7 @@ dependencies: []
1402
1384
  awesome.add_development_dependency "monkey"
1403
1385
  end
1404
1386
 
1405
- monkey = gem.dependencies.detect { |d| d.name == "monkey" }
1387
+ monkey = gem.dependencies.detect {|d| d.name == "monkey" }
1406
1388
  assert_equal(:development, monkey.type)
1407
1389
  end
1408
1390
 
@@ -1500,7 +1482,7 @@ dependencies: []
1500
1482
  default = new_default_spec 'default', 2
1501
1483
  install_default_gems default
1502
1484
 
1503
- stub = Gem::Specification.stubs.find { |s| s.name == 'default' }
1485
+ stub = Gem::Specification.stubs.find {|s| s.name == 'default' }
1504
1486
  assert_predicate stub, :default_gem?
1505
1487
 
1506
1488
  stub = Gem::Specification.find_all_by_name('default').first
@@ -1886,11 +1868,11 @@ dependencies: []
1886
1868
  end
1887
1869
 
1888
1870
  def test_files
1889
- @a1.files = %w(files bin/common)
1890
- @a1.test_files = %w(test_files bin/common)
1891
- @a1.executables = %w(executables common)
1892
- @a1.extra_rdoc_files = %w(extra_rdoc_files bin/common)
1893
- @a1.extensions = %w(extensions bin/common)
1871
+ @a1.files = %w[files bin/common]
1872
+ @a1.test_files = %w[test_files bin/common]
1873
+ @a1.executables = %w[executables common]
1874
+ @a1.extra_rdoc_files = %w[extra_rdoc_files bin/common]
1875
+ @a1.extensions = %w[extensions bin/common]
1894
1876
 
1895
1877
  expected = %w[
1896
1878
  bin/common
@@ -1904,11 +1886,11 @@ dependencies: []
1904
1886
  end
1905
1887
 
1906
1888
  def test_files_append
1907
- @a1.files = %w(files bin/common)
1908
- @a1.test_files = %w(test_files bin/common)
1909
- @a1.executables = %w(executables common)
1910
- @a1.extra_rdoc_files = %w(extra_rdoc_files bin/common)
1911
- @a1.extensions = %w(extensions bin/common)
1889
+ @a1.files = %w[files bin/common]
1890
+ @a1.test_files = %w[test_files bin/common]
1891
+ @a1.executables = %w[executables common]
1892
+ @a1.extra_rdoc_files = %w[extra_rdoc_files bin/common]
1893
+ @a1.extensions = %w[extensions bin/common]
1912
1894
 
1913
1895
  expected = %w[
1914
1896
  bin/common
@@ -2297,12 +2279,12 @@ dependencies: []
2297
2279
  install_specs a1 # , a2, b1, b2, c1, c2
2298
2280
 
2299
2281
  a1.activate
2300
- assert_equal %w(a-1), loaded_spec_names
2282
+ assert_equal %w[a-1], loaded_spec_names
2301
2283
  assert_equal [], unresolved_names
2302
2284
 
2303
2285
  assert require "d#{$$}"
2304
2286
 
2305
- assert_equal %w(a-1), loaded_spec_names
2287
+ assert_equal %w[a-1], loaded_spec_names
2306
2288
  assert_equal [], unresolved_names
2307
2289
  end
2308
2290
  end
@@ -2320,12 +2302,12 @@ dependencies: []
2320
2302
 
2321
2303
  a1.activate
2322
2304
  c1.activate
2323
- assert_equal %w(a-1 c-1), loaded_spec_names
2305
+ assert_equal %w[a-1 c-1], loaded_spec_names
2324
2306
  assert_equal ["b (> 0)"], unresolved_names
2325
2307
 
2326
2308
  assert require "d#{$$}"
2327
2309
 
2328
- assert_equal %w(a-1 c-1), loaded_spec_names
2310
+ assert_equal %w[a-1 c-1], loaded_spec_names
2329
2311
  assert_equal ["b (> 0)"], unresolved_names
2330
2312
  end
2331
2313
  end
@@ -2348,7 +2330,7 @@ dependencies: []
2348
2330
 
2349
2331
  expected = %w[rake jabber4r pqa]
2350
2332
 
2351
- assert_equal expected, @c1.runtime_dependencies.map { |d| d.name }
2333
+ assert_equal expected, @c1.runtime_dependencies.map {|d| d.name }
2352
2334
  end
2353
2335
 
2354
2336
  def test_spaceship_name
@@ -2661,7 +2643,7 @@ end
2661
2643
  def test_to_yaml_platform_empty_string
2662
2644
  @a1.instance_variable_set :@original_platform, ''
2663
2645
 
2664
- assert_match %r|^platform: ruby$|, @a1.to_yaml
2646
+ assert_match %r{^platform: ruby$}, @a1.to_yaml
2665
2647
  end
2666
2648
 
2667
2649
  def test_to_yaml_platform_legacy
@@ -2679,7 +2661,7 @@ end
2679
2661
  def test_to_yaml_platform_nil
2680
2662
  @a1.instance_variable_set :@original_platform, nil
2681
2663
 
2682
- assert_match %r|^platform: ruby$|, @a1.to_yaml
2664
+ assert_match %r{^platform: ruby$}, @a1.to_yaml
2683
2665
  end
2684
2666
 
2685
2667
  def test_validate
@@ -2723,7 +2705,7 @@ end
2723
2705
  @a1.validate
2724
2706
  end
2725
2707
 
2726
- assert_equal %{"#{f}" or "#{t}" is not an author}, e.message
2708
+ assert_equal %("#{f}" or "#{t}" is not an author), e.message
2727
2709
 
2728
2710
  @a1.authors = ["#{t} (who is writing this software)"]
2729
2711
 
@@ -2731,7 +2713,7 @@ end
2731
2713
  @a1.validate
2732
2714
  end
2733
2715
 
2734
- assert_equal %{"#{f}" or "#{t}" is not an author}, e.message
2716
+ assert_equal %("#{f}" or "#{t}" is not an author), e.message
2735
2717
  end
2736
2718
  end
2737
2719
 
@@ -2856,6 +2838,37 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2856
2838
  end
2857
2839
  end
2858
2840
 
2841
+ def test_validate_rake_extension_have_rake_dependency_warning
2842
+ util_setup_validate
2843
+
2844
+ Dir.chdir @tempdir do
2845
+ @a1.extensions = ['Rakefile']
2846
+ File.write File.join(@tempdir, 'Rakefile'), ''
2847
+
2848
+ use_ui @ui do
2849
+ @a1.validate
2850
+ end
2851
+
2852
+ assert_match(/add rake as a dependency/, @ui.error)
2853
+ end
2854
+ end
2855
+
2856
+ def test_validate_rake_extension_have_rake_dependency_no_warning
2857
+ util_setup_validate
2858
+
2859
+ Dir.chdir @tempdir do
2860
+ @a1.extensions = ['Rakefile']
2861
+ @a1.add_runtime_dependency 'rake'
2862
+ File.write File.join(@tempdir, 'Rakefile'), ''
2863
+
2864
+ use_ui @ui do
2865
+ @a1.validate
2866
+ end
2867
+
2868
+ refute_match(/add rake as a dependency/, @ui.error)
2869
+ end
2870
+ end
2871
+
2859
2872
  def test_validate_description
2860
2873
  util_setup_validate
2861
2874
 
@@ -2883,7 +2896,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2883
2896
  @a1.validate
2884
2897
  end
2885
2898
 
2886
- assert_equal %{"#{f}" or "#{t}" is not a description}, e.message
2899
+ assert_equal %("#{f}" or "#{t}" is not a description), e.message
2887
2900
 
2888
2901
  @a1.description = "#{t} (describe your package)"
2889
2902
 
@@ -2891,7 +2904,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2891
2904
  @a1.validate
2892
2905
  end
2893
2906
 
2894
- assert_equal %{"#{f}" or "#{t}" is not a description}, e.message
2907
+ assert_equal %("#{f}" or "#{t}" is not a description), e.message
2895
2908
  end
2896
2909
  end
2897
2910
 
@@ -2905,7 +2918,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2905
2918
  @a1.validate
2906
2919
  end
2907
2920
 
2908
- assert_equal %{"#{f}" or "#{t}" is not an email}, e.message
2921
+ assert_equal %("#{f}" or "#{t}" is not an email), e.message
2909
2922
 
2910
2923
  @a1.email = "#{t} (your e-mail)"
2911
2924
 
@@ -2913,7 +2926,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2913
2926
  @a1.validate
2914
2927
  end
2915
2928
 
2916
- assert_equal %{"#{f}" or "#{t}" is not an email}, e.message
2929
+ assert_equal %("#{f}" or "#{t}" is not an email), e.message
2917
2930
  end
2918
2931
  end
2919
2932
 
@@ -3027,8 +3040,8 @@ Please report a bug if this causes problems.
3027
3040
 
3028
3041
  specification.define_singleton_method(:find_all_by_name) do |dep_name|
3029
3042
  [
3030
- specification.new { |s| s.name = "z", s.version = Gem::Version.new("1") },
3031
- specification.new { |s| s.name = "z", s.version = Gem::Version.new("2") }
3043
+ specification.new {|s| s.name = "z", s.version = Gem::Version.new("1") },
3044
+ specification.new {|s| s.name = "z", s.version = Gem::Version.new("2") }
3032
3045
  ]
3033
3046
  end
3034
3047
 
@@ -3122,10 +3135,21 @@ Please report a bug if this causes problems.
3122
3135
  @a1.validate
3123
3136
  end
3124
3137
 
3125
- assert_match <<-warning, @ui.error
3138
+ assert_match <<-WARNING, @ui.error
3126
3139
  WARNING: licenses is empty, but is recommended. Use a license identifier from
3127
3140
  http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3128
- warning
3141
+ WARNING
3142
+ end
3143
+
3144
+ def test_validate_license_in_a_non_packaging_context
3145
+ util_setup_validate
3146
+
3147
+ use_ui @ui do
3148
+ @a1.licenses.clear
3149
+ @a1.validate(false)
3150
+ end
3151
+
3152
+ assert_empty @ui.error
3129
3153
  end
3130
3154
 
3131
3155
  def test_removed_methods
@@ -3151,10 +3175,10 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3151
3175
  @a1.validate
3152
3176
  end
3153
3177
 
3154
- assert_match <<-warning, @ui.error
3178
+ assert_match <<-WARNING, @ui.error
3155
3179
  WARNING: license value 'BSD' is invalid. Use a license identifier from
3156
3180
  http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3157
- warning
3181
+ WARNING
3158
3182
  end
3159
3183
 
3160
3184
  def test_validate_license_values_plus
@@ -3198,14 +3222,14 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3198
3222
  @a1.validate
3199
3223
  end
3200
3224
 
3201
- assert_match <<-warning, @ui.error
3225
+ assert_match <<-WARNING, @ui.error
3202
3226
  WARNING: license value 'GPL-2.0+ FOO' is invalid. Use a license identifier from
3203
3227
  http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3204
- warning
3205
- assert_match <<-warning, @ui.error
3228
+ WARNING
3229
+ assert_match <<-WARNING, @ui.error
3206
3230
  WARNING: license value 'GPL-2.0 FOO' is invalid. Use a license identifier from
3207
3231
  http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3208
- warning
3232
+ WARNING
3209
3233
  end
3210
3234
 
3211
3235
  def test_validate_license_with_invalid_exception
@@ -3216,10 +3240,10 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3216
3240
  @a1.validate
3217
3241
  end
3218
3242
 
3219
- assert_match <<-warning, @ui.error
3243
+ assert_match <<-WARNING, @ui.error
3220
3244
  WARNING: license value 'GPL-2.0+ WITH Autocofn-exception-2.0' is invalid. Use a license identifier from
3221
3245
  http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3222
- warning
3246
+ WARNING
3223
3247
  end
3224
3248
 
3225
3249
  def test_validate_license_gives_suggestions
@@ -3230,11 +3254,11 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3230
3254
  @a1.validate
3231
3255
  end
3232
3256
 
3233
- assert_match <<-warning, @ui.error
3257
+ assert_match <<-WARNING, @ui.error
3234
3258
  WARNING: license value 'ruby' is invalid. Use a license identifier from
3235
3259
  http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3236
3260
  Did you mean 'Ruby'?
3237
- warning
3261
+ WARNING
3238
3262
  end
3239
3263
 
3240
3264
  def test_validate_empty_files
@@ -3330,7 +3354,7 @@ Did you mean 'Ruby'?
3330
3354
  spec.validate
3331
3355
  end
3332
3356
 
3333
- assert_match %r%^#{name}%, e.message
3357
+ assert_match %r{^#{name}}, e.message
3334
3358
  end
3335
3359
  end
3336
3360
  end
@@ -3430,7 +3454,7 @@ Did you mean 'Ruby'?
3430
3454
  @a1.validate
3431
3455
  end
3432
3456
 
3433
- assert_equal %{"#{f}" or "#{t}" is not a summary}, e.message
3457
+ assert_equal %("#{f}" or "#{t}" is not a summary), e.message
3434
3458
 
3435
3459
  @a1.summary = "#{t} (describe your package)"
3436
3460
 
@@ -3438,7 +3462,7 @@ Did you mean 'Ruby'?
3438
3462
  @a1.validate
3439
3463
  end
3440
3464
 
3441
- assert_equal %{"#{f}" or "#{t}" is not a summary}, e.message
3465
+ assert_equal %("#{f}" or "#{t}" is not a summary), e.message
3442
3466
  end
3443
3467
  end
3444
3468
 
@@ -3552,7 +3576,8 @@ Did you mean 'Ruby'?
3552
3576
  s.metadata = {
3553
3577
  "one" => "two",
3554
3578
  "home" => "three",
3555
- "homepage_uri" => "https://example.com/user/repo"
3579
+ "homepage_uri" => "https://example.com/user/repo",
3580
+ "funding_uri" => "https://example.com/donate"
3556
3581
  }
3557
3582
  end
3558
3583
 
@@ -3837,12 +3862,17 @@ end
3837
3862
  FileUtils.mkdir_p "test"
3838
3863
  FileUtils.mkdir_p "bin"
3839
3864
 
3840
- FileUtils.touch File.join("ext", "a", "extconf.rb")
3841
- FileUtils.touch File.join("lib", "code.rb")
3842
- FileUtils.touch File.join("test", "suite.rb")
3865
+ begin
3866
+ umask_orig = File.umask(2)
3867
+ FileUtils.touch File.join("ext", "a", "extconf.rb")
3868
+ FileUtils.touch File.join("lib", "code.rb")
3869
+ FileUtils.touch File.join("test", "suite.rb")
3843
3870
 
3844
- File.open "bin/exec", "w", 0755 do |fp|
3845
- fp.puts "#!#{Gem.ruby}"
3871
+ File.open "bin/exec", "w", 0755 do |fp|
3872
+ fp.puts "#!#{Gem.ruby}"
3873
+ end
3874
+ ensure
3875
+ File.umask(umask_orig)
3846
3876
  end
3847
3877
  end
3848
3878
  end