rubygems-update 2.6.14 → 2.7.0

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

Potentially problematic release.


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

Files changed (347) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +10 -7
  3. data/CONTRIBUTING.rdoc +53 -54
  4. data/History.txt +173 -9
  5. data/Manifest.txt +39 -11
  6. data/POLICIES.rdoc +3 -3
  7. data/README.md +72 -0
  8. data/Rakefile +30 -5
  9. data/appveyor.yml +29 -1
  10. data/bin/gem +1 -1
  11. data/bin/update_rubygems +2 -2
  12. data/bundler/CHANGELOG.md +269 -9
  13. data/bundler/CODE_OF_CONDUCT.md +1 -1
  14. data/bundler/CONTRIBUTING.md +10 -29
  15. data/bundler/README.md +22 -10
  16. data/bundler/exe/bundle +5 -7
  17. data/bundler/exe/bundle_ruby +4 -3
  18. data/bundler/lib/bundler.rb +94 -74
  19. data/bundler/lib/bundler/build_metadata.rb +36 -0
  20. data/bundler/lib/bundler/capistrano.rb +5 -0
  21. data/bundler/lib/bundler/cli.rb +229 -66
  22. data/bundler/lib/bundler/cli/add.rb +25 -0
  23. data/bundler/lib/bundler/cli/binstubs.rb +9 -7
  24. data/bundler/lib/bundler/cli/cache.rb +5 -4
  25. data/bundler/lib/bundler/cli/check.rb +3 -5
  26. data/bundler/lib/bundler/cli/clean.rb +5 -6
  27. data/bundler/lib/bundler/cli/common.rb +18 -2
  28. data/bundler/lib/bundler/cli/config.rb +26 -7
  29. data/bundler/lib/bundler/cli/console.rb +2 -1
  30. data/bundler/lib/bundler/cli/doctor.rb +1 -0
  31. data/bundler/lib/bundler/cli/exec.rb +3 -2
  32. data/bundler/lib/bundler/cli/gem.rb +36 -15
  33. data/bundler/lib/bundler/cli/info.rb +50 -0
  34. data/bundler/lib/bundler/cli/init.rb +20 -7
  35. data/bundler/lib/bundler/cli/inject.rb +13 -4
  36. data/bundler/lib/bundler/cli/install.rb +61 -77
  37. data/bundler/lib/bundler/cli/issue.rb +40 -0
  38. data/bundler/lib/bundler/cli/list.rb +22 -0
  39. data/bundler/lib/bundler/cli/lock.rb +4 -2
  40. data/bundler/lib/bundler/cli/open.rb +2 -2
  41. data/bundler/lib/bundler/cli/outdated.rb +30 -28
  42. data/bundler/lib/bundler/cli/package.rb +9 -6
  43. data/bundler/lib/bundler/cli/platform.rb +1 -0
  44. data/bundler/lib/bundler/cli/plugin.rb +1 -0
  45. data/bundler/lib/bundler/cli/pristine.rb +43 -0
  46. data/bundler/lib/bundler/cli/show.rb +1 -1
  47. data/bundler/lib/bundler/cli/update.rb +32 -11
  48. data/bundler/lib/bundler/cli/viz.rb +5 -1
  49. data/bundler/lib/bundler/compact_index_client.rb +1 -0
  50. data/bundler/lib/bundler/compact_index_client/cache.rb +1 -2
  51. data/bundler/lib/bundler/compact_index_client/updater.rb +26 -7
  52. data/bundler/lib/bundler/compatibility_guard.rb +14 -0
  53. data/bundler/lib/bundler/constants.rb +1 -0
  54. data/bundler/lib/bundler/current_ruby.rb +8 -7
  55. data/bundler/lib/bundler/definition.rb +231 -159
  56. data/bundler/lib/bundler/dep_proxy.rb +2 -0
  57. data/bundler/lib/bundler/dependency.rb +6 -7
  58. data/bundler/lib/bundler/deployment.rb +1 -1
  59. data/bundler/lib/bundler/deprecate.rb +14 -3
  60. data/bundler/lib/bundler/dsl.rb +103 -62
  61. data/bundler/lib/bundler/endpoint_specification.rb +12 -2
  62. data/bundler/lib/bundler/env.rb +97 -36
  63. data/bundler/lib/bundler/environment_preserver.rb +27 -6
  64. data/bundler/lib/bundler/errors.rb +3 -1
  65. data/bundler/lib/bundler/feature_flag.rb +39 -4
  66. data/bundler/lib/bundler/fetcher.rb +15 -8
  67. data/bundler/lib/bundler/fetcher/base.rb +1 -0
  68. data/bundler/lib/bundler/fetcher/compact_index.rb +2 -12
  69. data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
  70. data/bundler/lib/bundler/fetcher/downloader.rb +4 -2
  71. data/bundler/lib/bundler/fetcher/index.rb +1 -0
  72. data/bundler/lib/bundler/friendly_errors.rb +5 -2
  73. data/bundler/lib/bundler/gem_helper.rb +23 -9
  74. data/bundler/lib/bundler/gem_helpers.rb +1 -0
  75. data/bundler/lib/bundler/gem_remote_fetcher.rb +1 -0
  76. data/bundler/lib/bundler/gem_tasks.rb +1 -0
  77. data/bundler/lib/bundler/gem_version_promoter.rb +1 -0
  78. data/bundler/lib/bundler/gemdeps.rb +1 -0
  79. data/bundler/lib/bundler/graph.rb +1 -0
  80. data/bundler/lib/bundler/index.rb +19 -11
  81. data/bundler/lib/bundler/injector.rb +51 -27
  82. data/bundler/lib/bundler/inline.rb +10 -10
  83. data/bundler/lib/bundler/installer.rb +104 -50
  84. data/bundler/lib/bundler/installer/gem_installer.rb +5 -2
  85. data/bundler/lib/bundler/installer/parallel_installer.rb +91 -42
  86. data/bundler/lib/bundler/installer/standalone.rb +1 -0
  87. data/bundler/lib/bundler/lazy_specification.rb +17 -4
  88. data/bundler/lib/bundler/lockfile_generator.rb +95 -0
  89. data/bundler/lib/bundler/lockfile_parser.rb +49 -35
  90. data/bundler/lib/bundler/match_platform.rb +1 -0
  91. data/bundler/lib/bundler/mirror.rb +8 -3
  92. data/bundler/lib/bundler/plugin.rb +6 -1
  93. data/bundler/lib/bundler/plugin/api/source.rb +16 -3
  94. data/bundler/lib/bundler/plugin/index.rb +2 -0
  95. data/bundler/lib/bundler/plugin/installer.rb +7 -6
  96. data/bundler/lib/bundler/plugin/source_list.rb +7 -8
  97. data/bundler/lib/bundler/process_lock.rb +24 -0
  98. data/bundler/lib/bundler/psyched_yaml.rb +10 -0
  99. data/bundler/lib/bundler/remote_specification.rb +25 -1
  100. data/bundler/lib/bundler/resolver.rb +171 -192
  101. data/bundler/lib/bundler/resolver/spec_group.rb +111 -0
  102. data/bundler/lib/bundler/retry.rb +1 -0
  103. data/bundler/lib/bundler/ruby_dsl.rb +1 -0
  104. data/bundler/lib/bundler/ruby_version.rb +6 -1
  105. data/bundler/lib/bundler/rubygems_ext.rb +18 -8
  106. data/bundler/lib/bundler/rubygems_gem_installer.rb +25 -2
  107. data/bundler/lib/bundler/rubygems_integration.rb +157 -66
  108. data/bundler/lib/bundler/runtime.rb +28 -18
  109. data/bundler/lib/bundler/settings.rb +202 -87
  110. data/bundler/lib/bundler/settings/validator.rb +79 -0
  111. data/bundler/lib/bundler/setup.rb +4 -7
  112. data/bundler/lib/bundler/shared_helpers.rb +129 -25
  113. data/bundler/lib/bundler/similarity_detector.rb +1 -0
  114. data/bundler/lib/bundler/source.rb +53 -1
  115. data/bundler/lib/bundler/source/gemspec.rb +1 -0
  116. data/bundler/lib/bundler/source/git.rb +49 -21
  117. data/bundler/lib/bundler/source/git/git_proxy.rb +17 -12
  118. data/bundler/lib/bundler/source/metadata.rb +63 -0
  119. data/bundler/lib/bundler/source/path.rb +38 -17
  120. data/bundler/lib/bundler/source/path/installer.rb +4 -2
  121. data/bundler/lib/bundler/source/rubygems.rb +154 -82
  122. data/bundler/lib/bundler/source/rubygems/remote.rb +8 -1
  123. data/bundler/lib/bundler/source_list.rb +75 -15
  124. data/bundler/lib/bundler/spec_set.rb +34 -21
  125. data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
  126. data/bundler/lib/bundler/stub_specification.rb +86 -2
  127. data/bundler/lib/bundler/templates/Executable +5 -1
  128. data/bundler/lib/bundler/templates/Executable.bundler +105 -0
  129. data/bundler/lib/bundler/templates/Executable.standalone +5 -5
  130. data/bundler/lib/bundler/templates/Gemfile +3 -0
  131. data/bundler/lib/bundler/templates/gems.rb +8 -0
  132. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +4 -2
  133. data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
  134. data/bundler/lib/bundler/templates/newgem/README.md.tt +14 -8
  135. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +5 -5
  136. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
  137. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
  138. data/bundler/lib/bundler/templates/newgem/gitignore.tt +0 -1
  139. data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +6 -6
  140. data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +4 -4
  141. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +13 -10
  142. data/bundler/lib/bundler/templates/newgem/rspec.tt +1 -0
  143. data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +0 -2
  144. data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +3 -0
  145. data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +1 -1
  146. data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +3 -3
  147. data/bundler/lib/bundler/ui.rb +1 -0
  148. data/bundler/lib/bundler/ui/rg_proxy.rb +1 -0
  149. data/bundler/lib/bundler/ui/shell.rb +24 -10
  150. data/bundler/lib/bundler/ui/silent.rb +12 -1
  151. data/bundler/lib/bundler/uri_credentials_filter.rb +1 -0
  152. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
  153. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
  154. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
  155. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
  156. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
  157. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +16 -5
  158. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
  159. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +10 -2
  160. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -0
  161. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -0
  162. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -0
  163. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +1 -0
  164. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -0
  165. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -0
  166. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +5 -4
  167. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -6
  168. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
  169. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
  170. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
  171. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +501 -138
  172. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
  173. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
  174. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +3 -1
  175. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +46 -21
  176. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +24 -22
  177. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +2 -1
  178. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
  179. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +2 -2
  180. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
  181. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +66 -18
  182. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +17 -15
  183. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +55 -32
  184. data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +13 -11
  185. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
  186. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +7 -5
  187. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +94 -63
  188. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +3 -3
  189. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +13 -13
  190. data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +4 -5
  191. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
  192. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
  193. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +16 -16
  194. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +42 -21
  195. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -10
  196. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +31 -29
  197. data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  198. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +49 -33
  199. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -1
  200. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -4
  201. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
  202. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  203. data/bundler/lib/bundler/vendored_fileutils.rb +9 -0
  204. data/bundler/lib/bundler/vendored_molinillo.rb +1 -0
  205. data/bundler/lib/bundler/vendored_persistent.rb +35 -0
  206. data/bundler/lib/bundler/vendored_thor.rb +6 -2
  207. data/bundler/lib/bundler/version.rb +19 -2
  208. data/bundler/lib/bundler/version_ranges.rb +76 -0
  209. data/bundler/lib/bundler/vlad.rb +5 -0
  210. data/bundler/lib/bundler/worker.rb +3 -1
  211. data/bundler/lib/bundler/yaml_serializer.rb +3 -3
  212. data/bundler/man/bundle-add.ronn +29 -0
  213. data/bundler/man/bundle-binstubs.ronn +14 -0
  214. data/bundler/man/bundle-check.ronn +26 -0
  215. data/bundler/man/bundle-clean.ronn +18 -0
  216. data/bundler/man/bundle-config.ronn +180 -60
  217. data/bundler/man/bundle-exec.ronn +7 -0
  218. data/bundler/man/bundle-gem.ronn +3 -2
  219. data/bundler/man/bundle-info.ronn +17 -0
  220. data/bundler/man/bundle-init.ronn +18 -0
  221. data/bundler/man/bundle-inject.ronn +22 -0
  222. data/bundler/man/bundle-install.ronn +32 -32
  223. data/bundler/man/bundle-list.ronn +15 -0
  224. data/bundler/man/bundle-open.ronn +19 -0
  225. data/bundler/man/bundle-outdated.ronn +1 -1
  226. data/bundler/man/bundle-package.ronn +5 -0
  227. data/bundler/man/bundle-pristine.ronn +34 -0
  228. data/bundler/man/bundle-show.ronn +20 -0
  229. data/bundler/man/bundle-update.ronn +6 -3
  230. data/bundler/man/bundle-viz.ronn +30 -0
  231. data/bundler/man/bundle.ronn +11 -20
  232. data/bundler/man/gemfile.5.ronn +55 -64
  233. data/lib/rubygems.rb +79 -36
  234. data/lib/rubygems/basic_specification.rb +8 -4
  235. data/lib/rubygems/bundler_version_finder.rb +112 -0
  236. data/lib/rubygems/command.rb +1 -1
  237. data/lib/rubygems/command_manager.rb +3 -1
  238. data/lib/rubygems/commands/cert_command.rb +31 -6
  239. data/lib/rubygems/commands/cleanup_command.rb +1 -1
  240. data/lib/rubygems/commands/help_command.rb +1 -1
  241. data/lib/rubygems/commands/owner_command.rb +3 -1
  242. data/lib/rubygems/commands/pristine_command.rb +11 -8
  243. data/lib/rubygems/commands/push_command.rb +2 -1
  244. data/lib/rubygems/commands/query_command.rb +13 -14
  245. data/lib/rubygems/commands/setup_command.rb +124 -69
  246. data/lib/rubygems/commands/signin_command.rb +33 -0
  247. data/lib/rubygems/commands/signout_command.rb +33 -0
  248. data/lib/rubygems/commands/uninstall_command.rb +4 -3
  249. data/lib/rubygems/commands/unpack_command.rb +16 -4
  250. data/lib/rubygems/commands/update_command.rb +1 -1
  251. data/lib/rubygems/commands/which_command.rb +1 -1
  252. data/lib/rubygems/commands/yank_command.rb +4 -11
  253. data/lib/rubygems/config_file.rb +13 -24
  254. data/lib/rubygems/core_ext/kernel_require.rb +10 -9
  255. data/lib/rubygems/dependency.rb +2 -0
  256. data/lib/rubygems/dependency_installer.rb +4 -0
  257. data/lib/rubygems/errors.rb +3 -0
  258. data/lib/rubygems/exceptions.rb +6 -0
  259. data/lib/rubygems/ext/builder.rb +1 -1
  260. data/lib/rubygems/ext/ext_conf_builder.rb +2 -4
  261. data/lib/rubygems/ext/rake_builder.rb +1 -1
  262. data/lib/rubygems/gem_runner.rb +5 -1
  263. data/lib/rubygems/install_update_options.rb +5 -28
  264. data/lib/rubygems/installer.rb +12 -7
  265. data/lib/rubygems/installer_test_case.rb +6 -3
  266. data/lib/rubygems/package/old.rb +1 -1
  267. data/lib/rubygems/request.rb +1 -1
  268. data/lib/rubygems/request_set.rb +20 -3
  269. data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
  270. data/lib/rubygems/requirement.rb +5 -1
  271. data/lib/rubygems/resolver.rb +24 -3
  272. data/lib/rubygems/resolver/installer_set.rb +4 -6
  273. data/lib/rubygems/safe_yaml.rb +4 -1
  274. data/lib/rubygems/security.rb +10 -3
  275. data/lib/rubygems/security_option.rb +43 -0
  276. data/lib/rubygems/server.rb +4 -12
  277. data/lib/rubygems/source.rb +7 -4
  278. data/lib/rubygems/source/git.rb +2 -1
  279. data/lib/rubygems/source/local.rb +38 -35
  280. data/lib/rubygems/source/lock.rb +4 -1
  281. data/lib/rubygems/source_local.rb +3 -1
  282. data/lib/rubygems/source_specific_file.rb +3 -2
  283. data/lib/rubygems/spec_fetcher.rb +7 -3
  284. data/lib/rubygems/specification.rb +281 -231
  285. data/lib/rubygems/stub_specification.rb +2 -3
  286. data/lib/rubygems/test_case.rb +14 -1
  287. data/lib/rubygems/user_interaction.rb +15 -13
  288. data/lib/rubygems/util.rb +6 -17
  289. data/lib/rubygems/version.rb +17 -3
  290. data/lib/rubygems/version_option.rb +6 -1
  291. data/setup.rb +1 -1
  292. data/test/rubygems/private3072_key.pem +40 -0
  293. data/test/rubygems/public3072_cert.pem +25 -0
  294. data/test/rubygems/test_config.rb +1 -1
  295. data/test/rubygems/test_gem.rb +72 -14
  296. data/test/rubygems/test_gem_bundler_version_finder.rb +125 -0
  297. data/test/rubygems/test_gem_command.rb +1 -1
  298. data/test/rubygems/test_gem_commands_build_command.rb +27 -1
  299. data/test/rubygems/test_gem_commands_cert_command.rb +64 -0
  300. data/test/rubygems/test_gem_commands_install_command.rb +35 -2
  301. data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
  302. data/test/rubygems/test_gem_commands_query_command.rb +19 -0
  303. data/test/rubygems/test_gem_commands_setup_command.rb +17 -0
  304. data/test/rubygems/test_gem_commands_signin_command.rb +95 -0
  305. data/test/rubygems/test_gem_commands_signout_command.rb +37 -0
  306. data/test/rubygems/test_gem_commands_sources_command.rb +1 -1
  307. data/test/rubygems/test_gem_commands_uninstall_command.rb +12 -0
  308. data/test/rubygems/test_gem_commands_update_command.rb +1 -1
  309. data/test/rubygems/test_gem_commands_which_command.rb +3 -3
  310. data/test/rubygems/test_gem_dependency.rb +28 -0
  311. data/test/rubygems/test_gem_ext_builder.rb +2 -2
  312. data/test/rubygems/test_gem_ext_rake_builder.rb +2 -2
  313. data/test/rubygems/test_gem_install_update_options.rb +2 -1
  314. data/test/rubygems/test_gem_installer.rb +29 -27
  315. data/test/rubygems/test_gem_package.rb +5 -5
  316. data/test/rubygems/test_gem_remote_fetcher.rb +2 -2
  317. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
  318. data/test/rubygems/test_gem_requirement.rb +6 -0
  319. data/test/rubygems/test_gem_resolver.rb +26 -0
  320. data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
  321. data/test/rubygems/test_gem_security.rb +5 -0
  322. data/test/rubygems/test_gem_security_policy.rb +24 -24
  323. data/test/rubygems/test_gem_security_signer.rb +6 -6
  324. data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
  325. data/test/rubygems/test_gem_server.rb +18 -1
  326. data/test/rubygems/test_gem_source.rb +9 -0
  327. data/test/rubygems/test_gem_spec_fetcher.rb +20 -0
  328. data/test/rubygems/test_gem_specification.rb +85 -10
  329. data/test/rubygems/test_gem_stream_ui.rb +6 -6
  330. data/test/rubygems/test_gem_stub_specification.rb +19 -1
  331. data/test/rubygems/test_gem_util.rb +1 -0
  332. data/test/rubygems/test_gem_version.rb +28 -7
  333. data/test/rubygems/test_gem_version_option.rb +15 -0
  334. data/test/rubygems/test_kernel.rb +30 -0
  335. data/test/rubygems/test_require.rb +44 -0
  336. metadata +47 -46
  337. data/README.rdoc +0 -54
  338. data/bundler/DEVELOPMENT.md +0 -150
  339. data/bundler/ISSUES.md +0 -117
  340. data/bundler/lib/bundler/postit_trampoline.rb +0 -73
  341. data/bundler/lib/bundler/vendor/postit/lib/postit.rb +0 -15
  342. data/bundler/lib/bundler/vendor/postit/lib/postit/environment.rb +0 -44
  343. data/bundler/lib/bundler/vendor/postit/lib/postit/installer.rb +0 -28
  344. data/bundler/lib/bundler/vendor/postit/lib/postit/parser.rb +0 -21
  345. data/bundler/lib/bundler/vendor/postit/lib/postit/setup.rb +0 -12
  346. data/bundler/lib/bundler/vendor/postit/lib/postit/version.rb +0 -3
  347. data/bundler/man/index.txt +0 -8
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ require 'rubygems/command'
3
+ require 'rubygems/gemcutter_utilities'
4
+
5
+ class Gem::Commands::SigninCommand < Gem::Command
6
+ include Gem::GemcutterUtilities
7
+
8
+ def initialize
9
+ super 'signin', 'Sign in to any gemcutter-compatible host. '\
10
+ 'It defaults to https://rubygems.org'
11
+
12
+ add_option('--host HOST', 'Push to another gemcutter-compatible host') do |value, options|
13
+ options[:host] = value
14
+ end
15
+
16
+ end
17
+
18
+ def description # :nodoc:
19
+ 'The signin command executes host sign in for a push server (the default is'\
20
+ ' https://rubygems.org). The host can be provided with the host flag or can'\
21
+ ' be inferred from the provided gem. Host resolution matches the resolution'\
22
+ ' strategy for the push command.'
23
+ end
24
+
25
+ def usage # :nodoc:
26
+ program_name
27
+ end
28
+
29
+ def execute
30
+ sign_in options[:host]
31
+ end
32
+
33
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ require 'rubygems/command'
3
+
4
+ class Gem::Commands::SignoutCommand < Gem::Command
5
+
6
+ def initialize
7
+ super 'signout', 'Sign out from all the current sessions.'
8
+ end
9
+
10
+ def description # :nodoc:
11
+ 'The `signout` command is used to sign out from all current sessions,'\
12
+ ' allowing you to sign in using a different set of credentials.'
13
+ end
14
+
15
+ def usage # :nodoc:
16
+ program_name
17
+ end
18
+
19
+ def execute
20
+ credentials_path = Gem.configuration.credentials_path
21
+
22
+ if !File.exist?(credentials_path) then
23
+ alert_error 'You are not currently signed in.'
24
+ elsif !File.writable?(credentials_path) then
25
+ alert_error "File '#{Gem.configuration.credentials_path}' is read-only."\
26
+ ' Please make sure it is writable.'
27
+ else
28
+ Gem.configuration.unset_api_key!
29
+ say 'You have successfully signed out from all sessions.'
30
+ end
31
+ end
32
+
33
+ end
@@ -30,7 +30,7 @@ class Gem::Commands::UninstallCommand < Gem::Command
30
30
  options[:ignore] = value
31
31
  end
32
32
 
33
- add_option('-D', '--[no-]-check-development',
33
+ add_option('-D', '--[no-]check-development',
34
34
  'Check development dependencies while uninstalling',
35
35
  '(default: false)') do |value, options|
36
36
  options[:check_dev] = value
@@ -143,7 +143,9 @@ that is a dependency of an existing gem. You can use the
143
143
  deplist = Gem::DependencyList.new
144
144
 
145
145
  get_all_gem_names.uniq.each do |name|
146
- Gem::Specification.find_all_by_name(name).each do |spec|
146
+ gem_specs = Gem::Specification.find_all_by_name(name)
147
+ say("Gem '#{name}' is not installed") if gem_specs.empty?
148
+ gem_specs.each do |spec|
147
149
  deplist.add spec
148
150
  end
149
151
  end
@@ -162,4 +164,3 @@ that is a dependency of an existing gem. You can use the
162
164
  end
163
165
 
164
166
  end
165
-
@@ -2,11 +2,20 @@
2
2
  require 'rubygems/command'
3
3
  require 'rubygems/installer'
4
4
  require 'rubygems/version_option'
5
+ require 'rubygems/security_option'
5
6
  require 'rubygems/remote_fetcher'
6
7
 
8
+ # forward-declare
9
+
10
+ module Gem::Security # :nodoc:
11
+ class Policy # :nodoc:
12
+ end
13
+ end
14
+
7
15
  class Gem::Commands::UnpackCommand < Gem::Command
8
16
 
9
17
  include Gem::VersionOption
18
+ include Gem::SecurityOption
10
19
 
11
20
  def initialize
12
21
  require 'fileutils'
@@ -24,6 +33,7 @@ class Gem::Commands::UnpackCommand < Gem::Command
24
33
  options[:spec] = true
25
34
  end
26
35
 
36
+ add_security_option
27
37
  add_version_option
28
38
  end
29
39
 
@@ -63,6 +73,8 @@ command help for an example.
63
73
  # at the same time.)
64
74
 
65
75
  def execute
76
+ security_policy = options[:security_policy]
77
+
66
78
  get_all_gem_names.each do |name|
67
79
  dependency = Gem::Dependency.new name, options[:version]
68
80
  path = get_path dependency
@@ -73,7 +85,7 @@ command help for an example.
73
85
  end
74
86
 
75
87
  if @options[:spec] then
76
- spec, metadata = get_metadata path
88
+ spec, metadata = get_metadata path, security_policy
77
89
 
78
90
  if metadata.nil? then
79
91
  alert_error "--spec is unsupported on '#{name}' (old format gem)"
@@ -89,7 +101,7 @@ command help for an example.
89
101
  basename = File.basename path, '.gem'
90
102
  target_dir = File.expand_path basename, options[:target]
91
103
 
92
- package = Gem::Package.new path
104
+ package = Gem::Package.new path, security_policy
93
105
  package.extract_files target_dir
94
106
 
95
107
  say "Unpacked gem: '#{target_dir}'"
@@ -158,8 +170,8 @@ command help for an example.
158
170
  #--
159
171
  # TODO move to Gem::Package as #raw_spec or something
160
172
 
161
- def get_metadata path
162
- format = Gem::Package.new path
173
+ def get_metadata path, security_policy = nil
174
+ format = Gem::Package.new path, security_policy
163
175
  spec = format.spec
164
176
 
165
177
  metadata = nil
@@ -70,7 +70,7 @@ command to remove old versions.
70
70
 
71
71
  def check_latest_rubygems version # :nodoc:
72
72
  if Gem.rubygems_version == version then
73
- say "Latest version currently installed. Aborting."
73
+ say "Latest version already installed. Done."
74
74
  terminate_interaction
75
75
  end
76
76
 
@@ -56,7 +56,7 @@ requiring to see why it does not behave as you expect.
56
56
  paths = find_paths arg, dirs
57
57
 
58
58
  if paths.empty? then
59
- alert_error "Can't find ruby library file or shared library #{arg}"
59
+ alert_error "Can't find Ruby library file or shared library #{arg}"
60
60
 
61
61
  found &&= false
62
62
  else
@@ -11,19 +11,11 @@ class Gem::Commands::YankCommand < Gem::Command
11
11
 
12
12
  def description # :nodoc:
13
13
  <<-EOF
14
- The yank command removes a gem you pushed to a server from the server's
15
- index.
16
-
17
- Note that if you push a gem to rubygems.org the yank command does not
18
- prevent other people from downloading the gem via the download link.
14
+ The yank command permanently removes a gem you pushed to a server.
19
15
 
20
16
  Once you have pushed a gem several downloads will happen automatically
21
- via the webhooks. If you accidentally pushed passwords or other sensitive
17
+ via the webhooks. If you accidentally pushed passwords or other sensitive
22
18
  data you will need to change them immediately and yank your gem.
23
-
24
- If you are yanking a gem due to intellectual property reasons contact
25
- http://help.rubygems.org for permanent removal. Be sure to mention this
26
- as the reason for the removal request.
27
19
  EOF
28
20
  end
29
21
 
@@ -42,7 +34,8 @@ as the reason for the removal request.
42
34
  add_platform_option("remove")
43
35
 
44
36
  add_option('--host HOST',
45
- 'Yank from another gemcutter-compatible host') do |value, options|
37
+ 'Yank from another gemcutter-compatible host',
38
+ ' (e.g. https://rubygems.org)') do |value, options|
46
39
  options[:host] = value
47
40
  end
48
41
 
@@ -336,6 +336,15 @@ if you believe they were disclosed to a third party.
336
336
  load_api_keys # reload
337
337
  end
338
338
 
339
+ ##
340
+ # Remove the +~/.gem/credentials+ file to clear all the current sessions.
341
+
342
+ def unset_api_key!
343
+ return false unless File.exist?(credentials_path)
344
+
345
+ File.delete(credentials_path)
346
+ end
347
+
339
348
  def load_file(filename)
340
349
  Gem.load_yaml
341
350
 
@@ -419,31 +428,11 @@ if you believe they were disclosed to a third party.
419
428
  # to_yaml only overwrites things you can't override on the command line.
420
429
  def to_yaml # :nodoc:
421
430
  yaml_hash = {}
422
- yaml_hash[:backtrace] = if @hash.key?(:backtrace)
423
- @hash[:backtrace]
424
- else
425
- DEFAULT_BACKTRACE
426
- end
427
-
428
- yaml_hash[:bulk_threshold] = if @hash.key?(:bulk_threshold)
429
- @hash[:bulk_threshold]
430
- else
431
- DEFAULT_BULK_THRESHOLD
432
- end
433
-
431
+ yaml_hash[:backtrace] = @hash.fetch(:backtrace, DEFAULT_BACKTRACE)
432
+ yaml_hash[:bulk_threshold] = @hash.fetch(:bulk_threshold, DEFAULT_BULK_THRESHOLD)
434
433
  yaml_hash[:sources] = Gem.sources.to_a
435
-
436
- yaml_hash[:update_sources] = if @hash.key?(:update_sources)
437
- @hash[:update_sources]
438
- else
439
- DEFAULT_UPDATE_SOURCES
440
- end
441
-
442
- yaml_hash[:verbose] = if @hash.key?(:verbose)
443
- @hash[:verbose]
444
- else
445
- DEFAULT_VERBOSITY
446
- end
434
+ yaml_hash[:update_sources] = @hash.fetch(:update_sources, DEFAULT_UPDATE_SOURCES)
435
+ yaml_hash[:verbose] = @hash.fetch(:verbose, DEFAULT_VERBOSITY)
447
436
 
448
437
  yaml_hash[:ssl_verify_mode] =
449
438
  @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
@@ -41,10 +41,14 @@ module Kernel
41
41
 
42
42
  path = path.to_path if path.respond_to? :to_path
43
43
 
44
- spec = Gem.find_unresolved_default_spec(path)
45
- if spec
44
+ if spec = Gem.find_unresolved_default_spec(path)
46
45
  Gem.remove_unresolved_default_spec(spec)
47
- Kernel.send(:gem, spec.name)
46
+ begin
47
+ Kernel.send(:gem, spec.name)
48
+ rescue Exception
49
+ RUBYGEMS_ACTIVATION_MONITOR.exit
50
+ raise
51
+ end
48
52
  end
49
53
 
50
54
  # If there are no unresolved deps, then we can use just try
@@ -61,12 +65,10 @@ module Kernel
61
65
  #--
62
66
  # TODO request access to the C implementation of this to speed up RubyGems
63
67
 
64
- spec = Gem::Specification.find_active_stub_by_path path
65
-
66
- begin
68
+ if Gem::Specification.find_active_stub_by_path(path)
67
69
  RUBYGEMS_ACTIVATION_MONITOR.exit
68
70
  return gem_original_require(path)
69
- end if spec
71
+ end
70
72
 
71
73
  # Attempt to find +path+ in any unresolved gems...
72
74
 
@@ -104,7 +106,7 @@ module Kernel
104
106
 
105
107
  # Ok, now find a gem that has no conflicts, starting
106
108
  # at the highest version.
107
- valid = found_specs.reject { |s| s.has_conflicts? }.first
109
+ valid = found_specs.find { |s| !s.has_conflicts? }
108
110
 
109
111
  unless valid then
110
112
  le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"
@@ -138,4 +140,3 @@ module Kernel
138
140
  private :require
139
141
 
140
142
  end
141
-
@@ -280,6 +280,8 @@ class Gem::Dependency
280
280
  requirement.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version)
281
281
  }.map(&:to_spec)
282
282
 
283
+ Gem::BundlerVersionFinder.filter!(matches) if name == "bundler".freeze
284
+
283
285
  if platform_only
284
286
  matches.reject! { |spec|
285
287
  spec.nil? || !Gem::Platform.match(spec.platform)
@@ -7,6 +7,7 @@ require 'rubygems/spec_fetcher'
7
7
  require 'rubygems/user_interaction'
8
8
  require 'rubygems/source'
9
9
  require 'rubygems/available_set'
10
+ require 'rubygems/deprecate'
10
11
 
11
12
  ##
12
13
  # Installs a gem along with all its dependencies from local and remote gems.
@@ -46,6 +47,9 @@ class Gem::DependencyInstaller
46
47
 
47
48
  attr_reader :gems_to_install # :nodoc:
48
49
 
50
+ extend Gem::Deprecate
51
+ deprecate :gems_to_install, :none, 2016, 10
52
+
49
53
  ##
50
54
  # List of gems installed by #install in alphabetic order
51
55
 
@@ -58,6 +58,9 @@ module Gem
58
58
  private
59
59
 
60
60
  def build_message
61
+ if name == "bundler" && message = Gem::BundlerVersionFinder.missing_version_message
62
+ return message
63
+ end
61
64
  names = specs.map(&:full_name)
62
65
  "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n"
63
66
  end
@@ -154,6 +154,12 @@ class Gem::ImpossibleDependenciesError < Gem::Exception
154
154
  end
155
155
 
156
156
  class Gem::InstallError < Gem::Exception; end
157
+ class Gem::RuntimeRequirementNotMetError < Gem::InstallError
158
+ attr_accessor :suggestion
159
+ def message
160
+ [suggestion, super].compact.join("\n\t")
161
+ end
162
+ end
157
163
 
158
164
  ##
159
165
  # Potentially raised when a specification is validated.
@@ -183,7 +183,7 @@ EOF
183
183
  return if @spec.extensions.empty?
184
184
 
185
185
  if @build_args.empty?
186
- say "Building native extensions. This could take a while..."
186
+ say "Building native extensions. This could take a while..."
187
187
  else
188
188
  say "Building native extensions with: '#{@build_args.join ' '}'"
189
189
  say "This could take a while..."
@@ -27,9 +27,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
27
27
  # TODO: Make this unconditional when rubygems no longer supports Ruby 1.9.x.
28
28
  tmp_dest = get_relative_path(tmp_dest) unless Gem.win_platform? && RUBY_VERSION <= '2.0'
29
29
 
30
- t = nil
31
30
  Tempfile.open %w"siteconf .rb", "." do |siteconf|
32
- t = siteconf
33
31
  siteconf.puts "require 'rbconfig'"
34
32
  siteconf.puts "dest_path = #{tmp_dest.dump}"
35
33
  %w[sitearchdir sitelibdir].each do |dir|
@@ -37,7 +35,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
37
35
  siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
38
36
  end
39
37
 
40
- siteconf.flush
38
+ siteconf.close
41
39
 
42
40
  destdir = ENV["DESTDIR"]
43
41
 
@@ -78,9 +76,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
78
76
  end
79
77
  ensure
80
78
  ENV["DESTDIR"] = destdir
79
+ siteconf.close!
81
80
  end
82
81
  end
83
- t.unlink if t and t.path
84
82
 
85
83
  results
86
84
  ensure
@@ -20,7 +20,7 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
20
20
  rake = ENV['rake']
21
21
 
22
22
  rake ||= begin
23
- "#{Gem.ruby} -rubygems #{Gem.bin_path('rake', 'rake')}"
23
+ "#{Gem.ruby} -rrubygems #{Gem.bin_path('rake', 'rake')}"
24
24
  rescue Gem::Exception
25
25
  end
26
26
 
@@ -8,6 +8,7 @@
8
8
  require 'rubygems'
9
9
  require 'rubygems/command_manager'
10
10
  require 'rubygems/config_file'
11
+ require 'rubygems/deprecate'
11
12
 
12
13
  ##
13
14
  # Load additional plugins from $LOAD_PATH
@@ -26,7 +27,10 @@ Gem.load_env_plugins rescue nil
26
27
  class Gem::GemRunner
27
28
 
28
29
  def initialize(options={})
29
- # TODO: nuke these options
30
+ if !options.empty? && !Gem::Deprecate.skip
31
+ Kernel.warn "NOTE: passing options to Gem::GemRunner.new is deprecated with no replacement. It will be removed on or after 2016-10-01."
32
+ end
33
+
30
34
  @command_manager_class = options[:command_manager] || Gem::CommandManager
31
35
  @config_file_class = options[:config_file] || Gem::ConfigFile
32
36
  end
@@ -6,37 +6,18 @@
6
6
  #++
7
7
 
8
8
  require 'rubygems'
9
-
10
- # forward-declare
11
-
12
- module Gem::Security # :nodoc:
13
- class Policy # :nodoc:
14
- end
15
- end
9
+ require 'rubygems/security_option'
16
10
 
17
11
  ##
18
12
  # Mixin methods for install and update options for Gem::Commands
19
13
 
20
14
  module Gem::InstallUpdateOptions
15
+ include Gem::SecurityOption
21
16
 
22
17
  ##
23
18
  # Add the install/update options to the option parser.
24
19
 
25
20
  def add_install_update_options
26
- # TODO: use @parser.accept
27
- OptionParser.accept Gem::Security::Policy do |value|
28
- require 'rubygems/security'
29
-
30
- raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless
31
- defined?(Gem::Security::HighSecurity)
32
-
33
- value = Gem::Security::Policies[value]
34
- valid = Gem::Security::Policies.keys.sort
35
- message = "#{value} (#{valid.join ', '} are valid)"
36
- raise OptionParser::InvalidArgument, message if value.nil?
37
- value
38
- end
39
-
40
21
  add_option(:"Install/Update", '-i', '--install-dir DIR',
41
22
  'Gem repository directory to get installed',
42
23
  'gems') do |value, options|
@@ -124,11 +105,7 @@ module Gem::InstallUpdateOptions
124
105
  options[:wrappers] = value
125
106
  end
126
107
 
127
- add_option(:"Install/Update", '-P', '--trust-policy POLICY',
128
- Gem::Security::Policy,
129
- 'Specify gem trust policy') do |value, options|
130
- options[:security_policy] = value
131
- end
108
+ add_security_option
132
109
 
133
110
  add_option(:"Install/Update", '--ignore-dependencies',
134
111
  'Do not install any required dependent gems') do |value, options|
@@ -136,8 +113,8 @@ module Gem::InstallUpdateOptions
136
113
  end
137
114
 
138
115
  add_option(:"Install/Update", '--[no-]format-executable',
139
- 'Make installed executable names match ruby.',
140
- 'If ruby is ruby18, foo_exec will be',
116
+ 'Make installed executable names match Ruby.',
117
+ 'If Ruby is ruby18, foo_exec will be',
141
118
  'foo_exec18') do |value, options|
142
119
  options[:format_executable] = value
143
120
  end