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
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "bundler/fetcher/base"
3
4
  require "rubygems/remote_fetcher"
4
5
 
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
+
3
4
  require "cgi"
4
5
  require "bundler/vendored_thor"
5
6
 
@@ -81,7 +82,7 @@ module Bundler
81
82
 
82
83
  I tried...
83
84
 
84
- - **Have you read our issues document, https://github.com/bundler/bundler/blob/master/ISSUES.md?**
85
+ - **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**
85
86
 
86
87
  ...
87
88
 
@@ -92,7 +93,7 @@ module Bundler
92
93
  #{e.backtrace && e.backtrace.join("\n ").chomp}
93
94
  ```
94
95
 
95
- #{Bundler::Env.new.report(:print_gemfile => false, :print_gemspecs => false)}
96
+ #{Bundler::Env.report}
96
97
  --- TEMPLATE END ----------------------------------------------------------------
97
98
 
98
99
  EOS
@@ -119,6 +120,8 @@ module Bundler
119
120
 
120
121
  def self.with_friendly_errors
121
122
  yield
123
+ rescue SignalException
124
+ raise
122
125
  rescue Exception => e
123
126
  FriendlyErrors.log_error(e)
124
127
  exit FriendlyErrors.exit_status(e)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "bundler/vendored_thor" unless defined?(Thor)
3
4
  require "bundler"
4
5
 
@@ -50,8 +51,8 @@ module Bundler
50
51
  install_gem(built_gem_path, :local)
51
52
  end
52
53
 
53
- desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to Rubygems\n" \
54
- "To prevent publishing in Rubygems use `gem_push=no rake release`"
54
+ desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{gem_push_host}\n" \
55
+ "To prevent publishing in RubyGems use `gem_push=no rake release`"
55
56
  task "release", [:remote] => ["build", "release:guard_clean",
56
57
  "release:source_control_push", "release:rubygem_push"] do
57
58
  end
@@ -92,17 +93,14 @@ module Bundler
92
93
  protected
93
94
 
94
95
  def rubygem_push(path)
95
- allowed_push_host = nil
96
96
  gem_command = "gem push '#{path}'"
97
- if @gemspec.respond_to?(:metadata)
98
- allowed_push_host = @gemspec.metadata["allowed_push_host"]
99
- gem_command += " --host #{allowed_push_host}" if allowed_push_host
100
- end
97
+ gem_command += " --key #{gem_key}" if gem_key
98
+ gem_command += " --host #{allowed_push_host}" if allowed_push_host
101
99
  unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
102
100
  raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
103
101
  end
104
102
  sh(gem_command)
105
- Bundler.ui.confirm "Pushed #{name} #{version} to #{allowed_push_host ? allowed_push_host : "rubygems.org."}"
103
+ Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
106
104
  end
107
105
 
108
106
  def built_gem_path
@@ -115,6 +113,18 @@ module Bundler
115
113
  Bundler.ui.confirm "Pushed git commits and tags."
116
114
  end
117
115
 
116
+ def allowed_push_host
117
+ @gemspec.metadata["allowed_push_host"] if @gemspec.respond_to?(:metadata)
118
+ end
119
+
120
+ def gem_push_host
121
+ env_rubygems_host = ENV["RUBYGEMS_HOST"]
122
+ env_rubygems_host = nil if
123
+ env_rubygems_host && env_rubygems_host.empty?
124
+
125
+ allowed_push_host || env_rubygems_host || "rubygems.org"
126
+ end
127
+
118
128
  def perform_git_push(options = "")
119
129
  cmd = "git push #{options}"
120
130
  out, code = sh_with_code(cmd)
@@ -181,8 +191,12 @@ module Bundler
181
191
  end
182
192
  end
183
193
 
194
+ def gem_key
195
+ Bundler.settings["gem.push_key"].to_s.downcase if Bundler.settings["gem.push_key"]
196
+ end
197
+
184
198
  def gem_push?
185
- !%w(n no nil false off 0).include?(ENV["gem_push"].to_s.downcase)
199
+ !%w[n no nil false off 0].include?(ENV["gem_push"].to_s.downcase)
186
200
  end
187
201
  end
188
202
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  module GemHelpers
4
5
  GENERIC_CACHE = {} # rubocop:disable MutableConstant
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "rubygems/remote_fetcher"
3
4
 
4
5
  module Bundler
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "rake/clean"
3
4
  CLOBBER.include "pkg"
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  # This class contains all of the logic for determining the next version of a
4
5
  # Gem to update to based on the requested level (patch, minor, major).
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  class Gemdeps
4
5
  def initialize(runtime)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "set"
3
4
  module Bundler
4
5
  class Graph
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "set"
3
4
 
4
5
  module Bundler
@@ -58,17 +59,23 @@ module Bundler
58
59
  # Search this index's specs, and any source indexes that this index knows
59
60
  # about, returning all of the results.
60
61
  def search(query, base = nil)
62
+ sort_specs(unsorted_search(query, base))
63
+ end
64
+
65
+ def unsorted_search(query, base)
61
66
  results = local_search(query, base)
62
- seen = results.map(&:full_name).to_set
67
+
68
+ seen = results.map(&:full_name).to_set unless @sources.empty?
63
69
 
64
70
  @sources.each do |source|
65
- source.search(query, base).each do |spec|
71
+ source.unsorted_search(query, base).each do |spec|
66
72
  results << spec if seen.add?(spec.full_name)
67
73
  end
68
74
  end
69
75
 
70
- sort_specs(results)
76
+ results
71
77
  end
78
+ protected :unsorted_search
72
79
 
73
80
  def self.sort_specs(specs)
74
81
  specs.sort_by do |s|
@@ -105,6 +112,13 @@ module Bundler
105
112
  spec_sets.values.each(&blk)
106
113
  end
107
114
  sources.each {|s| s.each(&blk) }
115
+ self
116
+ end
117
+
118
+ def spec_names
119
+ names = specs.keys + sources.map(&:spec_names)
120
+ names.uniq!
121
+ names
108
122
  end
109
123
 
110
124
  # returns a list of the dependencies
@@ -144,6 +158,8 @@ module Bundler
144
158
  end
145
159
  end
146
160
 
161
+ # Whether all the specs in self are in other
162
+ # TODO: rename to #include?
147
163
  def ==(other)
148
164
  all? do |spec|
149
165
  other_spec = other[spec].first
@@ -183,14 +199,6 @@ module Bundler
183
199
  end
184
200
  end
185
201
 
186
- wants_prerelease = dependency.requirement.prerelease?
187
- wants_prerelease ||= base && base.any? {|base_spec| base_spec.version.prerelease? }
188
- only_prerelease = specs.all? {|spec| spec.version.prerelease? }
189
-
190
- unless wants_prerelease || only_prerelease
191
- found.reject! {|spec| spec.version.prerelease? }
192
- end
193
-
194
202
  found
195
203
  end
196
204
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  class Injector
4
5
  def self.inject(new_deps, options = {})
@@ -12,52 +13,75 @@ module Bundler
12
13
  end
13
14
 
14
15
  def inject(gemfile_path, lockfile_path)
15
- if Bundler.settings[:frozen]
16
+ if Bundler.frozen?
16
17
  # ensure the lock and Gemfile are synced
17
18
  Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
18
- # temporarily remove frozen while we inject
19
- frozen = Bundler.settings.delete(:frozen)
20
19
  end
21
20
 
22
- # evaluate the Gemfile we have now
23
- builder = Dsl.new
24
- builder.eval_gemfile(gemfile_path)
21
+ # temporarily unfreeze
22
+ Bundler.settings.temporary(:deployment => false, :frozen => false) do
23
+ # evaluate the Gemfile we have now
24
+ builder = Dsl.new
25
+ builder.eval_gemfile(gemfile_path)
26
+
27
+ # don't inject any gems that are already in the Gemfile
28
+ @new_deps -= builder.dependencies
25
29
 
26
- # don't inject any gems that are already in the Gemfile
27
- @new_deps -= builder.dependencies
30
+ # add new deps to the end of the in-memory Gemfile
31
+ # Set conservative versioning to false because we want to let the resolver resolve the version first
32
+ builder.eval_gemfile("injected gems", build_gem_lines(false)) if @new_deps.any?
28
33
 
29
- # add new deps to the end of the in-memory Gemfile
30
- builder.eval_gemfile("injected gems", new_gem_lines) if @new_deps.any?
34
+ # resolve to see if the new deps broke anything
35
+ @definition = builder.to_definition(lockfile_path, {})
36
+ @definition.resolve_remotely!
31
37
 
32
- # resolve to see if the new deps broke anything
33
- definition = builder.to_definition(lockfile_path, {})
34
- definition.resolve_remotely!
38
+ # since nothing broke, we can add those gems to the gemfile
39
+ append_to(gemfile_path, build_gem_lines(@options[:conservative_versioning])) if @new_deps.any?
35
40
 
36
- # since nothing broke, we can add those gems to the gemfile
37
- append_to(gemfile_path) if @new_deps.any?
41
+ # since we resolved successfully, write out the lockfile
42
+ @definition.lock(Bundler.default_lockfile)
38
43
 
39
- # since we resolved successfully, write out the lockfile
40
- definition.lock(Bundler.default_lockfile)
44
+ # invalidate the cached Bundler.definition
45
+ Bundler.reset_paths!
41
46
 
42
- # return an array of the deps that we added
43
- return @new_deps
44
- ensure
45
- Bundler.settings[:frozen] = "1" if frozen
47
+ # return an array of the deps that we added
48
+ @new_deps
49
+ end
46
50
  end
47
51
 
48
52
  private
49
53
 
50
- def new_gem_lines
54
+ def conservative_version(spec)
55
+ version = spec.version
56
+ return ">= 0" if version.nil?
57
+ segments = version.segments
58
+ seg_end_index = version >= Gem::Version.new("1.0") ? 1 : 2
59
+
60
+ prerelease_suffix = version.to_s.gsub(version.release.to_s, "") if version.prerelease?
61
+ "~> #{segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
62
+ end
63
+
64
+ def build_gem_lines(conservative_versioning)
51
65
  @new_deps.map do |d|
52
- name = "'#{d.name}'"
53
- requirement = ", '#{d.requirement}'"
54
- group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
55
- source = ", :source => '#{d.source}'" unless d.source.nil?
66
+ name = d.name.dump
67
+
68
+ requirement = if conservative_versioning
69
+ ", \"#{conservative_version(@definition.specs[d.name][0])}\""
70
+ else
71
+ ", #{d.requirement.as_list.map(&:dump).join(", ")}"
72
+ end
73
+
74
+ if d.groups != Array(:default)
75
+ group = d.groups.size == 1 ? ", :group => #{d.groups.inspect}" : ", :groups => #{d.groups.inspect}"
76
+ end
77
+
78
+ source = ", :source => \"#{d.source}\"" unless d.source.nil?
79
+
56
80
  %(gem #{name}#{requirement}#{group}#{source})
57
81
  end.join("\n")
58
82
  end
59
83
 
60
- def append_to(gemfile_path)
84
+ def append_to(gemfile_path, new_gem_lines)
61
85
  gemfile_path.open("a") do |f|
62
86
  f.puts
63
87
  if @options["timestamp"] || @options["timestamp"].nil?
@@ -1,4 +1,7 @@
1
1
  # frozen_string_literal: true
2
+
3
+ require "bundler/compatibility_guard"
4
+
2
5
  # Allows for declaring a Gemfile inline in a ruby script, optionally installing
3
6
  # any gems that aren't already installed on the user's system.
4
7
  #
@@ -39,7 +42,7 @@ def gemfile(install = false, options = {}, &gemfile)
39
42
  def Bundler.root
40
43
  Bundler::SharedHelpers.pwd.expand_path
41
44
  end
42
- ENV["BUNDLE_GEMFILE"] ||= "Gemfile"
45
+ Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
43
46
 
44
47
  Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
45
48
  builder = Bundler::Dsl.new
@@ -50,19 +53,16 @@ def gemfile(install = false, options = {}, &gemfile)
50
53
  definition.validate_runtime!
51
54
 
52
55
  missing_specs = proc do
53
- begin
54
- !definition.missing_specs.empty?
55
- rescue Bundler::GemNotFound, Bundler::GitError
56
- definition.instance_variable_set(:@index, nil)
57
- true
58
- end
56
+ definition.missing_specs?
59
57
  end
60
58
 
61
59
  Bundler.ui = ui if install
62
60
  if install || missing_specs.call
63
- installer = Bundler::Installer.install(Bundler.root, definition, :system => true, :inline => true)
64
- installer.post_install_messages.each do |name, message|
65
- Bundler.ui.info "Post-install message from #{name}:\n#{message}"
61
+ Bundler.settings.temporary(:inline => true) do
62
+ installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
63
+ installer.post_install_messages.each do |name, message|
64
+ Bundler.ui.info "Post-install message from #{name}:\n#{message}"
65
+ end
66
66
  end
67
67
  end
68
68
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "erb"
3
4
  require "rubygems/dependency_installer"
4
5
  require "bundler/worker"
@@ -33,25 +34,26 @@ module Bundler
33
34
 
34
35
  # Runs the install procedures for a specific Gemfile.
35
36
  #
36
- # Firstly, this method will check to see if Bundler.bundle_path exists
37
- # and if not then will create it. This is usually the location of gems
38
- # on the system, be it RVM or at a system path.
37
+ # Firstly, this method will check to see if `Bundler.bundle_path` exists
38
+ # and if not then Bundler will create the directory. This is usually the same
39
+ # location as RubyGems which typically is the `~/.gem` directory
40
+ # unless other specified.
39
41
  #
40
- # Secondly, it checks if Bundler has been configured to be "frozen"
42
+ # Secondly, it checks if Bundler has been configured to be "frozen".
41
43
  # Frozen ensures that the Gemfile and the Gemfile.lock file are matching.
42
44
  # This stops a situation where a developer may update the Gemfile but may not run
43
45
  # `bundle install`, which leads to the Gemfile.lock file not being correctly updated.
44
46
  # If this file is not correctly updated then any other developer running
45
47
  # `bundle install` will potentially not install the correct gems.
46
48
  #
47
- # Thirdly, Bundler checks if there are any dependencies specified in the Gemfile using
48
- # Bundler::Environment#dependencies. If there are no dependencies specified then
49
- # Bundler returns a warning message stating so and this method returns.
49
+ # Thirdly, Bundler checks if there are any dependencies specified in the Gemfile.
50
+ # If there are no dependencies specified then Bundler returns a warning message stating
51
+ # so and this method returns.
50
52
  #
51
- # Fourthly, Bundler checks if the default lockfile (Gemfile.lock) exists, and if so
52
- # then proceeds to set up a defintion based on the default gemfile (Gemfile) and the
53
- # default lock file (Gemfile.lock). However, this is not the case if the platform is different
54
- # to that which is specified in Gemfile.lock, or if there are any missing specs for the gems.
53
+ # Fourthly, Bundler checks if the Gemfile.lock exists, and if so
54
+ # then proceeds to set up a definition based on the Gemfile and the Gemfile.lock.
55
+ # During this step Bundler will also download information about any new gems
56
+ # that are not in the Gemfile.lock and resolve any dependencies if needed.
55
57
  #
56
58
  # Fifthly, Bundler resolves the dependencies either through a cache of gems or by remote.
57
59
  # This then leads into the gems being installed, along with stubs for their executables,
@@ -61,26 +63,36 @@ module Bundler
61
63
  # Sixthly, a new Gemfile.lock is created from the installed gems to ensure that the next time
62
64
  # that a user runs `bundle install` they will receive any updates from this process.
63
65
  #
64
- # Finally: TODO add documentation for how the standalone process works.
66
+ # Finally, if the user has specified the standalone flag, Bundler will generate the needed
67
+ # require paths and save them in a `setup.rb` file. See `bundle standalone --help` for more
68
+ # information.
65
69
  def run(options)
66
70
  create_bundle_path
67
71
 
68
- if Bundler.settings[:frozen]
69
- @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
70
- end
72
+ ProcessLock.lock do
73
+ if Bundler.frozen?
74
+ @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
75
+ end
71
76
 
72
- if @definition.dependencies.empty?
73
- Bundler.ui.warn "The Gemfile specifies no dependencies"
74
- lock
75
- return
76
- end
77
+ if @definition.dependencies.empty?
78
+ Bundler.ui.warn "The Gemfile specifies no dependencies"
79
+ lock
80
+ return
81
+ end
77
82
 
78
- resolve_if_need(options)
79
- ensure_specs_are_compatible!
80
- install(options)
83
+ if resolve_if_needed(options)
84
+ ensure_specs_are_compatible!
85
+ warn_on_incompatible_bundler_deps
86
+ load_plugins
87
+ options.delete(:jobs)
88
+ else
89
+ options[:jobs] = 1 # to avoid the overhead of Bundler::Worker
90
+ end
91
+ install(options)
81
92
 
82
- lock unless Bundler.settings[:frozen]
83
- Standalone.new(options[:standalone], @definition).generate if options[:standalone]
93
+ lock unless Bundler.frozen?
94
+ Standalone.new(options[:standalone], @definition).generate if options[:standalone]
95
+ end
84
96
  end
85
97
 
86
98
  def generate_bundler_executable_stubs(spec, options = {})
@@ -101,15 +113,21 @@ module Bundler
101
113
  end
102
114
 
103
115
  # double-assignment to avoid warnings about variables that will be used by ERB
104
- bin_path = bin_path = Bundler.bin_path
105
- template = template = File.read(File.expand_path("../templates/Executable", __FILE__))
106
- relative_gemfile_path = relative_gemfile_path = Bundler.default_gemfile.relative_path_from(bin_path)
107
- ruby_command = ruby_command = Thor::Util.ruby_command
116
+ bin_path = Bundler.bin_path
117
+ bin_path = bin_path
118
+ relative_gemfile_path = Bundler.default_gemfile.relative_path_from(bin_path)
119
+ relative_gemfile_path = relative_gemfile_path
120
+ ruby_command = Thor::Util.ruby_command
121
+ ruby_command = ruby_command
122
+ template_path = File.expand_path("../templates/Executable", __FILE__)
123
+ if spec.name == "bundler"
124
+ template_path += ".bundler"
125
+ spec.executables = %(bundle)
126
+ end
127
+ template = File.read(template_path)
108
128
 
109
129
  exists = []
110
130
  spec.executables.each do |executable|
111
- next if executable == "bundle"
112
-
113
131
  binstub_path = "#{bin_path}/#{executable}"
114
132
  if File.exist?(binstub_path) && !options[:force]
115
133
  exists << executable
@@ -139,13 +157,19 @@ module Bundler
139
157
  def generate_standalone_bundler_executable_stubs(spec)
140
158
  # double-assignment to avoid warnings about variables that will be used by ERB
141
159
  bin_path = Bundler.bin_path
142
- standalone_path = standalone_path = Bundler.root.join(Bundler.settings[:path]).relative_path_from(bin_path)
160
+ unless path = Bundler.settings[:path]
161
+ raise "Can't standalone without an explicit path set"
162
+ end
163
+ standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
164
+ standalone_path = standalone_path
143
165
  template = File.read(File.expand_path("../templates/Executable.standalone", __FILE__))
144
- ruby_command = ruby_command = Thor::Util.ruby_command
166
+ ruby_command = Thor::Util.ruby_command
167
+ ruby_command = ruby_command
145
168
 
146
169
  spec.executables.each do |executable|
147
170
  next if executable == "bundle"
148
- executable_path = executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
171
+ executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
172
+ executable_path = executable_path
149
173
  File.open "#{bin_path}/#{executable}", "w", 0o755 do |f|
150
174
  f.puts ERB.new(template, nil, "-").result(binding)
151
175
  end
@@ -159,13 +183,32 @@ module Bundler
159
183
  # that said, it's a rare situation (other than rake), and parallel
160
184
  # installation is SO MUCH FASTER. so we let people opt in.
161
185
  def install(options)
162
- Bundler.rubygems.load_plugins
163
186
  force = options["force"]
164
- jobs = 1
165
- jobs = [Bundler.settings[:jobs].to_i - 1, 1].max if can_install_in_parallel?
187
+ jobs = options.delete(:jobs) do
188
+ if can_install_in_parallel?
189
+ [Bundler.settings[:jobs].to_i - 1, 1].max
190
+ else
191
+ 1
192
+ end
193
+ end
166
194
  install_in_parallel jobs, options[:standalone], force
167
195
  end
168
196
 
197
+ def load_plugins
198
+ Bundler.rubygems.load_plugins
199
+
200
+ requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) }
201
+ path_plugin_files = requested_path_gems.map do |spec|
202
+ begin
203
+ Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
204
+ rescue TypeError
205
+ error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
206
+ raise Gem::InvalidSpecificationException, error_message
207
+ end
208
+ end.flatten
209
+ Bundler.rubygems.load_plugin_files(path_plugin_files)
210
+ end
211
+
169
212
  def ensure_specs_are_compatible!
170
213
  system_ruby = Bundler::RubyVersion.system
171
214
  rubygems_version = Gem::Version.create(Gem::VERSION)
@@ -184,12 +227,28 @@ module Bundler
184
227
  end
185
228
  end
186
229
 
230
+ def warn_on_incompatible_bundler_deps
231
+ bundler_version = Gem::Version.create(Bundler::VERSION)
232
+ @definition.specs.each do |spec|
233
+ spec.dependencies.each do |dep|
234
+ next if dep.type == :development
235
+ next unless dep.name == "bundler".freeze
236
+ next if dep.requirement.satisfied_by?(bundler_version)
237
+
238
+ Bundler.ui.warn "#{spec.name} (#{spec.version}) has dependency" \
239
+ " #{SharedHelpers.pretty_dependency(dep)}" \
240
+ ", which is unsatisfied by the current bundler version #{VERSION}" \
241
+ ", so the dependency is being ignored"
242
+ end
243
+ end
244
+ end
245
+
187
246
  def can_install_in_parallel?
188
247
  if Bundler.rubygems.provides?(">= 2.1.0")
189
248
  true
190
249
  else
191
- Bundler.ui.warn "Rubygems #{Gem::VERSION} is not threadsafe, so your "\
192
- "gems will be installed one at a time. Upgrade to Rubygems 2.1.0 " \
250
+ Bundler.ui.warn "RubyGems #{Gem::VERSION} is not threadsafe, so your "\
251
+ "gems will be installed one at a time. Upgrade to RubyGems 2.1.0 " \
193
252
  "or higher to enable parallel gem installation."
194
253
  false
195
254
  end
@@ -207,23 +266,18 @@ module Bundler
207
266
  Bundler.mkdir_p(p)
208
267
  end unless Bundler.bundle_path.exist?
209
268
  rescue Errno::EEXIST
210
- raise PathError, "Could not install to path `#{Bundler.settings[:path]}` " \
269
+ raise PathError, "Could not install to path `#{Bundler.bundle_path}` " \
211
270
  "because a file already exists at that path. Either remove or rename the file so the directory can be created."
212
271
  end
213
272
 
214
- def resolve_if_need(options)
215
- if Bundler.default_lockfile.exist? && !options["update"] && !options[:inline]
216
- local = Bundler.ui.silence do
217
- begin
218
- tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
219
- true unless tmpdef.new_platform? || tmpdef.missing_dependencies.any?
220
- rescue BundlerError
221
- end
222
- end
273
+ # returns whether or not a re-resolve was needed
274
+ def resolve_if_needed(options)
275
+ if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
276
+ return false if @definition.nothing_changed? && !@definition.missing_specs?
223
277
  end
224
278
 
225
- return if local
226
279
  options["local"] ? @definition.resolve_with_cache! : @definition.resolve_remotely!
280
+ true
227
281
  end
228
282
 
229
283
  def lock(opts = {})