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
@@ -14,7 +14,7 @@ Individuals asked to stop any harassing behavior are expected to comply immediat
14
14
 
15
15
  Maintainers, including the core team, are also subject to the anti-harassment policy.
16
16
 
17
- If anyone engages in abusive, harassing, or otherwise unacceptable behavior, including maintainers, we may take appropriate action, up to and including warning the offender, deletion of comments, removal from the project’s codebase and communication systems, and escalation to Github support.
17
+ If anyone engages in abusive, harassing, or otherwise unacceptable behavior, including maintainers, we may take appropriate action, up to and including warning the offender, deletion of comments, removal from the project’s codebase and communication systems, and escalation to GitHub support.
18
18
 
19
19
  If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a member of [the core team](http://bundler.io/contributors.html) or [email the core team](mailto:team@bundler.io) immediately.
20
20
 
@@ -1,36 +1,17 @@
1
- # Contributing
1
+ # Contributing to Bundler
2
2
 
3
- Bundler welcomes contributions from *everyone*. While contributing, please follow the project [code of conduct](http://bundler.io/conduct.html), so that everyone can be included.
4
-
5
- If you'd like to help make Bundler better, you totally rock! Here are some ways you can contribute:
6
-
7
- - by using prerelease versions (run `gem install bundler --pre`)
8
- - by [reporting bugs you encounter or suggesting new features](https://github.com/bundler/bundler/issues/new)
9
- - by adding to or editing [the Bundler documentation website](http://bundler.io) and [Bundler man pages](http://bundler.io/man/bundle.1.html)
10
- - by [checking issues for completeness](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md#bug-triage)
11
- - by closing issues that are not complete
12
- - by adding a failing test for reproducible [reported bugs](https://github.com/bundler/bundler/issues)
13
- - by reviewing [pull requests](https://github.com/bundler/bundler/pulls) and suggesting improvements
14
- - by improving existing code, including suggestions from [PullReview](https://www.pullreview.com/github/bundler/bundler/reviews/master) or [CodeClimate](https://codeclimate.com/github/bundler/bundler)
15
- - by [writing code](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md) (no patch is too small! fix typos or bad whitespace)
16
- - by backfilling [unit tests](https://github.com/bundler/bundler/tree/master/spec/bundler) for modules that lack [coverage](https://codeclimate.com/github/bundler/bundler/coverage)
17
-
18
- If you need help getting started, check out the [DEVELOPMENT.md](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md) file for steps that will get you up and running.
3
+ Welcome to Bundler! We are so happy that you're here. We know joining a new open source project can be daunting, so here's a quick overview of what you can expect from this documentation.
19
4
 
20
- Thanks for helping us make Bundler better.
21
-
22
- # Roadmap
23
-
24
- If you're interested in reading some of the potential ideas or plans for Bundler, see the official Bundler [Trello Board](https://trello.com/b/DioUaKgx/bundler).
25
-
26
- # Troubleshooting
5
+ Bundler welcomes contributions from *everyone*. While contributing, please follow the project [code of conduct](http://bundler.io/conduct.html), so that everyone can be included.
27
6
 
28
- If you're having a problem, please see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md) for troubleshooting steps and a guide for how to submit a ticket that will help us solve the problem you are having as quickly as possible.
7
+ ## Quick start
29
8
 
30
- # Requesting Features
9
+ Some guides you might find useful:
31
10
 
32
- Feel free to discuss your ideas or feature requests on any of the lists or channels listed below or [create an issue](https://github.com/bundler/bundler/issues/new) with the `feature-request` label. Feature-wise, we consider Bundler stable, so the core team does not tend to work on feature suggestions. Pull requests are welcome though!
11
+ * [Submitting pull requests](doc/development/PULL_REQUESTS.md)
12
+ * [Filing an issue](doc/contributing/ISSUES.md)
13
+ * [Bug triage](doc/contributing/BUG_TRIAGE.md)
33
14
 
34
- # Discussing Bundler
15
+ ## Comprehensive guides
35
16
 
36
- If you'd like to discuss features, ask questions, or just engage in general Bundler-focused discussion, please see the [#bundler](irc://irc.freenode.net/#bundler) IRC channel on Freenode, and the [Bundler mailing list](http://groups.google.com/group/ruby-bundler) on Google Groups.
17
+ Not finding what you're looking for? More comprehensive guides are [available here](doc/README.md).
data/bundler/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  [![Build Status](https://img.shields.io/travis/bundler/bundler/master.svg?style=flat)](https://travis-ci.org/bundler/bundler)
3
3
  [![Code Climate](https://img.shields.io/codeclimate/github/bundler/bundler.svg?style=flat)](https://codeclimate.com/github/bundler/bundler)
4
4
  [![Inline docs ](http://inch-ci.org/github/bundler/bundler.svg?style=flat)](http://inch-ci.org/github/bundler/bundler)
5
+ [![Slack ](http://bundler-slackin.herokuapp.com/badge.svg)](http://bundler-slackin.herokuapp.com)
5
6
 
6
7
  # Bundler: a gem to bundle gems
7
8
 
@@ -11,36 +12,47 @@ It does this by managing the gems that the application depends on. Given a list
11
12
 
12
13
  ### Installation and usage
13
14
 
15
+ To install (or update to the latest version):
16
+
14
17
  ```
15
18
  gem install bundler
19
+ ```
20
+
21
+ To install a prerelease version (if one is available), run `gem install bundler --pre`. To uninstall Bundler, run `gem uninstall bundler`.
22
+
23
+ Bundler is most commonly used to manage your application's dependencies. For example, these commands will allow you to use Bundler to manage the `rspec` gem for your application:
24
+
25
+ ```
16
26
  bundle init
17
27
  echo 'gem "rspec"' >> Gemfile
18
28
  bundle install
19
29
  bundle exec rspec
20
30
  ```
21
31
 
22
- For help with installation issues, see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md)
23
-
24
32
  See [bundler.io](http://bundler.io) for the full documentation.
25
33
 
26
34
  ### Troubleshooting
27
35
 
28
- For help with common problems, see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md).
36
+ For help with common problems, see [TROUBLESHOOTING](doc/TROUBLESHOOTING.md).
29
37
 
30
- ### Supporting
31
-
32
- <a href="https://rubytogether.org/"><img src="https://rubytogether.org/images/rubies.svg" width=200></a><br/>
33
- Bundler is maintained by <a href="https://rubytogether.org/">Ruby Together</a>, a grassroots initiative committed to supporting the critical Ruby infrastructure you rely on. Contribute today <a href="https://rubytogether.org/developers">as an individual</a> or even better, <a href="https://rubytogether.org/companies">as a company</a>, and ensure that Bundler, RubyGems, and other shared tooling is around for years to come.
38
+ Still stuck? Try [filing an issue](doc/contributing/ISSUES.md).
34
39
 
35
40
  ### Other questions
36
41
 
37
- To see what has changed in recent versions of Bundler, see the [CHANGELOG](https://github.com/bundler/bundler/blob/master/CHANGELOG.md).
42
+ To see what has changed in recent versions of Bundler, see the [CHANGELOG](CHANGELOG.md).
38
43
 
39
- Feel free to chat with the Bundler core team (and many other users) on IRC in the [#bundler](irc://irc.freenode.net/bundler) channel on Freenode, or via email on the [Bundler mailing list](http://groups.google.com/group/ruby-bundler).
44
+ To get in touch with the Bundler core team and other Bundler users, please see [getting help](doc/contributing/GETTING_HELP.md).
40
45
 
41
46
  ### Contributing
42
47
 
43
- If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [DEVELOPMENT](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md).
48
+ If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [our documentation section](doc/README.md).
49
+
50
+ While some Bundler contributors are compensated by Ruby Together, the project maintainers make decisions independent of Ruby Together. As a project, we welcome contributions regardless of the author’s affiliation with Ruby Together.
51
+
52
+ ### Supporting
53
+
54
+ <a href="https://rubytogether.org/"><img src="https://rubytogether.org/images/rubies.svg" width="150"></a><br>
55
+ <a href="https://rubytogether.org/">Ruby Together</a> pays some Bundler maintainers for their ongoing work. As a grassroots initiative committed to supporting the critical Ruby infrastructure you rely on, Ruby Together is funded entirely by the Ruby community. Contribute today <a href="https://rubytogether.org/developers">as an individual</a> or (better yet) <a href="https://rubytogether.org/companies">as a company</a> to ensure that Bundler, RubyGems, and other shared tooling is around for years to come.
44
56
 
45
57
  ### Code of Conduct
46
58
 
data/bundler/exe/bundle CHANGED
@@ -2,12 +2,10 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # Exit cleanly from an early interrupt
5
- Signal.trap("INT") { exit 1 }
6
-
7
- update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
8
- update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"
9
- ENV["BUNDLER_VERSION"] = update if update
10
- require "bundler/postit_trampoline"
5
+ Signal.trap("INT") do
6
+ Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
7
+ exit 1
8
+ end
11
9
 
12
10
  require "bundler"
13
11
  # Check if an older version of bundler is installed
@@ -25,7 +23,7 @@ Bundler.with_friendly_errors do
25
23
  require "bundler/cli"
26
24
 
27
25
  # Allow any command to use --help flag to show help for that command
28
- help_flags = %w(--help -h)
26
+ help_flags = %w[--help -h]
29
27
  help_flag_used = ARGV.any? {|a| help_flags.include? a }
30
28
  args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
31
29
 
@@ -1,12 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "bundler/shared_helpers"
5
+
6
+ Bundler::SharedHelpers.major_deprecation(2, "the bundle_ruby executable has been removed in favor of `bundle platform --ruby`")
7
+
4
8
  Signal.trap("INT") { exit 1 }
5
9
 
6
10
  require "bundler/errors"
7
11
  require "bundler/ruby_version"
8
12
  require "bundler/ruby_dsl"
9
- require "bundler/shared_helpers"
10
13
 
11
14
  module Bundler
12
15
  class Dsl
@@ -42,8 +45,6 @@ module Bundler
42
45
  end
43
46
  end
44
47
 
45
- Bundler::SharedHelpers.major_deprecation("the bundle_ruby executable has been removed in favor of `bundle platform --ruby`")
46
-
47
48
  dsl = Bundler::Dsl.new
48
49
  begin
49
50
  dsl.eval_gemfile(Bundler::SharedHelpers.default_gemfile)
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
- require "fileutils"
2
+
3
+ require "bundler/compatibility_guard"
4
+
5
+ require "bundler/vendored_fileutils"
3
6
  require "pathname"
4
7
  require "rbconfig"
5
8
  require "thread"
6
- require "tmpdir"
7
9
 
8
10
  require "bundler/errors"
9
11
  require "bundler/environment_preserver"
@@ -13,9 +15,10 @@ require "bundler/rubygems_integration"
13
15
  require "bundler/version"
14
16
  require "bundler/constants"
15
17
  require "bundler/current_ruby"
18
+ require "bundler/build_metadata"
16
19
 
17
20
  module Bundler
18
- environment_preserver = EnvironmentPreserver.new(ENV, %w(PATH GEM_PATH))
21
+ environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
19
22
  ORIGINAL_ENV = environment_preserver.restore
20
23
  ENV.replace(environment_preserver.backup)
21
24
  SUDO_MUTEX = Mutex.new
@@ -40,8 +43,7 @@ module Bundler
40
43
  autoload :LazySpecification, "bundler/lazy_specification"
41
44
  autoload :LockfileParser, "bundler/lockfile_parser"
42
45
  autoload :MatchPlatform, "bundler/match_platform"
43
- autoload :Mirror, "bundler/mirror"
44
- autoload :Mirrors, "bundler/mirror"
46
+ autoload :ProcessLock, "bundler/process_lock"
45
47
  autoload :RemoteSpecification, "bundler/remote_specification"
46
48
  autoload :Resolver, "bundler/resolver"
47
49
  autoload :Retry, "bundler/retry"
@@ -57,10 +59,9 @@ module Bundler
57
59
  autoload :StubSpecification, "bundler/stub_specification"
58
60
  autoload :UI, "bundler/ui"
59
61
  autoload :URICredentialsFilter, "bundler/uri_credentials_filter"
62
+ autoload :VersionRanges, "bundler/version_ranges"
60
63
 
61
64
  class << self
62
- attr_writer :bundle_path
63
-
64
65
  def configure
65
66
  @configured ||= configure_gem_home_and_path
66
67
  end
@@ -76,7 +77,11 @@ module Bundler
76
77
 
77
78
  # Returns absolute path of where gems are installed on the filesystem.
78
79
  def bundle_path
79
- @bundle_path ||= Pathname.new(settings.path).expand_path(root)
80
+ @bundle_path ||= Pathname.new(configured_bundle_path.path).expand_path(root)
81
+ end
82
+
83
+ def configured_bundle_path
84
+ @configured_bundle_path ||= settings.path.tap(&:validate!)
80
85
  end
81
86
 
82
87
  # Returns absolute location of where binstubs are installed to.
@@ -114,7 +119,7 @@ module Bundler
114
119
  end
115
120
 
116
121
  def environment
117
- SharedHelpers.major_deprecation "Bundler.environment has been removed in favor of Bundler.load"
122
+ SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load"
118
123
  load
119
124
  end
120
125
 
@@ -131,11 +136,17 @@ module Bundler
131
136
  end
132
137
  end
133
138
 
139
+ def frozen?
140
+ frozen = settings[:deployment]
141
+ frozen ||= settings[:frozen] unless feature_flag.deployment_means_frozen?
142
+ frozen
143
+ end
144
+
134
145
  def locked_gems
135
146
  @locked_gems ||=
136
147
  if defined?(@definition) && @definition
137
148
  definition.locked_gems
138
- elsif Bundler.default_lockfile.exist?
149
+ elsif Bundler.default_lockfile.file?
139
150
  lock = Bundler.read_file(Bundler.default_lockfile)
140
151
  LockfileParser.new(lock)
141
152
  end
@@ -148,34 +159,38 @@ module Bundler
148
159
  def user_home
149
160
  @user_home ||= begin
150
161
  home = Bundler.rubygems.user_home
151
- warning = "Your home directory is not set properly:"
152
- if home.nil?
153
- warning += "\n * It is not set at all"
162
+
163
+ warning = if home.nil?
164
+ "Your home directory is not set."
154
165
  elsif !File.directory?(home)
155
- warning += "\n * `#{home}` is not a directory"
166
+ "`#{home}` is not a directory."
156
167
  elsif !File.writable?(home)
157
- warning += "\n * `#{home}` is not writable"
158
- else
159
- return @user_home = Pathname.new(home)
168
+ "`#{home}` is not writable."
160
169
  end
161
170
 
162
- login = Etc.getlogin || "unknown"
163
-
164
- tmp_home = Pathname.new(Dir.tmpdir).join("bundler", "home", login)
165
- begin
166
- SharedHelpers.filesystem_access(tmp_home, :write) do |p|
167
- FileUtils.mkdir_p(p)
168
- end
169
- rescue => e
170
- warning += "\n\nBundler also failed to create a temporary home directory at `#{tmp_home}`:\n#{e}"
171
- raise warning
171
+ if warning
172
+ user_home = tmp_home_path(Etc.getlogin, warning)
173
+ Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
174
+ user_home
175
+ else
176
+ Pathname.new(home)
172
177
  end
178
+ end
179
+ end
173
180
 
174
- warning += "\n\nBundler will use `#{tmp_home}` as your home directory temporarily"
175
-
176
- Bundler.ui.warn(warning)
177
- tmp_home
181
+ def tmp_home_path(login, warning)
182
+ login ||= "unknown"
183
+ Kernel.send(:require, "tmpdir")
184
+ path = Pathname.new(Dir.tmpdir).join("bundler", "home")
185
+ SharedHelpers.filesystem_access(path) do |tmp_home_path|
186
+ unless tmp_home_path.exist?
187
+ tmp_home_path.mkpath
188
+ tmp_home_path.chmod(0o777)
189
+ end
190
+ tmp_home_path.join(login).tap(&:mkpath)
178
191
  end
192
+ rescue => e
193
+ raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
179
194
  end
180
195
 
181
196
  def user_bundle_path
@@ -194,17 +209,13 @@ module Bundler
194
209
  bundle_path.join("specifications")
195
210
  end
196
211
 
197
- def cache
198
- bundle_path.join("cache/bundler")
199
- end
200
-
201
212
  def user_cache
202
213
  user_bundle_path.join("cache")
203
214
  end
204
215
 
205
216
  def root
206
217
  @root ||= begin
207
- default_gemfile.dirname.expand_path
218
+ SharedHelpers.root
208
219
  rescue GemfileNotFound
209
220
  bundle_dir = default_bundle_dir
210
221
  raise GemfileNotFound, "Could not locate Gemfile or .bundle/ directory" unless bundle_dir
@@ -213,8 +224,8 @@ module Bundler
213
224
  end
214
225
 
215
226
  def app_config_path
216
- if ENV["BUNDLE_APP_CONFIG"]
217
- Pathname.new(ENV["BUNDLE_APP_CONFIG"]).expand_path(root)
227
+ if app_config = ENV["BUNDLE_APP_CONFIG"]
228
+ Pathname.new(app_config).expand_path(root)
218
229
  else
219
230
  root.join(".bundle")
220
231
  end
@@ -222,10 +233,11 @@ module Bundler
222
233
 
223
234
  def app_cache(custom_path = nil)
224
235
  path = custom_path || root
225
- path.join(settings.app_cache_path)
236
+ Pathname.new(path).join(settings.app_cache_path)
226
237
  end
227
238
 
228
239
  def tmp(name = Process.pid.to_s)
240
+ Kernel.send(:require, "tmpdir")
229
241
  Pathname.new(Dir.mktmpdir(["bundler", name]))
230
242
  end
231
243
 
@@ -255,7 +267,7 @@ EOF
255
267
  # @deprecated Use `original_env` instead
256
268
  # @return [Hash] Environment with all bundler-related variables removed
257
269
  def clean_env
258
- Bundler::SharedHelpers.major_deprecation("`Bundler.clean_env` has weird edge cases, use `.original_env` instead")
270
+ Bundler::SharedHelpers.major_deprecation(2, "`Bundler.clean_env` has weird edge cases, use `.original_env` instead")
259
271
  env = original_env
260
272
 
261
273
  if env.key?("BUNDLER_ORIG_MANPATH")
@@ -311,21 +323,25 @@ EOF
311
323
  end
312
324
 
313
325
  def system_bindir
314
- # Gem.bindir doesn't always return the location that Rubygems will install
315
- # system binaries. If you put '-n foo' in your .gemrc, Rubygems will
316
- # install binstubs there instead. Unfortunately, Rubygems doesn't expose
326
+ # Gem.bindir doesn't always return the location that RubyGems will install
327
+ # system binaries. If you put '-n foo' in your .gemrc, RubyGems will
328
+ # install binstubs there instead. Unfortunately, RubyGems doesn't expose
317
329
  # that directory at all, so rather than parse .gemrc ourselves, we allow
318
330
  # the directory to be set as well, via `bundle config bindir foo`.
319
331
  Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
320
332
  end
321
333
 
334
+ def use_system_gems?
335
+ configured_bundle_path.use_system_gems?
336
+ end
337
+
322
338
  def requires_sudo?
323
339
  return @requires_sudo if defined?(@requires_sudo_ran)
324
340
 
325
341
  sudo_present = which "sudo" if settings.allow_sudo?
326
342
 
327
343
  if sudo_present
328
- # the bundle path and subdirectories need to be writable for Rubygems
344
+ # the bundle path and subdirectories need to be writable for RubyGems
329
345
  # to be able to unpack and install gems without exploding
330
346
  path = bundle_path
331
347
  path = path.parent until path.exist?
@@ -411,20 +427,20 @@ EOF
411
427
 
412
428
  def load_gemspec_uncached(file, validate = false)
413
429
  path = Pathname.new(file)
414
- # Eval the gemspec from its parent directory, because some gemspecs
415
- # depend on "./" relative paths.
416
- SharedHelpers.chdir(path.dirname.to_s) do
417
- contents = path.read
418
- spec = if contents[0..2] == "---" # YAML header
419
- eval_yaml_gemspec(path, contents)
420
- else
430
+ contents = path.read
431
+ spec = if contents.start_with?("---") # YAML header
432
+ eval_yaml_gemspec(path, contents)
433
+ else
434
+ # Eval the gemspec from its parent directory, because some gemspecs
435
+ # depend on "./" relative paths.
436
+ SharedHelpers.chdir(path.dirname.to_s) do
421
437
  eval_gemspec(path, contents)
422
438
  end
423
- return unless spec
424
- spec.loaded_from = path.expand_path.to_s
425
- Bundler.rubygems.validate(spec) if validate
426
- spec
427
439
  end
440
+ return unless spec
441
+ spec.loaded_from = path.expand_path.to_s
442
+ Bundler.rubygems.validate(spec) if validate
443
+ spec
428
444
  end
429
445
 
430
446
  def clear_gemspec_cache
@@ -441,18 +457,27 @@ EOF
441
457
  end
442
458
 
443
459
  def reset!
444
- @root = nil
445
- @settings = nil
460
+ reset_paths!
461
+ Plugin.reset!
462
+ reset_rubygems!
463
+ end
464
+
465
+ def reset_paths!
466
+ @bin_path = nil
467
+ @bundler_major_version = nil
468
+ @bundle_path = nil
469
+ @configured = nil
470
+ @configured_bundle_path = nil
446
471
  @definition = nil
447
- @setup = nil
448
472
  @load = nil
449
473
  @locked_gems = nil
450
- @bundle_path = nil
451
- @bin_path = nil
474
+ @root = nil
475
+ @settings = nil
476
+ @setup = nil
452
477
  @user_home = nil
478
+ end
453
479
 
454
- Plugin.reset!
455
-
480
+ def reset_rubygems!
456
481
  return unless defined?(@rubygems) && @rubygems
457
482
  rubygems.undo_replacements
458
483
  rubygems.reset
@@ -462,6 +487,8 @@ EOF
462
487
  private
463
488
 
464
489
  def eval_yaml_gemspec(path, contents)
490
+ Kernel.send(:require, "bundler/psyched_yaml")
491
+
465
492
  # If the YAML is invalid, Syck raises an ArgumentError, and Psych
466
493
  # raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
467
494
  Gem::Specification.from_yaml(contents)
@@ -470,7 +497,7 @@ EOF
470
497
  end
471
498
 
472
499
  def eval_gemspec(path, contents)
473
- eval(contents, TOPLEVEL_BINDING, path.expand_path.to_s)
500
+ eval(contents, TOPLEVEL_BINDING.dup, path.expand_path.to_s)
474
501
  rescue ScriptError, StandardError => e
475
502
  msg = "There was an error while loading `#{path.basename}`: #{e.message}"
476
503
 
@@ -487,14 +514,14 @@ EOF
487
514
  bundle_path
488
515
  end
489
516
 
490
- def configure_gem_path(env = ENV, settings = self.settings)
517
+ def configure_gem_path(env = ENV)
491
518
  blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
492
- if settings[:disable_shared_gems]
519
+ if !use_system_gems?
493
520
  # this needs to be empty string to cause
494
521
  # PathSupport.split_gem_path to only load up the
495
522
  # Bundler --path setting as the GEM_PATH.
496
523
  env["GEM_PATH"] = ""
497
- elsif blank_home || Bundler.rubygems.gem_dir != bundle_path.to_s
524
+ elsif blank_home
498
525
  possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
499
526
  paths = possibles.flatten.compact.uniq.reject(&:empty?)
500
527
  env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
@@ -502,14 +529,7 @@ EOF
502
529
  end
503
530
 
504
531
  def configure_gem_home
505
- # TODO: This mkdir_p is only needed for JRuby <= 1.5 and should go away (GH #602)
506
- begin
507
- FileUtils.mkdir_p bundle_path.to_s
508
- rescue
509
- nil
510
- end
511
-
512
- ENV["GEM_HOME"] = File.expand_path(bundle_path, root)
532
+ Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
513
533
  Bundler.rubygems.clear_paths
514
534
  end
515
535