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
  module Bundler
3
4
  class CLI::Init
4
5
  attr_reader :options
@@ -7,8 +8,8 @@ module Bundler
7
8
  end
8
9
 
9
10
  def run
10
- if File.exist?("Gemfile")
11
- Bundler.ui.error "Gemfile already exists at #{SharedHelpers.pwd}/Gemfile"
11
+ if File.exist?(gemfile)
12
+ Bundler.ui.error "#{gemfile} already exists at #{File.expand_path(gemfile)}"
12
13
  exit 1
13
14
  end
14
15
 
@@ -18,15 +19,27 @@ module Bundler
18
19
  Bundler.ui.error "Gem specification #{gemspec} doesn't exist"
19
20
  exit 1
20
21
  end
21
- spec = Gem::Specification.load(gemspec)
22
- puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
23
- File.open("Gemfile", "wb") do |file|
22
+
23
+ spec = Bundler.load_gemspec_uncached(gemspec)
24
+
25
+ File.open(gemfile, "wb") do |file|
24
26
  file << "# Generated from #{gemspec}\n"
25
27
  file << spec.to_gemfile
26
28
  end
27
29
  else
28
- puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
29
- FileUtils.cp(File.expand_path("../../templates/Gemfile", __FILE__), "Gemfile")
30
+ FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
31
+ end
32
+
33
+ puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
34
+ end
35
+
36
+ private
37
+
38
+ def gemfile
39
+ @gemfile ||= begin
40
+ Bundler.default_gemfile
41
+ rescue GemfileNotFound
42
+ Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile"
30
43
  end
31
44
  end
32
45
  end
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  class CLI::Inject
4
5
  attr_reader :options, :name, :version, :group, :source, :gems
5
- def initialize(options, name, version, gems)
6
+ def initialize(options, name, version)
6
7
  @options = options
7
8
  @name = name
8
9
  @version = version || last_version_number
9
- @group = options[:group]
10
+ @group = options[:group].split(",") unless options[:group].nil?
10
11
  @source = options[:source]
11
- @gems = gems
12
+ @gems = []
12
13
  end
13
14
 
14
15
  def run
@@ -18,6 +19,8 @@ module Bundler
18
19
 
19
20
  # Build an array of Dependency objects out of the arguments
20
21
  deps = []
22
+ # when `inject` support addition of more than one gem, then this loop will
23
+ # help. Currently this loop is running once.
21
24
  gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
22
25
  ops = Gem::Requirement::OPS.map {|key, _val| key }
23
26
  has_op = ops.any? {|op| gem_version.start_with? op }
@@ -29,7 +32,13 @@ module Bundler
29
32
 
30
33
  if added.any?
31
34
  Bundler.ui.confirm "Added to Gemfile:"
32
- Bundler.ui.confirm added.map {|g| " #{g}" }.join("\n")
35
+ Bundler.ui.confirm(added.map do |d|
36
+ name = "'#{d.name}'"
37
+ requirement = ", '#{d.requirement}'"
38
+ group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
39
+ source = ", :source => '#{d.source}'" unless d.source.nil?
40
+ %(gem #{name}#{requirement}#{group}#{source})
41
+ end.join("\n"))
33
42
  else
34
43
  Bundler.ui.confirm "All gems were already present in the Gemfile"
35
44
  end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require "bundler/cli/common"
3
2
 
4
3
  module Bundler
5
4
  class CLI::Install
@@ -13,19 +12,9 @@ module Bundler
13
12
 
14
13
  warn_if_root
15
14
 
16
- warn_if_outdated
17
-
18
- [:with, :without].each do |option|
19
- if options[option]
20
- options[option] = options[option].join(":").tr(" ", ":").split(":")
21
- end
22
- end
23
-
24
- check_for_group_conflicts
25
-
26
15
  normalize_groups
27
16
 
28
- ENV["RB_USER_INSTALL"] = "1" if Bundler::FREEBSD
17
+ Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
29
18
 
30
19
  # Disable color in deployment mode
31
20
  Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
@@ -34,22 +23,28 @@ module Bundler
34
23
 
35
24
  check_trust_policy
36
25
 
37
- if options[:deployment] || options[:frozen]
26
+ if options[:deployment] || options[:frozen] || Bundler.frozen?
38
27
  unless Bundler.default_lockfile.exist?
39
- flag = options[:deployment] ? "--deployment" : "--frozen"
40
- raise ProductionError, "The #{flag} flag requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
28
+ flag = "--deployment flag" if options[:deployment]
29
+ flag ||= "--frozen flag" if options[:frozen]
30
+ flag ||= "deployment setting"
31
+ raise ProductionError, "The #{flag} requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
41
32
  "sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
42
33
  "before deploying."
43
34
  end
44
35
 
45
36
  options[:local] = true if Bundler.app_cache.exist?
46
37
 
47
- Bundler.settings[:frozen] = "1"
38
+ if Bundler.feature_flag.deployment_means_frozen?
39
+ Bundler.settings.set_command_option :deployment, true
40
+ else
41
+ Bundler.settings.set_command_option :frozen, true
42
+ end
48
43
  end
49
44
 
50
45
  # When install is called with --no-deployment, disable deployment mode
51
46
  if options[:deployment] == false
52
- Bundler.settings.delete(:frozen)
47
+ Bundler.settings.set_command_option :frozen, nil
53
48
  options[:system] = true
54
49
  end
55
50
 
@@ -58,7 +53,7 @@ module Bundler
58
53
  Bundler::Fetcher.disable_endpoint = options["full-index"]
59
54
 
60
55
  if options["binstubs"]
61
- Bundler::SharedHelpers.major_deprecation \
56
+ Bundler::SharedHelpers.major_deprecation 2,
62
57
  "The --binstubs option will be removed in favor of `bundle binstubs`"
63
58
  end
64
59
 
@@ -68,24 +63,24 @@ module Bundler
68
63
  definition.validate_runtime!
69
64
 
70
65
  installer = Installer.install(Bundler.root, definition, options)
71
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.settings[:frozen]
66
+ Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen?
72
67
 
73
68
  Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
74
69
  Bundler::CLI::Common.output_without_groups_message
75
70
 
76
- if Bundler.settings[:path]
77
- absolute_path = File.expand_path(Bundler.settings[:path])
78
- relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
79
- Bundler.ui.confirm "Bundled gems are installed into #{relative_path}."
71
+ if Bundler.use_system_gems?
72
+ Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
80
73
  else
81
- Bundler.ui.confirm "Use `bundle show [gemname]` to see where a bundled gem is installed."
74
+ absolute_path = File.expand_path(Bundler.configured_bundle_path.base_path)
75
+ relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
76
+ Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`"
82
77
  end
83
78
 
84
79
  Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
85
80
 
86
81
  warn_ambiguous_gems
87
82
 
88
- if Bundler.settings[:clean] && Bundler.settings[:path]
83
+ if CLI::Common.clean_after_install?
89
84
  require "bundler/cli/clean"
90
85
  Bundler::CLI::Clean.new(options).run
91
86
  end
@@ -116,20 +111,6 @@ module Bundler
116
111
  "application for all non-root users on this machine.", :wrap => true
117
112
  end
118
113
 
119
- def warn_if_outdated
120
- return if ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"].nil?
121
- installed_version = Gem::Version.new(ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"].dup)
122
- running_version = Gem::Version.new(Bundler::VERSION)
123
- return if Gem::Requirement.new(installed_version).satisfied_by?(running_version)
124
- if Bundler.settings[:warned_version].nil? || running_version > Gem::Version.new(Bundler.settings[:warned_version])
125
- Bundler.settings[:warned_version] = running_version
126
- Bundler.ui.warn "You're running Bundler #{installed_version} but this " \
127
- "project uses #{running_version}. To update, run `bundle update " \
128
- "--bundler`. You won't see this message again unless you upgrade " \
129
- "to a newer version of Bundler.", :wrap => true
130
- end
131
- end
132
-
133
114
  def dependencies_count_for(definition)
134
115
  count = definition.dependencies.count
135
116
  "#{count} Gemfile #{count == 1 ? "dependency" : "dependencies"}"
@@ -140,15 +121,11 @@ module Bundler
140
121
  "#{count} #{count == 1 ? "gem" : "gems"} now installed"
141
122
  end
142
123
 
143
- def check_for_group_conflicts
144
- if options[:without] && options[:with]
145
- conflicting_groups = options[:without] & options[:with]
146
- unless conflicting_groups.empty?
147
- Bundler.ui.error "You can't list a group in both, --with and --without." \
148
- "The offending groups are: #{conflicting_groups.join(", ")}."
149
- exit 1
150
- end
151
- end
124
+ def check_for_group_conflicts_in_cli_options
125
+ conflicting_groups = Array(options[:without]) & Array(options[:with])
126
+ return if conflicting_groups.empty?
127
+ raise InvalidOption, "You can't list a group in both with and without." \
128
+ " The offending groups are: #{conflicting_groups.join(", ")}."
152
129
  end
153
130
 
154
131
  def check_for_options_conflicts
@@ -161,28 +138,29 @@ module Bundler
161
138
  end
162
139
 
163
140
  def check_trust_policy
164
- if options["trust-policy"]
165
- unless Bundler.rubygems.security_policies.keys.include?(options["trust-policy"])
166
- Bundler.ui.error "Rubygems doesn't know about trust policy '#{options["trust-policy"]}'. " \
167
- "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
168
- exit 1
169
- end
170
- Bundler.settings["trust-policy"] = options["trust-policy"]
171
- else
172
- Bundler.settings["trust-policy"] = nil if Bundler.settings["trust-policy"]
141
+ trust_policy = options["trust-policy"]
142
+ unless Bundler.rubygems.security_policies.keys.unshift(nil).include?(trust_policy)
143
+ raise InvalidOption, "RubyGems doesn't know about trust policy '#{trust_policy}'. " \
144
+ "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
173
145
  end
146
+ Bundler.settings.set_command_option_if_given :"trust-policy", trust_policy
174
147
  end
175
148
 
176
149
  def normalize_groups
177
- Bundler.settings.with = [] if options[:with] && options[:with].empty?
178
- Bundler.settings.without = [] if options[:without] && options[:without].empty?
150
+ options[:with] &&= options[:with].join(":").tr(" ", ":").split(":")
151
+ options[:without] &&= options[:without].join(":").tr(" ", ":").split(":")
152
+
153
+ check_for_group_conflicts_in_cli_options
179
154
 
180
- with = options.fetch("with", [])
181
- with |= Bundler.settings.with.map(&:to_s)
155
+ Bundler.settings.set_command_option :with, nil if options[:with] == []
156
+ Bundler.settings.set_command_option :without, nil if options[:without] == []
157
+
158
+ with = options.fetch(:with, [])
159
+ with |= Bundler.settings[:with].map(&:to_s)
182
160
  with -= options[:without] if options[:without]
183
161
 
184
- without = options.fetch("without", [])
185
- without |= Bundler.settings.without.map(&:to_s)
162
+ without = options.fetch(:without, [])
163
+ without |= Bundler.settings[:without].map(&:to_s)
186
164
  without -= options[:with] if options[:with]
187
165
 
188
166
  options[:with] = with
@@ -190,28 +168,34 @@ module Bundler
190
168
  end
191
169
 
192
170
  def normalize_settings
193
- Bundler.settings[:path] = nil if options[:system]
194
- Bundler.settings[:path] = "vendor/bundle" if options[:deployment]
195
- Bundler.settings[:path] = options["path"] if options["path"]
196
- Bundler.settings[:path] ||= "bundle" if options["standalone"]
171
+ Bundler.settings.set_command_option :path, nil if options[:system]
172
+ Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment]
173
+ Bundler.settings.set_command_option_if_given :path, options["path"]
174
+ Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
197
175
 
198
- Bundler.settings[:bin] = options["binstubs"] if options["binstubs"]
199
- Bundler.settings[:bin] = nil if options["binstubs"] && options["binstubs"].empty?
176
+ bin_option = options["binstubs"]
177
+ bin_option = nil if bin_option && bin_option.empty?
178
+ Bundler.settings.set_command_option :bin, bin_option if options["binstubs"]
200
179
 
201
- Bundler.settings[:shebang] = options["shebang"] if options["shebang"]
180
+ Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
202
181
 
203
- Bundler.settings[:jobs] = options["jobs"] if options["jobs"]
182
+ Bundler.settings.set_command_option_if_given :jobs, options["jobs"]
204
183
 
205
- Bundler.settings[:no_prune] = true if options["no-prune"]
184
+ Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
206
185
 
207
- Bundler.settings[:no_install] = true if options["no-install"]
186
+ Bundler.settings.set_command_option_if_given :no_install, options["no-install"]
208
187
 
209
- Bundler.settings[:clean] = options["clean"] if options["clean"]
188
+ Bundler.settings.set_command_option_if_given :clean, options["clean"]
210
189
 
211
- Bundler.settings.without = options[:without]
212
- Bundler.settings.with = options[:with]
190
+ unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
191
+ # need to nil them out first to get around validation for backwards compatibility
192
+ Bundler.settings.set_command_option :without, nil
193
+ Bundler.settings.set_command_option :with, nil
194
+ Bundler.settings.set_command_option :without, options[:without] - options[:with]
195
+ Bundler.settings.set_command_option :with, options[:with]
196
+ end
213
197
 
214
- Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? true : nil
198
+ options[:force] = options[:redownload]
215
199
  end
216
200
 
217
201
  def warn_ambiguous_gems
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rbconfig"
4
+
5
+ module Bundler
6
+ class CLI::Issue
7
+ def run
8
+ Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
9
+ Did you find an issue with Bundler? Before filing a new issue,
10
+ be sure to check out these resources:
11
+
12
+ 1. Check out our troubleshooting guide for quick fixes to common issues:
13
+ https://github.com/bundler/bundler/blob/master/doc/TROUBLESHOOTING.md
14
+
15
+ 2. Instructions for common Bundler uses can be found on the documentation
16
+ site: http://bundler.io/
17
+
18
+ 3. Information about each Bundler command can be found in the Bundler
19
+ man pages: http://bundler.io/man/bundle.1.html
20
+
21
+ Hopefully the troubleshooting steps above resolved your problem! If things
22
+ still aren't working the way you expect them to, please let us know so
23
+ that we can diagnose and help fix the problem you're having. Please
24
+ view the Filing Issues guide for more information:
25
+ https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md
26
+
27
+ EOS
28
+
29
+ Bundler.ui.info Bundler::Env.report
30
+
31
+ Bundler.ui.info "\n## Bundle Doctor"
32
+ doctor
33
+ end
34
+
35
+ def doctor
36
+ require "bundler/cli/doctor"
37
+ Bundler::CLI::Doctor.new({}).run
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::List
5
+ def initialize(options)
6
+ @options = options
7
+ end
8
+
9
+ def run
10
+ specs = Bundler.load.specs.reject {|s| s.name == "bundler" }.sort_by(&:name)
11
+ return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
12
+
13
+ return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
14
+ Bundler.ui.info "Gems included by the bundle:"
15
+ specs.each do |s|
16
+ Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})"
17
+ end
18
+
19
+ Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require "bundler/cli/common"
3
2
 
4
3
  module Bundler
5
4
  class CLI::Lock
@@ -22,7 +21,10 @@ module Bundler
22
21
  Bundler::Fetcher.disable_endpoint = options["full-index"]
23
22
 
24
23
  update = options[:update]
25
- update = { :gems => update, :lock_shared_dependencies => options[:conservative] } if update.is_a?(Array)
24
+ if update.is_a?(Array) # unlocking specific gems
25
+ Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
26
+ update = { :gems => update, :lock_shared_dependencies => options[:conservative] }
27
+ end
26
28
  definition = Bundler.definition(update)
27
29
 
28
30
  Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options) if options[:update]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "bundler/cli/common"
2
+
3
3
  require "shellwords"
4
4
 
5
5
  module Bundler
@@ -17,7 +17,7 @@ module Bundler
17
17
  path = spec.full_gem_path
18
18
  Dir.chdir(path) do
19
19
  command = Shellwords.split(editor) + [path]
20
- Bundler.with_clean_env do
20
+ Bundler.with_original_env do
21
21
  system(*command)
22
22
  end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
23
23
  end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require "bundler/cli/common"
3
2
 
4
3
  module Bundler
5
4
  class CLI::Outdated
@@ -20,7 +19,7 @@ module Bundler
20
19
  end
21
20
 
22
21
  Bundler.definition.validate_runtime!
23
- current_specs = Bundler.ui.silence { Bundler.load.specs }
22
+ current_specs = Bundler.ui.silence { Bundler.definition.resolve }
24
23
  current_dependencies = {}
25
24
  Bundler.ui.silence do
26
25
  Bundler.load.dependencies.each do |dep|
@@ -46,11 +45,10 @@ module Bundler
46
45
  Bundler::CLI::Common.patch_level_options(options).any?
47
46
 
48
47
  filter_options_patch = options.keys &
49
- %w(filter-major filter-minor filter-patch)
48
+ %w[filter-major filter-minor filter-patch]
50
49
 
51
50
  definition_resolution = proc do
52
- return definition.resolve_with_cache! if options[:local]
53
- definition.resolve_remotely!
51
+ options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
54
52
  end
55
53
 
56
54
  if options[:parseable]
@@ -81,25 +79,22 @@ module Bundler
81
79
  end
82
80
 
83
81
  gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
84
- if gem_outdated || (current_spec.git_version != active_spec.git_version)
85
- groups = nil
86
- if dependency && !options[:parseable]
87
- groups = dependency.groups.join(", ")
88
- end
89
-
90
- outdated_gems_list << { :active_spec => active_spec,
91
- :current_spec => current_spec,
92
- :dependency => dependency,
93
- :groups => groups }
94
-
95
- outdated_gems_by_groups[groups] ||= []
96
- outdated_gems_by_groups[groups] << { :active_spec => active_spec,
97
- :current_spec => current_spec,
98
- :dependency => dependency,
99
- :groups => groups }
82
+ next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
83
+ groups = nil
84
+ if dependency && !options[:parseable]
85
+ groups = dependency.groups.join(", ")
100
86
  end
101
87
 
102
- Bundler.ui.debug "from #{active_spec.loaded_from}"
88
+ outdated_gems_list << { :active_spec => active_spec,
89
+ :current_spec => current_spec,
90
+ :dependency => dependency,
91
+ :groups => groups }
92
+
93
+ outdated_gems_by_groups[groups] ||= []
94
+ outdated_gems_by_groups[groups] << { :active_spec => active_spec,
95
+ :current_spec => current_spec,
96
+ :dependency => dependency,
97
+ :groups => groups }
103
98
  end
104
99
 
105
100
  if outdated_gems_list.empty?
@@ -196,6 +191,7 @@ module Bundler
196
191
 
197
192
  def print_gem(current_spec, active_spec, dependency, groups, options_include_groups)
198
193
  spec_version = "#{active_spec.version}#{active_spec.git_version}"
194
+ spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
199
195
  current_version = "#{current_spec.version}#{current_spec.git_version}"
200
196
 
201
197
  if dependency && dependency.specific?
@@ -217,13 +213,19 @@ module Bundler
217
213
  end
218
214
 
219
215
  def check_for_deployment_mode
220
- if Bundler.settings[:frozen]
221
- raise ProductionError, "You are trying to check outdated gems in " \
222
- "deployment mode. Run `bundle outdated` elsewhere.\n" \
223
- "\nIf this is a development machine, remove the " \
224
- "#{Bundler.default_gemfile} freeze" \
225
- "\nby running `bundle install --no-deployment`."
216
+ return unless Bundler.frozen?
217
+ suggested_command = if Bundler.settings.locations("frozen")[:global]
218
+ "bundle config --delete frozen"
219
+ elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
220
+ "bundle config --delete deployment"
221
+ else
222
+ "bundle install --no-deployment"
226
223
  end
224
+ raise ProductionError, "You are trying to check outdated gems in " \
225
+ "deployment mode. Run `bundle outdated` elsewhere.\n" \
226
+ "\nIf this is a development machine, remove the " \
227
+ "#{Bundler.default_gemfile} freeze" \
228
+ "\nby running `#{suggested_command}`."
227
229
  end
228
230
 
229
231
  def update_present_via_semver_portions(current_spec, active_spec, options)