rubygems-update 2.7.11 → 3.0.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 (350) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +66 -0
  3. data/.travis.yml +22 -18
  4. data/CONTRIBUTING.md +141 -0
  5. data/History.txt +289 -19
  6. data/MAINTAINERS.txt +1 -0
  7. data/Manifest.txt +16 -11
  8. data/POLICIES.md +92 -0
  9. data/README.md +47 -26
  10. data/Rakefile +47 -207
  11. data/{UPGRADING.rdoc → UPGRADING.md} +31 -32
  12. data/appveyor.yml +20 -45
  13. data/bin/gem +1 -2
  14. data/bin/update_rubygems +2 -3
  15. data/bundler/CHANGELOG.md +54 -0
  16. data/bundler/bundler.gemspec +7 -1
  17. data/bundler/lib/bundler.rb +26 -8
  18. data/bundler/lib/bundler/build_metadata.rb +2 -2
  19. data/bundler/lib/bundler/cli.rb +63 -21
  20. data/bundler/lib/bundler/cli/add.rb +15 -5
  21. data/bundler/lib/bundler/cli/binstubs.rb +8 -2
  22. data/bundler/lib/bundler/cli/doctor.rb +47 -1
  23. data/bundler/lib/bundler/cli/install.rb +8 -5
  24. data/bundler/lib/bundler/cli/list.rb +41 -5
  25. data/bundler/lib/bundler/cli/outdated.rb +7 -1
  26. data/bundler/lib/bundler/cli/pristine.rb +4 -0
  27. data/bundler/lib/bundler/cli/remove.rb +18 -0
  28. data/bundler/lib/bundler/definition.rb +15 -16
  29. data/bundler/lib/bundler/dependency.rb +2 -2
  30. data/bundler/lib/bundler/dsl.rb +19 -3
  31. data/bundler/lib/bundler/feature_flag.rb +7 -0
  32. data/bundler/lib/bundler/gem_version_promoter.rb +4 -2
  33. data/bundler/lib/bundler/injector.rb +168 -9
  34. data/bundler/lib/bundler/installer.rb +29 -6
  35. data/bundler/lib/bundler/installer/parallel_installer.rb +5 -0
  36. data/bundler/lib/bundler/plugin.rb +10 -3
  37. data/bundler/lib/bundler/plugin/events.rb +61 -0
  38. data/bundler/lib/bundler/resolver.rb +2 -2
  39. data/bundler/lib/bundler/runtime.rb +8 -2
  40. data/bundler/lib/bundler/settings.rb +24 -3
  41. data/bundler/lib/bundler/settings/validator.rb +23 -0
  42. data/bundler/lib/bundler/shared_helpers.rb +19 -3
  43. data/bundler/lib/bundler/source.rb +9 -9
  44. data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
  45. data/bundler/lib/bundler/version.rb +1 -1
  46. data/bundler/man/bundle-add.ronn +13 -2
  47. data/bundler/man/bundle-config.ronn +21 -0
  48. data/bundler/man/bundle-install.ronn +1 -1
  49. data/bundler/man/bundle-list.ronn +19 -1
  50. data/bundler/man/bundle-outdated.ronn +4 -0
  51. data/bundler/man/bundle-remove.ronn +23 -0
  52. data/bundler/man/bundle-update.ronn +1 -1
  53. data/lib/rubygems.rb +70 -96
  54. data/lib/rubygems/available_set.rb +1 -1
  55. data/lib/rubygems/basic_specification.rb +12 -12
  56. data/lib/rubygems/bundler_version_finder.rb +3 -3
  57. data/lib/rubygems/command.rb +22 -15
  58. data/lib/rubygems/command_manager.rb +20 -11
  59. data/lib/rubygems/commands/build_command.rb +27 -8
  60. data/lib/rubygems/commands/cert_command.rb +45 -24
  61. data/lib/rubygems/commands/check_command.rb +1 -1
  62. data/lib/rubygems/commands/cleanup_command.rb +14 -7
  63. data/lib/rubygems/commands/contents_command.rb +14 -15
  64. data/lib/rubygems/commands/dependency_command.rb +17 -17
  65. data/lib/rubygems/commands/environment_command.rb +20 -1
  66. data/lib/rubygems/commands/fetch_command.rb +2 -3
  67. data/lib/rubygems/commands/generate_index_command.rb +2 -3
  68. data/lib/rubygems/commands/help_command.rb +12 -13
  69. data/lib/rubygems/commands/info_command.rb +33 -0
  70. data/lib/rubygems/commands/install_command.rb +21 -17
  71. data/lib/rubygems/commands/list_command.rb +0 -1
  72. data/lib/rubygems/commands/lock_command.rb +3 -4
  73. data/lib/rubygems/commands/open_command.rb +16 -10
  74. data/lib/rubygems/commands/owner_command.rb +20 -11
  75. data/lib/rubygems/commands/pristine_command.rb +23 -16
  76. data/lib/rubygems/commands/push_command.rb +17 -8
  77. data/lib/rubygems/commands/query_command.rb +24 -24
  78. data/lib/rubygems/commands/rdoc_command.rb +3 -4
  79. data/lib/rubygems/commands/search_command.rb +0 -1
  80. data/lib/rubygems/commands/server_command.rb +1 -2
  81. data/lib/rubygems/commands/setup_command.rb +78 -38
  82. data/lib/rubygems/commands/signin_command.rb +2 -1
  83. data/lib/rubygems/commands/signout_command.rb +2 -2
  84. data/lib/rubygems/commands/sources_command.rb +11 -12
  85. data/lib/rubygems/commands/specification_command.rb +7 -7
  86. data/lib/rubygems/commands/uninstall_command.rb +41 -19
  87. data/lib/rubygems/commands/unpack_command.rb +16 -7
  88. data/lib/rubygems/commands/update_command.rb +28 -23
  89. data/lib/rubygems/commands/which_command.rb +4 -5
  90. data/lib/rubygems/commands/yank_command.rb +1 -2
  91. data/lib/rubygems/compatibility.rb +1 -21
  92. data/lib/rubygems/config_file.rb +36 -36
  93. data/lib/rubygems/core_ext/kernel_require.rb +6 -6
  94. data/lib/rubygems/core_ext/kernel_warn.rb +45 -0
  95. data/lib/rubygems/defaults.rb +31 -12
  96. data/lib/rubygems/dependency.rb +14 -14
  97. data/lib/rubygems/dependency_installer.rb +29 -31
  98. data/lib/rubygems/dependency_list.rb +8 -9
  99. data/lib/rubygems/deprecate.rb +2 -3
  100. data/lib/rubygems/doctor.rb +5 -6
  101. data/lib/rubygems/errors.rb +3 -3
  102. data/lib/rubygems/exceptions.rb +11 -4
  103. data/lib/rubygems/ext.rb +0 -1
  104. data/lib/rubygems/ext/build_error.rb +0 -1
  105. data/lib/rubygems/ext/builder.rb +50 -23
  106. data/lib/rubygems/ext/cmake_builder.rb +2 -2
  107. data/lib/rubygems/ext/configure_builder.rb +2 -3
  108. data/lib/rubygems/ext/ext_conf_builder.rb +8 -7
  109. data/lib/rubygems/ext/rake_builder.rb +16 -18
  110. data/lib/rubygems/gem_runner.rb +2 -2
  111. data/lib/rubygems/gemcutter_utilities.rb +40 -13
  112. data/lib/rubygems/indexer.rb +19 -12
  113. data/lib/rubygems/install_default_message.rb +0 -1
  114. data/lib/rubygems/install_message.rb +0 -1
  115. data/lib/rubygems/install_update_options.rb +2 -28
  116. data/lib/rubygems/installer.rb +95 -75
  117. data/lib/rubygems/installer_test_case.rb +0 -14
  118. data/lib/rubygems/local_remote_options.rb +5 -4
  119. data/lib/rubygems/mock_gem_ui.rb +3 -4
  120. data/lib/rubygems/name_tuple.rb +4 -4
  121. data/lib/rubygems/package.rb +90 -73
  122. data/lib/rubygems/package/digest_io.rb +3 -4
  123. data/lib/rubygems/package/file_source.rb +3 -4
  124. data/lib/rubygems/package/io_source.rb +1 -2
  125. data/lib/rubygems/package/old.rb +8 -16
  126. data/lib/rubygems/package/source.rb +0 -1
  127. data/lib/rubygems/package/tar_header.rb +2 -2
  128. data/lib/rubygems/package/tar_reader.rb +2 -4
  129. data/lib/rubygems/package/tar_reader/entry.rb +20 -4
  130. data/lib/rubygems/package/tar_test_case.rb +2 -8
  131. data/lib/rubygems/package/tar_writer.rb +13 -15
  132. data/lib/rubygems/package_task.rb +0 -1
  133. data/lib/rubygems/path_support.rb +16 -6
  134. data/lib/rubygems/platform.rb +4 -5
  135. data/lib/rubygems/psych_tree.rb +1 -1
  136. data/lib/rubygems/rdoc.rb +0 -311
  137. data/lib/rubygems/remote_fetcher.rb +34 -48
  138. data/lib/rubygems/request.rb +16 -15
  139. data/lib/rubygems/request/connection_pools.rb +24 -13
  140. data/lib/rubygems/request/http_pool.rb +3 -4
  141. data/lib/rubygems/request/https_pool.rb +1 -3
  142. data/lib/rubygems/request_set.rb +52 -25
  143. data/lib/rubygems/request_set/gem_dependency_api.rb +36 -40
  144. data/lib/rubygems/request_set/lockfile.rb +12 -12
  145. data/lib/rubygems/request_set/lockfile/parser.rb +18 -29
  146. data/lib/rubygems/request_set/lockfile/tokenizer.rb +9 -9
  147. data/lib/rubygems/requirement.rb +16 -16
  148. data/lib/rubygems/resolver.rb +10 -15
  149. data/lib/rubygems/resolver/activation_request.rb +6 -6
  150. data/lib/rubygems/resolver/api_set.rb +5 -6
  151. data/lib/rubygems/resolver/api_specification.rb +2 -3
  152. data/lib/rubygems/resolver/best_set.rb +5 -6
  153. data/lib/rubygems/resolver/composed_set.rb +5 -6
  154. data/lib/rubygems/resolver/conflict.rb +5 -5
  155. data/lib/rubygems/resolver/current_set.rb +1 -2
  156. data/lib/rubygems/resolver/dependency_request.rb +4 -4
  157. data/lib/rubygems/resolver/git_set.rb +5 -6
  158. data/lib/rubygems/resolver/git_specification.rb +4 -5
  159. data/lib/rubygems/resolver/index_set.rb +5 -6
  160. data/lib/rubygems/resolver/index_specification.rb +3 -4
  161. data/lib/rubygems/resolver/installed_specification.rb +3 -4
  162. data/lib/rubygems/resolver/installer_set.rb +12 -12
  163. data/lib/rubygems/resolver/local_specification.rb +1 -2
  164. data/lib/rubygems/resolver/lock_set.rb +5 -6
  165. data/lib/rubygems/resolver/lock_specification.rb +7 -8
  166. data/lib/rubygems/resolver/requirement_list.rb +1 -1
  167. data/lib/rubygems/resolver/set.rb +2 -2
  168. data/lib/rubygems/resolver/source_set.rb +4 -5
  169. data/lib/rubygems/resolver/spec_specification.rb +1 -2
  170. data/lib/rubygems/resolver/specification.rb +10 -7
  171. data/lib/rubygems/resolver/stats.rb +1 -1
  172. data/lib/rubygems/resolver/vendor_set.rb +4 -5
  173. data/lib/rubygems/resolver/vendor_specification.rb +2 -3
  174. data/lib/rubygems/safe_yaml.rb +18 -10
  175. data/lib/rubygems/security.rb +21 -22
  176. data/lib/rubygems/security/policies.rb +1 -2
  177. data/lib/rubygems/security/policy.rb +25 -25
  178. data/lib/rubygems/security/signer.rb +72 -24
  179. data/lib/rubygems/security/trust_dir.rb +10 -10
  180. data/lib/rubygems/server.rb +21 -21
  181. data/lib/rubygems/source.rb +16 -25
  182. data/lib/rubygems/source/git.rb +9 -10
  183. data/lib/rubygems/source/installed.rb +3 -4
  184. data/lib/rubygems/source/local.rb +7 -7
  185. data/lib/rubygems/source/lock.rb +4 -4
  186. data/lib/rubygems/source/specific_file.rb +5 -5
  187. data/lib/rubygems/source/vendor.rb +2 -3
  188. data/lib/rubygems/source_list.rb +2 -2
  189. data/lib/rubygems/source_local.rb +0 -1
  190. data/lib/rubygems/spec_fetcher.rb +5 -6
  191. data/lib/rubygems/specification.rb +199 -536
  192. data/lib/rubygems/specification_policy.rb +407 -0
  193. data/lib/rubygems/ssl_certs/{rubygems.org → index.rubygems.org}/GlobalSignRootCA.pem +0 -0
  194. data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
  195. data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
  196. data/lib/rubygems/stub_specification.rb +11 -15
  197. data/lib/rubygems/test_case.rb +141 -66
  198. data/lib/rubygems/test_utilities.rb +20 -35
  199. data/lib/rubygems/text.rb +6 -6
  200. data/lib/rubygems/uninstaller.rb +37 -26
  201. data/lib/rubygems/uri_formatter.rb +1 -2
  202. data/lib/rubygems/user_interaction.rb +38 -93
  203. data/lib/rubygems/util.rb +20 -14
  204. data/lib/rubygems/util/licenses.rb +27 -1
  205. data/lib/rubygems/util/list.rb +1 -1
  206. data/lib/rubygems/validator.rb +4 -5
  207. data/lib/rubygems/version.rb +15 -15
  208. data/lib/rubygems/version_option.rb +2 -3
  209. data/rubygems-update.gemspec +43 -0
  210. data/setup.rb +2 -8
  211. data/test/rubygems/rubygems_plugin.rb +0 -1
  212. data/test/rubygems/simple_gem.rb +1 -1
  213. data/test/rubygems/test_bundled_ca.rb +4 -7
  214. data/test/rubygems/test_config.rb +7 -2
  215. data/test/rubygems/test_gem.rb +161 -130
  216. data/test/rubygems/test_gem_command.rb +0 -1
  217. data/test/rubygems/test_gem_command_manager.rb +8 -3
  218. data/test/rubygems/test_gem_commands_build_command.rb +219 -15
  219. data/test/rubygems/test_gem_commands_cert_command.rb +69 -8
  220. data/test/rubygems/test_gem_commands_check_command.rb +1 -1
  221. data/test/rubygems/test_gem_commands_cleanup_command.rb +27 -1
  222. data/test/rubygems/test_gem_commands_contents_command.rb +1 -2
  223. data/test/rubygems/test_gem_commands_dependency_command.rb +33 -34
  224. data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
  225. data/test/rubygems/test_gem_commands_fetch_command.rb +0 -1
  226. data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -1
  227. data/test/rubygems/test_gem_commands_help_command.rb +7 -4
  228. data/test/rubygems/test_gem_commands_info_command.rb +44 -0
  229. data/test/rubygems/test_gem_commands_install_command.rb +79 -12
  230. data/test/rubygems/test_gem_commands_lock_command.rb +0 -1
  231. data/test/rubygems/test_gem_commands_open_command.rb +29 -0
  232. data/test/rubygems/test_gem_commands_outdated_command.rb +0 -1
  233. data/test/rubygems/test_gem_commands_owner_command.rb +93 -57
  234. data/test/rubygems/test_gem_commands_pristine_command.rb +65 -30
  235. data/test/rubygems/test_gem_commands_push_command.rb +39 -0
  236. data/test/rubygems/test_gem_commands_query_command.rb +102 -100
  237. data/test/rubygems/test_gem_commands_search_command.rb +0 -1
  238. data/test/rubygems/test_gem_commands_server_command.rb +0 -1
  239. data/test/rubygems/test_gem_commands_setup_command.rb +39 -8
  240. data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
  241. data/test/rubygems/test_gem_commands_sources_command.rb +0 -1
  242. data/test/rubygems/test_gem_commands_specification_command.rb +2 -3
  243. data/test/rubygems/test_gem_commands_stale_command.rb +3 -2
  244. data/test/rubygems/test_gem_commands_uninstall_command.rb +81 -7
  245. data/test/rubygems/test_gem_commands_unpack_command.rb +17 -1
  246. data/test/rubygems/test_gem_commands_update_command.rb +19 -2
  247. data/test/rubygems/test_gem_commands_which_command.rb +0 -1
  248. data/test/rubygems/test_gem_commands_yank_command.rb +0 -1
  249. data/test/rubygems/test_gem_config_file.rb +4 -2
  250. data/test/rubygems/test_gem_dependency.rb +0 -1
  251. data/test/rubygems/test_gem_dependency_installer.rb +8 -5
  252. data/test/rubygems/test_gem_dependency_list.rb +6 -7
  253. data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -1
  254. data/test/rubygems/test_gem_doctor.rb +1 -2
  255. data/test/rubygems/test_gem_ext_builder.rb +10 -23
  256. data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -4
  257. data/test/rubygems/test_gem_ext_configure_builder.rb +3 -3
  258. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +8 -9
  259. data/test/rubygems/test_gem_ext_rake_builder.rb +20 -5
  260. data/test/rubygems/test_gem_gem_runner.rb +0 -1
  261. data/test/rubygems/test_gem_gemcutter_utilities.rb +32 -6
  262. data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -1
  263. data/test/rubygems/test_gem_indexer.rb +1 -2
  264. data/test/rubygems/test_gem_install_update_options.rb +1 -20
  265. data/test/rubygems/test_gem_installer.rb +69 -203
  266. data/test/rubygems/test_gem_local_remote_options.rb +3 -3
  267. data/test/rubygems/test_gem_name_tuple.rb +0 -1
  268. data/test/rubygems/test_gem_package.rb +59 -50
  269. data/test/rubygems/test_gem_package_old.rb +0 -1
  270. data/test/rubygems/test_gem_package_tar_header.rb +1 -2
  271. data/test/rubygems/test_gem_package_tar_reader.rb +0 -1
  272. data/test/rubygems/test_gem_package_tar_reader_entry.rb +11 -0
  273. data/test/rubygems/test_gem_package_tar_writer.rb +40 -7
  274. data/test/rubygems/test_gem_package_task.rb +2 -2
  275. data/test/rubygems/test_gem_path_support.rb +28 -11
  276. data/test/rubygems/test_gem_platform.rb +4 -5
  277. data/test/rubygems/test_gem_rdoc.rb +1 -2
  278. data/test/rubygems/test_gem_remote_fetcher.rb +111 -130
  279. data/test/rubygems/test_gem_request.rb +5 -5
  280. data/test/rubygems/test_gem_request_connection_pools.rb +24 -3
  281. data/test/rubygems/test_gem_request_set.rb +5 -5
  282. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +2 -7
  283. data/test/rubygems/test_gem_request_set_lockfile.rb +1 -2
  284. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +4 -9
  285. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
  286. data/test/rubygems/test_gem_requirement.rb +18 -4
  287. data/test/rubygems/test_gem_resolver.rb +13 -17
  288. data/test/rubygems/test_gem_resolver_activation_request.rb +0 -1
  289. data/test/rubygems/test_gem_resolver_api_set.rb +0 -1
  290. data/test/rubygems/test_gem_resolver_api_specification.rb +0 -1
  291. data/test/rubygems/test_gem_resolver_best_set.rb +0 -1
  292. data/test/rubygems/test_gem_resolver_composed_set.rb +0 -1
  293. data/test/rubygems/test_gem_resolver_conflict.rb +0 -1
  294. data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -1
  295. data/test/rubygems/test_gem_resolver_git_set.rb +0 -1
  296. data/test/rubygems/test_gem_resolver_git_specification.rb +0 -1
  297. data/test/rubygems/test_gem_resolver_index_set.rb +0 -1
  298. data/test/rubygems/test_gem_resolver_index_specification.rb +0 -1
  299. data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -1
  300. data/test/rubygems/test_gem_resolver_installer_set.rb +2 -3
  301. data/test/rubygems/test_gem_resolver_local_specification.rb +0 -1
  302. data/test/rubygems/test_gem_resolver_lock_set.rb +0 -1
  303. data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -1
  304. data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -1
  305. data/test/rubygems/test_gem_resolver_specification.rb +1 -2
  306. data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -1
  307. data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -1
  308. data/test/rubygems/test_gem_security.rb +1 -3
  309. data/test/rubygems/test_gem_security_policy.rb +4 -5
  310. data/test/rubygems/test_gem_security_signer.rb +4 -3
  311. data/test/rubygems/test_gem_security_trust_dir.rb +1 -2
  312. data/test/rubygems/test_gem_server.rb +4 -4
  313. data/test/rubygems/test_gem_source.rb +0 -13
  314. data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
  315. data/test/rubygems/test_gem_source_git.rb +0 -1
  316. data/test/rubygems/test_gem_source_installed.rb +0 -1
  317. data/test/rubygems/test_gem_source_lock.rb +0 -1
  318. data/test/rubygems/test_gem_source_vendor.rb +0 -1
  319. data/test/rubygems/test_gem_spec_fetcher.rb +0 -1
  320. data/test/rubygems/test_gem_specification.rb +334 -198
  321. data/test/rubygems/test_gem_stream_ui.rb +13 -30
  322. data/test/rubygems/test_gem_stub_specification.rb +0 -2
  323. data/test/rubygems/test_gem_text.rb +4 -5
  324. data/test/rubygems/test_gem_uninstaller.rb +21 -1
  325. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -1
  326. data/test/rubygems/test_gem_uri_formatter.rb +0 -1
  327. data/test/rubygems/test_gem_util.rb +6 -11
  328. data/test/rubygems/test_gem_validator.rb +0 -1
  329. data/test/rubygems/test_gem_version.rb +11 -11
  330. data/test/rubygems/test_gem_version_option.rb +0 -1
  331. data/test/rubygems/test_remote_fetch_error.rb +0 -1
  332. data/test/rubygems/test_require.rb +67 -52
  333. data/util/CL2notes +1 -2
  334. data/util/ci +15 -12
  335. data/util/create_certs.rb +6 -7
  336. data/util/create_encrypted_key.rb +0 -1
  337. data/util/patch_with_prs.rb +1 -1
  338. data/util/rubocop +8 -0
  339. data/util/update_bundled_ca_certificates.rb +15 -14
  340. data/util/update_changelog.rb +1 -1
  341. metadata +67 -59
  342. data/.autotest +0 -71
  343. data/.document +0 -5
  344. data/CONTRIBUTING.rdoc +0 -130
  345. data/CVE-2013-4287.txt +0 -35
  346. data/CVE-2013-4363.txt +0 -45
  347. data/CVE-2015-3900.txt +0 -40
  348. data/POLICIES.rdoc +0 -74
  349. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +0 -21
  350. data/test/rubygems/fix_openssl_warnings.rb +0 -13
@@ -14,6 +14,7 @@ module Bundler
14
14
  allow_offline_install
15
15
  auto_clean_without_path
16
16
  auto_install
17
+ auto_config_jobs
17
18
  cache_all
18
19
  cache_all_platforms
19
20
  cache_command_is_package
@@ -25,6 +26,7 @@ module Bundler
25
26
  disable_exec_load
26
27
  disable_local_branch_check
27
28
  disable_multisource
29
+ disable_platform_warnings
28
30
  disable_shared_gems
29
31
  disable_version_check
30
32
  error_on_stderr
@@ -33,6 +35,7 @@ module Bundler
33
35
  frozen
34
36
  gem.coc
35
37
  gem.mit
38
+ global_path_appends_ruby_scope
36
39
  global_gem_cache
37
40
  ignore_messages
38
41
  init_gems_rb
@@ -42,6 +45,7 @@ module Bundler
42
45
  no_install
43
46
  no_prune
44
47
  only_update_to_newer_versions
48
+ path_relative_to_cwd
45
49
  path.system
46
50
  plugins
47
51
  prefer_gems_rb
@@ -53,9 +57,12 @@ module Bundler
53
57
  suppress_install_using_messages
54
58
  unlock_source_unlocks_spec
55
59
  update_requires_all_flag
60
+ use_gem_version_promoter_for_major_updates
61
+ viz_command
56
62
  ].freeze
57
63
 
58
64
  NUMBER_KEYS = %w[
65
+ jobs
59
66
  redirect
60
67
  retry
61
68
  ssl_verify_mode
@@ -213,13 +220,13 @@ module Bundler
213
220
  locations
214
221
  end
215
222
 
216
- # for legacy reasons, the ruby scope isnt appended when the setting comes from ENV or the global config,
223
+ # for legacy reasons, in Bundler 1, the ruby scope isnt appended when the setting comes from ENV or the global config,
217
224
  # nor do we respect :disable_shared_gems
218
225
  def path
219
226
  key = key_for(:path)
220
227
  path = ENV[key] || @global_config[key]
221
228
  if path && !@temporary.key?(key) && !@local_config.key?(key)
222
- return Path.new(path, false, false, false)
229
+ return Path.new(path, Bundler.feature_flag.global_path_appends_ruby_scope?, false, false)
223
230
  end
224
231
 
225
232
  system_path = self["path.system"] || (self[:disable_shared_gems] == false)
@@ -246,6 +253,20 @@ module Bundler
246
253
  path
247
254
  end
248
255
 
256
+ def base_path_relative_to_pwd
257
+ base_path = Pathname.new(self.base_path)
258
+ expanded_base_path = base_path.expand_path(Bundler.root)
259
+ relative_path = expanded_base_path.relative_path_from(Pathname.pwd)
260
+ if relative_path.to_s.start_with?("..")
261
+ relative_path = base_path if base_path.absolute?
262
+ else
263
+ relative_path = Pathname.new(File.join(".", relative_path))
264
+ end
265
+ relative_path
266
+ rescue ArgumentError
267
+ expanded_base_path
268
+ end
269
+
249
270
  def validate!
250
271
  return unless explicit_path && system_path
251
272
  path = Bundler.settings.pretty_values_for(:path)
@@ -374,7 +395,7 @@ module Bundler
374
395
  Pathname.new(ENV["BUNDLE_CONFIG"])
375
396
  else
376
397
  begin
377
- Bundler.user_bundle_path.join("config")
398
+ Bundler.user_bundle_path("config")
378
399
  rescue PermissionError, GenericSystemCallError
379
400
  nil
380
401
  end
@@ -74,6 +74,29 @@ module Bundler
74
74
  fail!(key, value, "`#{other_key}` is current set to #{other_setting.inspect}", "the `#{conflicting.join("`, `")}` groups conflict")
75
75
  end
76
76
  end
77
+
78
+ rule %w[path], "relative paths are expanded relative to the current working directory" do |key, value, settings|
79
+ next if value.nil?
80
+
81
+ path = Pathname.new(value)
82
+ next if !path.relative? || !Bundler.feature_flag.path_relative_to_cwd?
83
+
84
+ path = path.expand_path
85
+
86
+ root = begin
87
+ Bundler.root
88
+ rescue GemfileNotFound
89
+ Pathname.pwd.expand_path
90
+ end
91
+
92
+ path = begin
93
+ path.relative_path_from(root)
94
+ rescue ArgumentError
95
+ path
96
+ end
97
+
98
+ set(settings, key, path.to_s)
99
+ end
77
100
  end
78
101
  end
79
102
  end
@@ -197,10 +197,12 @@ module Bundler
197
197
  def pretty_dependency(dep, print_source = false)
198
198
  msg = String.new(dep.name)
199
199
  msg << " (#{dep.requirement})" unless dep.requirement == Gem::Requirement.default
200
+
200
201
  if dep.is_a?(Bundler::Dependency)
201
202
  platform_string = dep.platforms.join(", ")
202
203
  msg << " " << platform_string if !platform_string.empty? && platform_string != Gem::Platform::RUBY
203
204
  end
205
+
204
206
  msg << " from the `#{dep.source}` source" if print_source && dep.source
205
207
  msg
206
208
  end
@@ -223,6 +225,10 @@ module Bundler
223
225
  Digest(name)
224
226
  end
225
227
 
228
+ def write_to_gemfile(gemfile_path, contents)
229
+ filesystem_access(gemfile_path) {|g| File.open(g, "w") {|file| file.puts contents } }
230
+ end
231
+
226
232
  private
227
233
 
228
234
  def validate_bundle_path
@@ -268,7 +274,15 @@ module Bundler
268
274
  until !File.directory?(current) || current == previous
269
275
  if ENV["BUNDLE_SPEC_RUN"]
270
276
  # avoid stepping above the tmp directory when testing
271
- return nil if File.file?(File.join(current, "bundler.gemspec"))
277
+ gemspec = if ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]
278
+ # for Ruby Core
279
+ "lib/bundler.gemspec"
280
+ else
281
+ "bundler.gemspec"
282
+ end
283
+
284
+ # avoid stepping above the tmp directory when testing
285
+ return nil if File.file?(File.join(current, gemspec))
272
286
  end
273
287
 
274
288
  names.each do |name|
@@ -297,10 +311,12 @@ module Bundler
297
311
  unless File.exist?(exe_file)
298
312
  exe_file = File.expand_path("../../../exe/bundle", __FILE__)
299
313
  end
300
-
301
314
  Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
302
315
  rescue Gem::GemNotFoundException
303
- Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", File.expand_path("../../../exe/bundle", __FILE__)
316
+ exe_file = File.expand_path("../../../exe/bundle", __FILE__)
317
+ # for Ruby core repository
318
+ exe_file = File.expand_path("../../../../bin/bundle", __FILE__) unless File.exist?(exe_file)
319
+ Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
304
320
  end
305
321
 
306
322
  # Set BUNDLE_GEMFILE
@@ -54,6 +54,15 @@ module Bundler
54
54
  instance_of?(Bundler::Source::Path)
55
55
  end
56
56
 
57
+ def extension_cache_path(spec)
58
+ return unless Bundler.feature_flag.global_gem_cache?
59
+ return unless source_slug = extension_cache_slug(spec)
60
+ Bundler.user_cache.join(
61
+ "extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,
62
+ source_slug, spec.full_name
63
+ )
64
+ end
65
+
57
66
  private
58
67
 
59
68
  def version_color(spec_version, locked_spec_version)
@@ -78,15 +87,6 @@ module Bundler
78
87
  end
79
88
  end
80
89
 
81
- def extension_cache_path(spec)
82
- return unless Bundler.feature_flag.global_gem_cache?
83
- return unless source_slug = extension_cache_slug(spec)
84
- Bundler.user_cache.join(
85
- "extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,
86
- source_slug, spec.full_name
87
- )
88
- end
89
-
90
90
  def extension_cache_slug(_)
91
91
  nil
92
92
  end
@@ -6,6 +6,7 @@ require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>"
6
6
  <%- config[:constant_array].each_with_index do |c, i| -%>
7
7
  <%= " " * i %>module <%= c %>
8
8
  <%- end -%>
9
+ <%= " " * config[:constant_array].size %>class Error < StandardError; end
9
10
  <%= " " * config[:constant_array].size %># Your code goes here...
10
11
  <%- (config[:constant_array].size-1).downto(0) do |i| -%>
11
12
  <%= " " * i %>end
@@ -7,7 +7,7 @@ module Bundler
7
7
  # We're doing this because we might write tests that deal
8
8
  # with other versions of bundler and we are unsure how to
9
9
  # handle this better.
10
- VERSION = "1.16.6" unless defined?(::Bundler::VERSION)
10
+ VERSION = "1.17.2" unless defined?(::Bundler::VERSION)
11
11
 
12
12
  def self.overwrite_loaded_gem_version
13
13
  begin
@@ -3,10 +3,10 @@ bundle-add(1) -- Add gem to the Gemfile and run bundle install
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE]
6
+ `bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE] [--skip-install] [--strict] [--optimistic]
7
7
 
8
8
  ## DESCRIPTION
9
- Adds the named gem to the Gemfile and run `bundle install`.
9
+ Adds the named gem to the Gemfile and run `bundle install`. `bundle install` can be avoided by using the flag `--skip-install`.
10
10
 
11
11
  Example:
12
12
 
@@ -16,6 +16,8 @@ bundle add rails --version "< 3.0, > 1.1"
16
16
 
17
17
  bundle add rails --version "~> 5.0.0" --source "https://gems.example.com" --group "development"
18
18
 
19
+ bundle add rails --skip-install
20
+
19
21
  bundle add rails --group "development, test"
20
22
 
21
23
  ## OPTIONS
@@ -27,3 +29,12 @@ bundle add rails --group "development, test"
27
29
 
28
30
  * `--source`, , `-s`:
29
31
  Specify the source for the added gem.
32
+
33
+ * `--skip-install`:
34
+ Adds the gem to the Gemfile but does not install it.
35
+
36
+ * `--optimistic`:
37
+ Adds optimistic declaration of version
38
+
39
+ * `--strict`:
40
+ Adds strict declaration of version
@@ -170,6 +170,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
170
170
  When set, Gemfiles containing multiple sources will produce errors
171
171
  instead of warnings.
172
172
  Use `bundle config --delete disable_multisource` to unset.
173
+ * `disable_platform_warnings` (`BUNDLE_DISABLE_PLATFORM_WARNINGS`):
174
+ Disable warnings during bundle install when a dependency is unused on the current platform.
173
175
  * `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
174
176
  Stop Bundler from accessing gems installed to RubyGems' normal location.
175
177
  * `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
@@ -196,6 +198,9 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
196
198
  * `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
197
199
  Whether Bundler should cache all gems globally, rather than locally to the
198
200
  installing Ruby installation.
201
+ * `global_path_appends_ruby_scope` (`BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE`):
202
+ Whether Bundler should append the Ruby scope (e.g. engine and ABI version)
203
+ to a globally-configured path.
199
204
  * `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
200
205
  messages will be printed. To silence a single gem, use dot notation like
201
206
  `ignore_messages.httparty true`.
@@ -222,6 +227,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
222
227
  is used, defaults to vendor/bundle.
223
228
  * `path.system` (`BUNDLE_PATH__SYSTEM`):
224
229
  Whether Bundler will install gems into the default system path (`Gem.dir`).
230
+ * `path_relative_to_cwd` (`PATH_RELATIVE_TO_CWD`)
231
+ Makes `--path` relative to the CWD instead of the `Gemfile`.
225
232
  * `plugins` (`BUNDLE_PLUGINS`):
226
233
  Enable Bundler's experimental plugin system.
227
234
  * `prefer_gems_rb` (`BUNDLE_PREFER_GEMS_RB`)
@@ -374,3 +381,17 @@ This is especially useful for private repositories on hosts such as Github,
374
381
  where you can use personal OAuth tokens:
375
382
 
376
383
  export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
384
+
385
+
386
+ ## CONFIGURE BUNDLER DIRECTORIES
387
+
388
+ Bundler's home, config, cache and plugin directories are able to be configured
389
+ through environment variables. The default location for Bundler's home directory is
390
+ `~/.bundle`, which all directories inherit from by default. The following
391
+ outlines the available environment variables and their default values
392
+
393
+ BUNDLE_USER_HOME : $HOME/.bundle
394
+ BUNDLE_USER_CACHE : $BUNDLE_USER_HOME/cache
395
+ BUNDLE_USER_CONFIG : $BUNDLE_USER_HOME/config
396
+ BUNDLE_USER_PLUGIN : $BUNDLE_USER_HOME/plugin
397
+
@@ -66,7 +66,7 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
66
66
 
67
67
  * `--force`:
68
68
  Force download every gem, even if the required versions are already available
69
- locally.
69
+ locally. `--redownload` is an alias of this option.
70
70
 
71
71
  * `--frozen`:
72
72
  Do not allow the Gemfile.lock to be updated after this install. Exits
@@ -3,13 +3,31 @@ bundle-list(1) -- List all the gems in the bundle
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle list` [--name-only]
6
+ `bundle list` [--name-only] [--paths] [--without-group=GROUP] [--only-group=GROUP]
7
7
 
8
8
  ## DESCRIPTION
9
9
 
10
10
  Prints a list of all the gems in the bundle including their version.
11
11
 
12
+ Example:
13
+
14
+ bundle list --name-only
15
+
16
+ bundle list --paths
17
+
18
+ bundle list --without-group test
19
+
20
+ bundle list --only-group dev
21
+
22
+ bundle list --only-group dev --paths
23
+
12
24
  ## OPTIONS
13
25
 
14
26
  * `--name-only`:
15
27
  Print only the name of each gem.
28
+ * `--paths`:
29
+ Print the path to each gem in the bundle.
30
+ * `--without-group`:
31
+ Print all gems expect from a group.
32
+ * `--only-group`:
33
+ Print gems from a particular group.
@@ -15,6 +15,7 @@ bundle-outdated(1) -- List installed gems with newer versions available
15
15
  [--filter-major]
16
16
  [--filter-minor]
17
17
  [--filter-patch]
18
+ [--only-explicit]
18
19
 
19
20
  ## DESCRIPTION
20
21
 
@@ -67,6 +68,9 @@ are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
67
68
  * `--filter-patch`:
68
69
  Only list patch newer versions.
69
70
 
71
+ * `--only-explicit`:
72
+ Only list gems specified in your Gemfile, not their dependencies.
73
+
70
74
  ## PATCH LEVEL OPTIONS
71
75
 
72
76
  See [bundle update(1)](bundle-update.1.html) for details.
@@ -0,0 +1,23 @@
1
+ bundle-remove(1) -- Removes gems from the Gemfile
2
+ ===========================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle remove [GEM [GEM ...]] [--install]`
7
+
8
+ ## DESCRIPTION
9
+
10
+ Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If a gem cannot be removed, a warning is printed. If a gem is already absent from the Gemfile, and error is raised.
11
+
12
+ ## OPTIONS
13
+
14
+ * `--install`:
15
+ Runs `bundle install` after the given gems have been removed from the Gemfile, which ensures that both the lockfile and the installed gems on disk are also updated to remove the given gem(s).
16
+
17
+ Example:
18
+
19
+ bundle remove rails
20
+
21
+ bundle remove rails rack
22
+
23
+ bundle remove rails rack --install
@@ -65,7 +65,7 @@ gem.
65
65
  Only output warnings and errors.
66
66
 
67
67
  * `--force`:
68
- Force downloading every gem.
68
+ Force downloading every gem. `--redownload` is an alias of this option.
69
69
 
70
70
  * `--patch`:
71
71
  Prefer updating only to next patch version.
@@ -7,10 +7,9 @@
7
7
  #++
8
8
 
9
9
  require 'rbconfig'
10
- require 'thread'
11
10
 
12
11
  module Gem
13
- VERSION = "2.7.11"
12
+ VERSION = "3.0.0".freeze
14
13
  end
15
14
 
16
15
  # Must be first since it unloads the prelude from 1.9.2
@@ -127,14 +126,14 @@ module Gem
127
126
  /mingw/i,
128
127
  /mswin/i,
129
128
  /wince/i,
130
- ]
129
+ ].freeze
131
130
 
132
131
  GEM_DEP_FILES = %w[
133
132
  gem.deps.rb
134
133
  gems.rb
135
134
  Gemfile
136
135
  Isolate
137
- ]
136
+ ].freeze
138
137
 
139
138
  ##
140
139
  # Subdirectories in a gem repository
@@ -146,7 +145,7 @@ module Gem
146
145
  extensions
147
146
  gems
148
147
  specifications
149
- ]
148
+ ].freeze
150
149
 
151
150
  ##
152
151
  # Subdirectories in a gem repository for default gems
@@ -154,7 +153,7 @@ module Gem
154
153
  REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES = %w[
155
154
  gems
156
155
  specifications/default
157
- ]
156
+ ].freeze
158
157
 
159
158
  ##
160
159
  # Exception classes used in a Gem.read_binary +rescue+ statement. Not all of
@@ -203,7 +202,7 @@ module Gem
203
202
  # activation succeeded or wasn't needed because it was already
204
203
  # activated. Returns false if it can't find the path in a gem.
205
204
 
206
- def self.try_activate path
205
+ def self.try_activate(path)
207
206
  # finds the _latest_ version... regardless of loaded specs and their deps
208
207
  # if another gem had a requirement that would mean we shouldn't
209
208
  # activate the latest version, then either it would already be activated
@@ -263,7 +262,7 @@ module Gem
263
262
  find_spec_for_exe(name, exec_name, requirements).bin_file exec_name
264
263
  end
265
264
 
266
- def self.find_spec_for_exe name, exec_name, requirements
265
+ def self.find_spec_for_exe(name, exec_name, requirements)
267
266
  dep = Gem::Dependency.new name, requirements
268
267
 
269
268
  loaded = Gem.loaded_specs[name]
@@ -299,7 +298,7 @@ module Gem
299
298
  #
300
299
  # This method should *only* be used in bin stub files.
301
300
 
302
- def self.activate_bin_path name, exec_name, requirement # :nodoc:
301
+ def self.activate_bin_path(name, exec_name, requirement) # :nodoc:
303
302
  spec = find_spec_for_exe name, exec_name, [requirement]
304
303
  Gem::LOADED_SPECS_MUTEX.synchronize do
305
304
  spec.activate
@@ -368,11 +367,6 @@ module Gem
368
367
  spec.datadir
369
368
  end
370
369
 
371
- class << self
372
- extend Gem::Deprecate
373
- deprecate :datadir, "spec.datadir", 2016, 10
374
- end
375
-
376
370
  ##
377
371
  # A Zlib::Deflate.deflate wrapper
378
372
 
@@ -447,7 +441,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
447
441
  #
448
442
  # World-writable directories will never be created.
449
443
 
450
- def self.ensure_gem_subdirectories dir = Gem.dir, mode = nil
444
+ def self.ensure_gem_subdirectories(dir = Gem.dir, mode = nil)
451
445
  ensure_subdirectories(dir, mode, REPOSITORY_SUBDIRECTORIES)
452
446
  end
453
447
 
@@ -460,11 +454,11 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
460
454
  #
461
455
  # World-writable directories will never be created.
462
456
 
463
- def self.ensure_default_gem_subdirectories dir = Gem.dir, mode = nil
457
+ def self.ensure_default_gem_subdirectories(dir = Gem.dir, mode = nil)
464
458
  ensure_subdirectories(dir, mode, REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES)
465
459
  end
466
460
 
467
- def self.ensure_subdirectories dir, mode, subdirs # :nodoc:
461
+ def self.ensure_subdirectories(dir, mode, subdirs) # :nodoc:
468
462
  old_umask = File.umask
469
463
  File.umask old_umask | 002
470
464
 
@@ -488,7 +482,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
488
482
  # distinction as extensions cannot be shared between the two.
489
483
 
490
484
  def self.extension_api_version # :nodoc:
491
- if 'no' == RbConfig::CONFIG['ENABLE_SHARED'] then
485
+ if 'no' == RbConfig::CONFIG['ENABLE_SHARED']
492
486
  "#{ruby_api_version}-static"
493
487
  else
494
488
  ruby_api_version
@@ -525,9 +519,10 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
525
519
  return files
526
520
  end
527
521
 
528
- def self.find_files_from_load_path glob # :nodoc:
522
+ def self.find_files_from_load_path(glob) # :nodoc:
523
+ glob_with_suffixes = "#{glob}#{Gem.suffix_pattern}"
529
524
  $LOAD_PATH.map { |load_path|
530
- Dir["#{File.expand_path glob, load_path}#{Gem.suffix_pattern}"]
525
+ Gem::Util.glob_files_in_dir(glob_with_suffixes, load_path)
531
526
  }.flatten.select { |file| File.file? file.untaint }
532
527
  end
533
528
 
@@ -577,20 +572,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
577
572
  #++
578
573
 
579
574
  def self.find_home
580
- windows = File::ALT_SEPARATOR
581
- if not windows or RUBY_VERSION >= '1.9' then
582
- File.expand_path "~"
583
- else
584
- ['HOME', 'USERPROFILE'].each do |key|
585
- return File.expand_path ENV[key] if ENV[key]
586
- end
587
-
588
- if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then
589
- File.expand_path "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}"
590
- end
591
- end
575
+ Dir.home
592
576
  rescue
593
- if windows then
577
+ if Gem.win_platform?
594
578
  File.expand_path File.join(ENV['HOMEDRIVE'] || ENV['SystemDrive'], '/')
595
579
  else
596
580
  File.expand_path "/"
@@ -645,7 +629,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
645
629
  # Fetching: minitest-3.0.1.gem (100%)
646
630
  # => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
647
631
 
648
- def self.install name, version = Gem::Requirement.default, *options
632
+ def self.install(name, version = Gem::Requirement.default, *options)
649
633
  require "rubygems/dependency_installer"
650
634
  inst = Gem::DependencyInstaller.new(*options)
651
635
  inst.install name, version
@@ -663,7 +647,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
663
647
 
664
648
  ## Set the default RubyGems API host.
665
649
 
666
- def self.host= host
650
+ def self.host=(host)
667
651
  # TODO: move to utils
668
652
  @host = host
669
653
  end
@@ -691,45 +675,32 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
691
675
  return if @yaml_loaded
692
676
  return unless defined?(gem)
693
677
 
694
- test_syck = ENV['TEST_SYCK']
695
-
696
- # Only Ruby 1.8 and 1.9 have syck
697
- test_syck = false unless /^1\./ =~ RUBY_VERSION
678
+ begin
679
+ gem 'psych', '>= 2.0.0'
680
+ rescue Gem::LoadError
681
+ # It's OK if the user does not have the psych gem installed. We will
682
+ # attempt to require the stdlib version
683
+ end
698
684
 
699
- unless test_syck
700
- begin
701
- gem 'psych', '>= 2.0.0'
702
- rescue Gem::LoadError
703
- # It's OK if the user does not have the psych gem installed. We will
704
- # attempt to require the stdlib version
685
+ begin
686
+ # Try requiring the gem version *or* stdlib version of psych.
687
+ require 'psych'
688
+ rescue ::LoadError
689
+ # If we can't load psych, thats fine, go on.
690
+ else
691
+ # If 'yaml' has already been required, then we have to
692
+ # be sure to switch it over to the newly loaded psych.
693
+ if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != "psych"
694
+ YAML::ENGINE.yamler = "psych"
705
695
  end
706
696
 
707
- begin
708
- # Try requiring the gem version *or* stdlib version of psych.
709
- require 'psych'
710
- rescue ::LoadError
711
- # If we can't load psych, thats fine, go on.
712
- else
713
- # If 'yaml' has already been required, then we have to
714
- # be sure to switch it over to the newly loaded psych.
715
- if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != "psych"
716
- YAML::ENGINE.yamler = "psych"
717
- end
718
-
719
- require 'rubygems/psych_additions'
720
- require 'rubygems/psych_tree'
721
- end
697
+ require 'rubygems/psych_additions'
698
+ require 'rubygems/psych_tree'
722
699
  end
723
700
 
724
701
  require 'yaml'
725
702
  require 'rubygems/safe_yaml'
726
703
 
727
- # If we're supposed to be using syck, then we may have to force
728
- # activate it via the YAML::ENGINE API.
729
- if test_syck and defined?(YAML::ENGINE)
730
- YAML::ENGINE.yamler = "syck" unless YAML::ENGINE.syck?
731
- end
732
-
733
704
  # Now that we're sure some kind of yaml library is loaded, pull
734
705
  # in our hack to deal with Syck's DefaultKey ugliness.
735
706
  require 'rubygems/syck_hack'
@@ -865,7 +836,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
865
836
 
866
837
  if prefix != File.expand_path(RbConfig::CONFIG['sitelibdir']) and
867
838
  prefix != File.expand_path(RbConfig::CONFIG['libdir']) and
868
- 'lib' == File.basename(RUBYGEMS_DIR) then
839
+ 'lib' == File.basename(RUBYGEMS_DIR)
869
840
  prefix
870
841
  end
871
842
  end
@@ -923,7 +894,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
923
894
  # The path to the running Ruby interpreter.
924
895
 
925
896
  def self.ruby
926
- if @ruby.nil? then
897
+ if @ruby.nil?
927
898
  @ruby = File.join(RbConfig::CONFIG['bindir'],
928
899
  "#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}")
929
900
 
@@ -952,7 +923,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
952
923
  ##
953
924
  # Returns the latest release-version specification for the gem +name+.
954
925
 
955
- def self.latest_spec_for name
926
+ def self.latest_spec_for(name)
956
927
  dependency = Gem::Dependency.new name
957
928
  fetcher = Gem::SpecFetcher.fetcher
958
929
  spec_tuples, = fetcher.spec_for_dependency dependency
@@ -973,7 +944,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
973
944
  ##
974
945
  # Returns the version of the latest release-version of gem +name+
975
946
 
976
- def self.latest_version_for name
947
+ def self.latest_version_for(name)
977
948
  spec = latest_spec_for name
978
949
  spec and spec.version
979
950
  end
@@ -985,10 +956,15 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
985
956
  return @ruby_version if defined? @ruby_version
986
957
  version = RUBY_VERSION.dup
987
958
 
988
- if defined?(RUBY_PATCHLEVEL) && RUBY_PATCHLEVEL != -1 then
959
+ if defined?(RUBY_PATCHLEVEL) && RUBY_PATCHLEVEL != -1
989
960
  version << ".#{RUBY_PATCHLEVEL}"
990
- elsif defined?(RUBY_REVISION) then
991
- version << ".dev.#{RUBY_REVISION}"
961
+ elsif defined?(RUBY_DESCRIPTION)
962
+ if RUBY_ENGINE == "ruby"
963
+ desc = RUBY_DESCRIPTION[/\Aruby #{Regexp.quote(RUBY_VERSION)}([^ ]+) /, 1]
964
+ else
965
+ desc = RUBY_DESCRIPTION[/\A#{RUBY_ENGINE} #{Regexp.quote(RUBY_ENGINE_VERSION)} \(#{RUBY_VERSION}([^ ]+)\) /, 1]
966
+ end
967
+ version << ".#{desc}" if desc
992
968
  end
993
969
 
994
970
  @ruby_version = Gem::Version.new version
@@ -1018,7 +994,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1018
994
  # DOC: This comment is not documentation about the method itself, it's
1019
995
  # more of a code comment about the implementation.
1020
996
 
1021
- def self.sources= new_sources
997
+ def self.sources=(new_sources)
1022
998
  if !new_sources
1023
999
  @sources = nil
1024
1000
  else
@@ -1095,7 +1071,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1095
1071
  # Is this a windows platform?
1096
1072
 
1097
1073
  def self.win_platform?
1098
- if @@win_platform.nil? then
1074
+ if @@win_platform.nil?
1099
1075
  ruby_platform = RbConfig::CONFIG['host_os']
1100
1076
  @@win_platform = !!WIN_PATTERNS.find { |r| ruby_platform =~ r }
1101
1077
  end
@@ -1106,7 +1082,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1106
1082
  ##
1107
1083
  # Load +plugins+ as Ruby files
1108
1084
 
1109
- def self.load_plugin_files plugins # :nodoc:
1085
+ def self.load_plugin_files(plugins) # :nodoc:
1110
1086
  plugins.each do |plugin|
1111
1087
 
1112
1088
  # Skip older versions of the GemCutter plugin: Its commands are in
@@ -1143,8 +1119,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1143
1119
  path = "rubygems_plugin"
1144
1120
 
1145
1121
  files = []
1122
+ glob = "#{path}#{Gem.suffix_pattern}"
1146
1123
  $LOAD_PATH.each do |load_path|
1147
- globbed = Dir["#{File.expand_path path, load_path}#{Gem.suffix_pattern}"]
1124
+ globbed = Gem::Util.glob_files_in_dir(glob, load_path)
1148
1125
 
1149
1126
  globbed.each do |load_path_file|
1150
1127
  files << load_path_file if File.file?(load_path_file.untaint)
@@ -1174,7 +1151,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1174
1151
  # execution of arbitrary code when used from directories outside your
1175
1152
  # control.
1176
1153
 
1177
- def self.use_gemdeps path = nil
1154
+ def self.use_gemdeps(path = nil)
1178
1155
  raise_exception = path
1179
1156
 
1180
1157
  path ||= ENV['RUBYGEMS_GEMDEPS']
@@ -1182,7 +1159,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1182
1159
 
1183
1160
  path = path.dup
1184
1161
 
1185
- if path == "-" then
1162
+ if path == "-"
1186
1163
  Gem::Util.traverse_parents Dir.pwd do |directory|
1187
1164
  dep_file = GEM_DEP_FILES.find { |f| File.file?(f) }
1188
1165
 
@@ -1195,7 +1172,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1195
1172
 
1196
1173
  path.untaint
1197
1174
 
1198
- unless File.file? path then
1175
+ unless File.file? path
1199
1176
  return unless raise_exception
1200
1177
 
1201
1178
  raise ArgumentError, "Unable to find gem dependencies file at #{path}"
@@ -1365,13 +1342,12 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1365
1342
  ##
1366
1343
  # Location of Marshal quick gemspecs on remote repositories
1367
1344
 
1368
- MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
1345
+ MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/".freeze
1369
1346
 
1370
1347
  autoload :BundlerVersionFinder, 'rubygems/bundler_version_finder'
1371
1348
  autoload :ConfigFile, 'rubygems/config_file'
1372
1349
  autoload :Dependency, 'rubygems/dependency'
1373
1350
  autoload :DependencyList, 'rubygems/dependency_list'
1374
- autoload :DependencyResolver, 'rubygems/resolver'
1375
1351
  autoload :Installer, 'rubygems/installer'
1376
1352
  autoload :Licenses, 'rubygems/util/licenses'
1377
1353
  autoload :PathSupport, 'rubygems/path_support'
@@ -1392,25 +1368,22 @@ end
1392
1368
  require 'rubygems/exceptions'
1393
1369
 
1394
1370
  # REFACTOR: This should be pulled out into some kind of hacks file.
1395
- gem_preluded = Gem::GEM_PRELUDE_SUCKAGE and defined? Gem
1396
- unless gem_preluded then # TODO: remove guard after 1.9.2 dropped
1371
+ begin
1372
+ ##
1373
+ # Defaults the operating system (or packager) wants to provide for RubyGems.
1374
+
1375
+ require 'rubygems/defaults/operating_system'
1376
+ rescue LoadError
1377
+ end
1378
+
1379
+ if defined?(RUBY_ENGINE)
1397
1380
  begin
1398
1381
  ##
1399
- # Defaults the operating system (or packager) wants to provide for RubyGems.
1382
+ # Defaults the Ruby implementation wants to provide for RubyGems
1400
1383
 
1401
- require 'rubygems/defaults/operating_system'
1384
+ require "rubygems/defaults/#{RUBY_ENGINE}"
1402
1385
  rescue LoadError
1403
1386
  end
1404
-
1405
- if defined?(RUBY_ENGINE) then
1406
- begin
1407
- ##
1408
- # Defaults the Ruby implementation wants to provide for RubyGems
1409
-
1410
- require "rubygems/defaults/#{RUBY_ENGINE}"
1411
- rescue LoadError
1412
- end
1413
- end
1414
1387
  end
1415
1388
 
1416
1389
  ##
@@ -1419,5 +1392,6 @@ Gem::Specification.load_defaults
1419
1392
 
1420
1393
  require 'rubygems/core_ext/kernel_gem'
1421
1394
  require 'rubygems/core_ext/kernel_require'
1395
+ require 'rubygems/core_ext/kernel_warn'
1422
1396
 
1423
1397
  Gem.use_gemdeps