rubygems-update 2.6.3 → 2.7.7

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 (462) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +17 -34
  3. data/CODE_OF_CONDUCT.md +36 -33
  4. data/CONTRIBUTING.rdoc +56 -55
  5. data/History.txt +467 -10
  6. data/Manifest.txt +276 -4
  7. data/POLICIES.rdoc +4 -4
  8. data/README.md +72 -0
  9. data/Rakefile +77 -10
  10. data/appveyor.yml +61 -31
  11. data/bin/gem +1 -1
  12. data/bin/update_rubygems +2 -2
  13. data/bundler/CHANGELOG.md +2910 -0
  14. data/bundler/CODE_OF_CONDUCT.md +42 -0
  15. data/bundler/CONTRIBUTING.md +17 -0
  16. data/bundler/LICENSE.md +23 -0
  17. data/bundler/README.md +63 -0
  18. data/bundler/bundler.gemspec +57 -0
  19. data/bundler/exe/bundle +31 -0
  20. data/bundler/exe/bundle_ruby +60 -0
  21. data/bundler/exe/bundler +4 -0
  22. data/bundler/lib/bundler/build_metadata.rb +36 -0
  23. data/bundler/lib/bundler/capistrano.rb +22 -0
  24. data/bundler/lib/bundler/cli/add.rb +25 -0
  25. data/bundler/lib/bundler/cli/binstubs.rb +43 -0
  26. data/bundler/lib/bundler/cli/cache.rb +36 -0
  27. data/bundler/lib/bundler/cli/check.rb +38 -0
  28. data/bundler/lib/bundler/cli/clean.rb +25 -0
  29. data/bundler/lib/bundler/cli/common.rb +102 -0
  30. data/bundler/lib/bundler/cli/config.rb +119 -0
  31. data/bundler/lib/bundler/cli/console.rb +43 -0
  32. data/bundler/lib/bundler/cli/doctor.rb +94 -0
  33. data/bundler/lib/bundler/cli/exec.rb +104 -0
  34. data/bundler/lib/bundler/cli/gem.rb +252 -0
  35. data/bundler/lib/bundler/cli/info.rb +50 -0
  36. data/bundler/lib/bundler/cli/init.rb +47 -0
  37. data/bundler/lib/bundler/cli/inject.rb +60 -0
  38. data/bundler/lib/bundler/cli/install.rb +214 -0
  39. data/bundler/lib/bundler/cli/issue.rb +40 -0
  40. data/bundler/lib/bundler/cli/list.rb +22 -0
  41. data/bundler/lib/bundler/cli/lock.rb +63 -0
  42. data/bundler/lib/bundler/cli/open.rb +26 -0
  43. data/bundler/lib/bundler/cli/outdated.rb +260 -0
  44. data/bundler/lib/bundler/cli/package.rb +49 -0
  45. data/bundler/lib/bundler/cli/platform.rb +46 -0
  46. data/bundler/lib/bundler/cli/plugin.rb +24 -0
  47. data/bundler/lib/bundler/cli/pristine.rb +43 -0
  48. data/bundler/lib/bundler/cli/show.rb +75 -0
  49. data/bundler/lib/bundler/cli/update.rb +91 -0
  50. data/bundler/lib/bundler/cli/viz.rb +31 -0
  51. data/bundler/lib/bundler/cli.rb +748 -0
  52. data/bundler/lib/bundler/compact_index_client/cache.rb +118 -0
  53. data/bundler/lib/bundler/compact_index_client/updater.rb +116 -0
  54. data/bundler/lib/bundler/compact_index_client.rb +109 -0
  55. data/bundler/lib/bundler/compatibility_guard.rb +14 -0
  56. data/bundler/lib/bundler/constants.rb +7 -0
  57. data/bundler/lib/bundler/current_ruby.rb +86 -0
  58. data/bundler/lib/bundler/definition.rb +989 -0
  59. data/bundler/lib/bundler/dep_proxy.rb +48 -0
  60. data/bundler/lib/bundler/dependency.rb +138 -0
  61. data/bundler/lib/bundler/deployment.rb +69 -0
  62. data/bundler/lib/bundler/deprecate.rb +43 -0
  63. data/bundler/lib/bundler/dsl.rb +599 -0
  64. data/bundler/lib/bundler/endpoint_specification.rb +141 -0
  65. data/bundler/lib/bundler/env.rb +153 -0
  66. data/bundler/lib/bundler/environment_preserver.rb +59 -0
  67. data/bundler/lib/bundler/errors.rb +158 -0
  68. data/bundler/lib/bundler/feature_flag.rb +67 -0
  69. data/bundler/lib/bundler/fetcher/base.rb +52 -0
  70. data/bundler/lib/bundler/fetcher/compact_index.rb +126 -0
  71. data/bundler/lib/bundler/fetcher/dependency.rb +82 -0
  72. data/bundler/lib/bundler/fetcher/downloader.rb +79 -0
  73. data/bundler/lib/bundler/fetcher/index.rb +52 -0
  74. data/bundler/lib/bundler/fetcher.rb +312 -0
  75. data/bundler/lib/bundler/friendly_errors.rb +131 -0
  76. data/bundler/lib/bundler/gem_helper.rb +202 -0
  77. data/bundler/lib/bundler/gem_helpers.rb +101 -0
  78. data/bundler/lib/bundler/gem_remote_fetcher.rb +43 -0
  79. data/bundler/lib/bundler/gem_tasks.rb +7 -0
  80. data/bundler/lib/bundler/gem_version_promoter.rb +176 -0
  81. data/bundler/lib/bundler/gemdeps.rb +29 -0
  82. data/bundler/lib/bundler/graph.rb +152 -0
  83. data/bundler/lib/bundler/index.rb +213 -0
  84. data/bundler/lib/bundler/injector.rb +94 -0
  85. data/bundler/lib/bundler/inline.rb +74 -0
  86. data/bundler/lib/bundler/installer/gem_installer.rb +83 -0
  87. data/bundler/lib/bundler/installer/parallel_installer.rb +228 -0
  88. data/bundler/lib/bundler/installer/standalone.rb +53 -0
  89. data/bundler/lib/bundler/installer.rb +295 -0
  90. data/bundler/lib/bundler/lazy_specification.rb +123 -0
  91. data/bundler/lib/bundler/lockfile_generator.rb +95 -0
  92. data/bundler/lib/bundler/lockfile_parser.rb +256 -0
  93. data/bundler/lib/bundler/match_platform.rb +24 -0
  94. data/bundler/lib/bundler/mirror.rb +223 -0
  95. data/bundler/lib/bundler/plugin/api/source.rb +306 -0
  96. data/bundler/lib/bundler/plugin/api.rb +81 -0
  97. data/bundler/lib/bundler/plugin/dsl.rb +53 -0
  98. data/bundler/lib/bundler/plugin/index.rb +162 -0
  99. data/bundler/lib/bundler/plugin/installer/git.rb +38 -0
  100. data/bundler/lib/bundler/plugin/installer/rubygems.rb +27 -0
  101. data/bundler/lib/bundler/plugin/installer.rb +96 -0
  102. data/bundler/lib/bundler/plugin/source_list.rb +27 -0
  103. data/bundler/lib/bundler/plugin.rb +285 -0
  104. data/bundler/lib/bundler/process_lock.rb +24 -0
  105. data/bundler/lib/bundler/psyched_yaml.rb +37 -0
  106. data/bundler/lib/bundler/remote_specification.rb +114 -0
  107. data/bundler/lib/bundler/resolver/spec_group.rb +110 -0
  108. data/bundler/lib/bundler/resolver.rb +372 -0
  109. data/bundler/lib/bundler/retry.rb +66 -0
  110. data/bundler/lib/bundler/ruby_dsl.rb +18 -0
  111. data/bundler/lib/bundler/ruby_version.rb +152 -0
  112. data/bundler/lib/bundler/rubygems_ext.rb +210 -0
  113. data/bundler/lib/bundler/rubygems_gem_installer.rb +99 -0
  114. data/bundler/lib/bundler/rubygems_integration.rb +898 -0
  115. data/bundler/lib/bundler/runtime.rb +316 -0
  116. data/bundler/lib/bundler/settings/validator.rb +79 -0
  117. data/bundler/lib/bundler/settings.rb +442 -0
  118. data/bundler/lib/bundler/setup.rb +28 -0
  119. data/bundler/lib/bundler/shared_helpers.rb +356 -0
  120. data/bundler/lib/bundler/similarity_detector.rb +63 -0
  121. data/bundler/lib/bundler/source/gemspec.rb +18 -0
  122. data/bundler/lib/bundler/source/git/git_proxy.rb +262 -0
  123. data/bundler/lib/bundler/source/git.rb +329 -0
  124. data/bundler/lib/bundler/source/metadata.rb +63 -0
  125. data/bundler/lib/bundler/source/path/installer.rb +74 -0
  126. data/bundler/lib/bundler/source/path.rb +249 -0
  127. data/bundler/lib/bundler/source/rubygems/remote.rb +66 -0
  128. data/bundler/lib/bundler/source/rubygems.rb +535 -0
  129. data/bundler/lib/bundler/source.rb +94 -0
  130. data/bundler/lib/bundler/source_list.rb +186 -0
  131. data/bundler/lib/bundler/spec_set.rb +192 -0
  132. data/bundler/lib/bundler/ssl_certs/.document +1 -0
  133. data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +66 -0
  134. data/bundler/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
  135. data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
  136. data/bundler/lib/bundler/stub_specification.rb +108 -0
  137. data/bundler/lib/bundler/templates/.document +1 -0
  138. data/bundler/lib/bundler/templates/Executable +29 -0
  139. data/bundler/lib/bundler/templates/Executable.bundler +105 -0
  140. data/bundler/lib/bundler/templates/Executable.standalone +14 -0
  141. data/bundler/lib/bundler/templates/Gemfile +7 -0
  142. data/bundler/lib/bundler/templates/gems.rb +8 -0
  143. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +74 -0
  144. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +6 -0
  145. data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  146. data/bundler/lib/bundler/templates/newgem/README.md.tt +47 -0
  147. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +29 -0
  148. data/bundler/lib/bundler/templates/newgem/bin/console.tt +14 -0
  149. data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  150. data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  151. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
  152. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  153. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  154. data/bundler/lib/bundler/templates/newgem/gitignore.tt +20 -0
  155. data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  156. data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
  157. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +51 -0
  158. data/bundler/lib/bundler/templates/newgem/rspec.tt +3 -0
  159. data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
  160. data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +14 -0
  161. data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
  162. data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
  163. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +5 -0
  164. data/bundler/lib/bundler/ui/rg_proxy.rb +19 -0
  165. data/bundler/lib/bundler/ui/shell.rb +146 -0
  166. data/bundler/lib/bundler/ui/silent.rb +69 -0
  167. data/bundler/lib/bundler/ui.rb +9 -0
  168. data/bundler/lib/bundler/uri_credentials_filter.rb +37 -0
  169. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
  170. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
  171. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  172. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
  173. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
  174. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
  175. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
  176. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
  177. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
  178. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
  179. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
  180. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
  181. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +126 -0
  182. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +223 -0
  183. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +138 -0
  184. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
  185. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +101 -0
  186. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +67 -0
  187. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +837 -0
  188. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +46 -0
  189. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +58 -0
  190. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +12 -0
  191. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +27 -0
  192. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +129 -0
  193. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1233 -0
  194. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +104 -0
  195. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +60 -0
  196. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
  197. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
  198. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +364 -0
  199. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +109 -0
  200. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +321 -0
  201. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +679 -0
  202. data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +135 -0
  203. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +97 -0
  204. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +12 -0
  205. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +129 -0
  206. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
  207. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
  208. data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +177 -0
  209. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
  210. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  211. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  212. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +70 -0
  213. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
  214. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +146 -0
  215. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +221 -0
  216. data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  217. data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
  218. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +324 -0
  219. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +437 -0
  220. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
  221. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
  222. data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  223. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +268 -0
  224. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  225. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +509 -0
  226. data/bundler/lib/bundler/vendored_fileutils.rb +9 -0
  227. data/bundler/lib/bundler/vendored_molinillo.rb +4 -0
  228. data/bundler/lib/bundler/vendored_persistent.rb +52 -0
  229. data/bundler/lib/bundler/vendored_thor.rb +8 -0
  230. data/bundler/lib/bundler/version.rb +28 -0
  231. data/bundler/lib/bundler/version_ranges.rb +76 -0
  232. data/bundler/lib/bundler/vlad.rb +17 -0
  233. data/bundler/lib/bundler/worker.rb +106 -0
  234. data/bundler/lib/bundler/yaml_serializer.rb +90 -0
  235. data/bundler/lib/bundler.rb +545 -0
  236. data/bundler/man/bundle-add.ronn +29 -0
  237. data/bundler/man/bundle-binstubs.ronn +43 -0
  238. data/bundler/man/bundle-check.ronn +26 -0
  239. data/bundler/man/bundle-clean.ronn +18 -0
  240. data/bundler/man/bundle-config.ronn +376 -0
  241. data/bundler/man/bundle-doctor.ronn +33 -0
  242. data/bundler/man/bundle-exec.ronn +152 -0
  243. data/bundler/man/bundle-gem.ronn +78 -0
  244. data/bundler/man/bundle-info.ronn +17 -0
  245. data/bundler/man/bundle-init.ronn +29 -0
  246. data/bundler/man/bundle-inject.ronn +22 -0
  247. data/bundler/man/bundle-install.ronn +369 -0
  248. data/bundler/man/bundle-list.ronn +15 -0
  249. data/bundler/man/bundle-lock.ronn +94 -0
  250. data/bundler/man/bundle-open.ronn +19 -0
  251. data/bundler/man/bundle-outdated.ronn +107 -0
  252. data/bundler/man/bundle-package.ronn +72 -0
  253. data/bundler/man/bundle-platform.ronn +42 -0
  254. data/bundler/man/bundle-pristine.ronn +34 -0
  255. data/bundler/man/bundle-show.ronn +20 -0
  256. data/bundler/man/bundle-update.ronn +346 -0
  257. data/bundler/man/bundle-viz.ronn +30 -0
  258. data/bundler/man/bundle.ronn +108 -0
  259. data/bundler/man/gemfile.5.ronn +506 -0
  260. data/lib/rubygems/basic_specification.rb +8 -4
  261. data/lib/rubygems/bundler_version_finder.rb +116 -0
  262. data/lib/rubygems/command.rb +10 -2
  263. data/lib/rubygems/command_manager.rb +3 -1
  264. data/lib/rubygems/commands/cert_command.rb +31 -6
  265. data/lib/rubygems/commands/cleanup_command.rb +10 -3
  266. data/lib/rubygems/commands/generate_index_command.rb +1 -1
  267. data/lib/rubygems/commands/help_command.rb +1 -1
  268. data/lib/rubygems/commands/open_command.rb +1 -1
  269. data/lib/rubygems/commands/owner_command.rb +4 -2
  270. data/lib/rubygems/commands/pristine_command.rb +11 -8
  271. data/lib/rubygems/commands/push_command.rb +3 -2
  272. data/lib/rubygems/commands/query_command.rb +17 -17
  273. data/lib/rubygems/commands/setup_command.rb +175 -70
  274. data/lib/rubygems/commands/signin_command.rb +33 -0
  275. data/lib/rubygems/commands/signout_command.rb +33 -0
  276. data/lib/rubygems/commands/sources_command.rb +1 -1
  277. data/lib/rubygems/commands/uninstall_command.rb +4 -3
  278. data/lib/rubygems/commands/unpack_command.rb +19 -7
  279. data/lib/rubygems/commands/update_command.rb +2 -2
  280. data/lib/rubygems/commands/which_command.rb +1 -1
  281. data/lib/rubygems/commands/yank_command.rb +4 -11
  282. data/lib/rubygems/config_file.rb +21 -28
  283. data/lib/rubygems/core_ext/kernel_require.rb +10 -9
  284. data/lib/rubygems/defaults.rb +18 -0
  285. data/lib/rubygems/dependency.rb +10 -4
  286. data/lib/rubygems/dependency_installer.rb +8 -2
  287. data/lib/rubygems/dependency_list.rb +1 -1
  288. data/lib/rubygems/errors.rb +4 -0
  289. data/lib/rubygems/exceptions.rb +11 -1
  290. data/lib/rubygems/ext/builder.rb +2 -2
  291. data/lib/rubygems/ext/ext_conf_builder.rb +7 -7
  292. data/lib/rubygems/ext/rake_builder.rb +2 -2
  293. data/lib/rubygems/gem_runner.rb +5 -1
  294. data/lib/rubygems/indexer.rb +6 -5
  295. data/lib/rubygems/install_update_options.rb +5 -28
  296. data/lib/rubygems/installer.rb +53 -22
  297. data/lib/rubygems/installer_test_case.rb +6 -3
  298. data/lib/rubygems/package/file_source.rb +2 -2
  299. data/lib/rubygems/package/old.rb +3 -3
  300. data/lib/rubygems/package/tar_header.rb +14 -9
  301. data/lib/rubygems/package/tar_writer.rb +12 -16
  302. data/lib/rubygems/package.rb +48 -9
  303. data/lib/rubygems/platform.rb +1 -1
  304. data/lib/rubygems/remote_fetcher.rb +13 -18
  305. data/lib/rubygems/request.rb +47 -1
  306. data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
  307. data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
  308. data/lib/rubygems/request_set/lockfile.rb +1 -1
  309. data/lib/rubygems/request_set.rb +22 -3
  310. data/lib/rubygems/requirement.rb +5 -1
  311. data/lib/rubygems/resolver/installer_set.rb +4 -6
  312. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
  313. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
  314. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
  315. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +65 -0
  316. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
  317. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
  318. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +60 -0
  319. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +125 -0
  320. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
  321. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
  322. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +125 -0
  323. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +78 -147
  324. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
  325. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  326. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +1 -1
  327. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +110 -75
  328. data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +4 -2
  329. data/lib/rubygems/resolver/set.rb +1 -1
  330. data/lib/rubygems/resolver.rb +61 -5
  331. data/lib/rubygems/safe_yaml.rb +51 -0
  332. data/lib/rubygems/security/signer.rb +2 -0
  333. data/lib/rubygems/security/trust_dir.rb +1 -1
  334. data/lib/rubygems/security.rb +12 -5
  335. data/lib/rubygems/security_option.rb +43 -0
  336. data/lib/rubygems/server.rb +49 -40
  337. data/lib/rubygems/source/git.rb +2 -1
  338. data/lib/rubygems/source/local.rb +38 -35
  339. data/lib/rubygems/source/lock.rb +4 -1
  340. data/lib/rubygems/source.rb +9 -6
  341. data/lib/rubygems/source_local.rb +3 -1
  342. data/lib/rubygems/source_specific_file.rb +3 -2
  343. data/lib/rubygems/spec_fetcher.rb +7 -3
  344. data/lib/rubygems/specification.rb +317 -251
  345. data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
  346. data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
  347. data/lib/rubygems/stub_specification.rb +10 -4
  348. data/lib/rubygems/test_case.rb +51 -11
  349. data/lib/rubygems/test_utilities.rb +2 -2
  350. data/lib/rubygems/text.rb +14 -1
  351. data/lib/rubygems/user_interaction.rb +22 -20
  352. data/lib/rubygems/util/licenses.rb +37 -0
  353. data/lib/rubygems/util.rb +6 -16
  354. data/lib/rubygems/validator.rb +3 -3
  355. data/lib/rubygems/version.rb +24 -5
  356. data/lib/rubygems/version_option.rb +6 -1
  357. data/lib/rubygems.rb +147 -45
  358. data/lib/ubygems.rb +3 -0
  359. data/setup.rb +1 -1
  360. data/test/rubygems/alternate_cert.pem +10 -9
  361. data/test/rubygems/alternate_cert_32.pem +10 -9
  362. data/test/rubygems/child_cert.pem +11 -9
  363. data/test/rubygems/child_cert_32.pem +11 -9
  364. data/test/rubygems/encrypted_private_key.pem +26 -26
  365. data/test/rubygems/expired_cert.pem +9 -8
  366. data/test/rubygems/future_cert.pem +9 -8
  367. data/test/rubygems/future_cert_32.pem +9 -8
  368. data/test/rubygems/grandchild_cert.pem +11 -9
  369. data/test/rubygems/grandchild_cert_32.pem +11 -9
  370. data/test/rubygems/invalid_issuer_cert.pem +11 -9
  371. data/test/rubygems/invalid_issuer_cert_32.pem +11 -9
  372. data/test/rubygems/invalid_signer_cert.pem +10 -9
  373. data/test/rubygems/invalid_signer_cert_32.pem +10 -9
  374. data/test/rubygems/invalidchild_cert.pem +11 -9
  375. data/test/rubygems/invalidchild_cert_32.pem +11 -9
  376. data/test/rubygems/private3072_key.pem +40 -0
  377. data/test/rubygems/public3072_cert.pem +25 -0
  378. data/test/rubygems/public_cert.pem +11 -9
  379. data/test/rubygems/public_cert_32.pem +10 -9
  380. data/test/rubygems/rubygems_plugin.rb +4 -0
  381. data/test/rubygems/test_bundled_ca.rb +1 -1
  382. data/test/rubygems/test_config.rb +1 -1
  383. data/test/rubygems/test_gem.rb +168 -55
  384. data/test/rubygems/test_gem_bundler_version_finder.rb +125 -0
  385. data/test/rubygems/test_gem_command.rb +7 -1
  386. data/test/rubygems/test_gem_commands_build_command.rb +27 -1
  387. data/test/rubygems/test_gem_commands_cert_command.rb +64 -0
  388. data/test/rubygems/test_gem_commands_cleanup_command.rb +44 -1
  389. data/test/rubygems/test_gem_commands_install_command.rb +36 -2
  390. data/test/rubygems/test_gem_commands_open_command.rb +2 -1
  391. data/test/rubygems/test_gem_commands_owner_command.rb +25 -0
  392. data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
  393. data/test/rubygems/test_gem_commands_push_command.rb +5 -5
  394. data/test/rubygems/test_gem_commands_query_command.rb +154 -1
  395. data/test/rubygems/test_gem_commands_setup_command.rb +140 -10
  396. data/test/rubygems/test_gem_commands_signin_command.rb +98 -0
  397. data/test/rubygems/test_gem_commands_signout_command.rb +37 -0
  398. data/test/rubygems/test_gem_commands_sources_command.rb +52 -0
  399. data/test/rubygems/test_gem_commands_uninstall_command.rb +14 -2
  400. data/test/rubygems/test_gem_commands_update_command.rb +1 -7
  401. data/test/rubygems/test_gem_commands_which_command.rb +3 -3
  402. data/test/rubygems/test_gem_config_file.rb +1 -2
  403. data/test/rubygems/test_gem_dependency.rb +28 -0
  404. data/test/rubygems/test_gem_dependency_installer.rb +1 -1
  405. data/test/rubygems/test_gem_doctor.rb +2 -2
  406. data/test/rubygems/test_gem_ext_builder.rb +8 -8
  407. data/test/rubygems/test_gem_ext_configure_builder.rb +1 -1
  408. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +23 -0
  409. data/test/rubygems/test_gem_ext_rake_builder.rb +33 -16
  410. data/test/rubygems/test_gem_gemcutter_utilities.rb +4 -4
  411. data/test/rubygems/test_gem_indexer.rb +1 -2
  412. data/test/rubygems/test_gem_install_update_options.rb +4 -1
  413. data/test/rubygems/test_gem_installer.rb +230 -32
  414. data/test/rubygems/test_gem_package.rb +156 -29
  415. data/test/rubygems/test_gem_package_old.rb +1 -1
  416. data/test/rubygems/test_gem_package_tar_header.rb +21 -0
  417. data/test/rubygems/test_gem_package_tar_writer.rb +24 -0
  418. data/test/rubygems/test_gem_rdoc.rb +2 -0
  419. data/test/rubygems/test_gem_remote_fetcher.rb +38 -19
  420. data/test/rubygems/test_gem_request.rb +132 -0
  421. data/test/rubygems/test_gem_request_connection_pools.rb +6 -7
  422. data/test/rubygems/test_gem_request_set.rb +7 -7
  423. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
  424. data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
  425. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
  426. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
  427. data/test/rubygems/test_gem_requirement.rb +6 -0
  428. data/test/rubygems/test_gem_resolver.rb +29 -3
  429. data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
  430. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
  431. data/test/rubygems/test_gem_security.rb +5 -0
  432. data/test/rubygems/test_gem_security_policy.rb +27 -27
  433. data/test/rubygems/test_gem_security_signer.rb +14 -6
  434. data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
  435. data/test/rubygems/test_gem_server.rb +210 -12
  436. data/test/rubygems/test_gem_source.rb +12 -3
  437. data/test/rubygems/test_gem_source_fetch_problem.rb +8 -0
  438. data/test/rubygems/test_gem_source_git.rb +1 -1
  439. data/test/rubygems/test_gem_spec_fetcher.rb +20 -0
  440. data/test/rubygems/test_gem_specification.rb +163 -32
  441. data/test/rubygems/test_gem_stream_ui.rb +6 -6
  442. data/test/rubygems/test_gem_stub_specification.rb +85 -6
  443. data/test/rubygems/test_gem_text.rb +11 -0
  444. data/test/rubygems/test_gem_util.rb +26 -0
  445. data/test/rubygems/test_gem_version.rb +46 -7
  446. data/test/rubygems/test_gem_version_option.rb +15 -0
  447. data/test/rubygems/test_kernel.rb +30 -0
  448. data/test/rubygems/test_remote_fetch_error.rb +21 -0
  449. data/test/rubygems/test_require.rb +95 -21
  450. data/test/rubygems/wrong_key_cert.pem +10 -9
  451. data/test/rubygems/wrong_key_cert_32.pem +10 -9
  452. data/util/ci +74 -0
  453. data/util/create_certs.rb +64 -49
  454. data/util/generate_spdx_license_list.rb +2 -1
  455. data/util/patch_with_prs.rb +77 -0
  456. data/util/update_bundled_ca_certificates.rb +23 -2
  457. data/util/update_changelog.rb +67 -0
  458. metadata +301 -48
  459. data/README.rdoc +0 -54
  460. data/lib/gauntlet_rubygems.rb +0 -51
  461. data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem +0 -18
  462. /data/{lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem → bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem} +0 -0
@@ -0,0 +1,748 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler"
4
+ require "bundler/vendored_thor"
5
+
6
+ module Bundler
7
+ class CLI < Thor
8
+ require "bundler/cli/common"
9
+
10
+ package_name "Bundler"
11
+
12
+ AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
13
+ PARSEABLE_COMMANDS = %w[
14
+ check config help exec platform show version
15
+ ].freeze
16
+
17
+ def self.start(*)
18
+ super
19
+ rescue Exception => e
20
+ Bundler.ui = UI::Shell.new
21
+ raise e
22
+ ensure
23
+ Bundler::SharedHelpers.print_major_deprecations!
24
+ end
25
+
26
+ def self.dispatch(*)
27
+ super do |i|
28
+ i.send(:print_command)
29
+ i.send(:warn_on_outdated_bundler)
30
+ end
31
+ end
32
+
33
+ def initialize(*args)
34
+ super
35
+
36
+ custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
37
+ if custom_gemfile && !custom_gemfile.empty?
38
+ Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
39
+ Bundler.reset_paths!
40
+ end
41
+
42
+ Bundler.settings.set_command_option_if_given :retry, options[:retry]
43
+
44
+ current_cmd = args.last[:current_command].name
45
+ auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
46
+ rescue UnknownArgumentError => e
47
+ raise InvalidOption, e.message
48
+ ensure
49
+ self.options ||= {}
50
+ unprinted_warnings = Bundler.ui.unprinted_warnings
51
+ Bundler.ui = UI::Shell.new(options)
52
+ Bundler.ui.level = "debug" if options["verbose"]
53
+ unprinted_warnings.each {|w| Bundler.ui.warn(w) }
54
+
55
+ if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
56
+ Bundler.ui.warn(
57
+ "The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
58
+ "experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
59
+ "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
60
+ )
61
+ end
62
+ end
63
+
64
+ def self.deprecated_option(*args, &blk)
65
+ return if Bundler.feature_flag.forget_cli_options?
66
+ method_option(*args, &blk)
67
+ end
68
+
69
+ check_unknown_options!(:except => [:config, :exec])
70
+ stop_on_unknown_option! :exec
71
+
72
+ desc "cli_help", "Prints a summary of bundler commands", :hide => true
73
+ def cli_help
74
+ version
75
+ Bundler.ui.info "\n"
76
+
77
+ primary_commands = ["install", "update",
78
+ Bundler.feature_flag.cache_command_is_package? ? "cache" : "package",
79
+ "exec", "config", "help"]
80
+
81
+ list = self.class.printable_commands(true)
82
+ by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
83
+ utilities = by_name.keys.sort - primary_commands
84
+ primary_commands.map! {|name| (by_name[name] || raise("no primary command #{name}")).first }
85
+ utilities.map! {|name| by_name[name].first }
86
+
87
+ shell.say "Bundler commands:\n\n"
88
+
89
+ shell.say " Primary commands:\n"
90
+ shell.print_table(primary_commands, :indent => 4, :truncate => true)
91
+ shell.say
92
+ shell.say " Utilities:\n"
93
+ shell.print_table(utilities, :indent => 4, :truncate => true)
94
+ shell.say
95
+ self.class.send(:class_options_help, shell)
96
+ end
97
+ default_task(Bundler.feature_flag.default_cli_command)
98
+
99
+ class_option "no-color", :type => :boolean, :desc => "Disable colorization in output"
100
+ class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM",
101
+ :desc => "Specify the number of times you wish to attempt network commands"
102
+ class_option "verbose", :type => :boolean, :desc => "Enable verbose output mode", :aliases => "-V"
103
+
104
+ def help(cli = nil)
105
+ case cli
106
+ when "gemfile" then command = "gemfile"
107
+ when nil then command = "bundle"
108
+ else command = "bundle-#{cli}"
109
+ end
110
+
111
+ man_path = File.expand_path("../../../man", __FILE__)
112
+ man_pages = Hash[Dir.glob(File.join(man_path, "*")).grep(/.*\.\d*\Z/).collect do |f|
113
+ [File.basename(f, ".*"), f]
114
+ end]
115
+
116
+ if man_pages.include?(command)
117
+ if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
118
+ Kernel.exec "man #{man_pages[command]}"
119
+ else
120
+ puts File.read("#{man_path}/#{File.basename(man_pages[command])}.txt")
121
+ end
122
+ elsif command_path = Bundler.which("bundler-#{cli}")
123
+ Kernel.exec(command_path, "--help")
124
+ else
125
+ super
126
+ end
127
+ end
128
+
129
+ def self.handle_no_command_error(command, has_namespace = $thor_runner)
130
+ if Bundler.feature_flag.plugins? && Bundler::Plugin.command?(command)
131
+ return Bundler::Plugin.exec_command(command, ARGV[1..-1])
132
+ end
133
+
134
+ return super unless command_path = Bundler.which("bundler-#{command}")
135
+
136
+ Kernel.exec(command_path, *ARGV[1..-1])
137
+ end
138
+
139
+ desc "init [OPTIONS]", "Generates a Gemfile into the current working directory"
140
+ long_desc <<-D
141
+ Init generates a default Gemfile in the current working directory. When adding a
142
+ Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
143
+ dependency listed in the gemspec file to the newly created Gemfile.
144
+ D
145
+ deprecated_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
146
+ def init
147
+ require "bundler/cli/init"
148
+ Init.new(options.dup).run
149
+ end
150
+
151
+ desc "check [OPTIONS]", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
152
+ long_desc <<-D
153
+ Check searches the local machine for each of the gems requested in the Gemfile. If
154
+ all gems are found, Bundler prints a success message and exits with a status of 0.
155
+ If not, the first missing gem is listed and Bundler exits status 1.
156
+ D
157
+ method_option "dry-run", :type => :boolean, :default => false, :banner =>
158
+ "Lock the Gemfile"
159
+ method_option "gemfile", :type => :string, :banner =>
160
+ "Use the specified gemfile instead of Gemfile"
161
+ method_option "path", :type => :string, :banner =>
162
+ "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
163
+ map "c" => "check"
164
+ def check
165
+ require "bundler/cli/check"
166
+ Check.new(options).run
167
+ end
168
+
169
+ desc "install [OPTIONS]", "Install the current environment to the system"
170
+ long_desc <<-D
171
+ Install will install all of the gems in the current bundle, making them available
172
+ for use. In a freshly checked out repository, this command will give you the same
173
+ gem versions as the last person who updated the Gemfile and ran `bundle update`.
174
+
175
+ Passing [DIR] to install (e.g. vendor) will cause the unpacked gems to be installed
176
+ into the [DIR] directory rather than into system gems.
177
+
178
+ If the bundle has already been installed, bundler will tell you so and then exit.
179
+ D
180
+ deprecated_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
181
+ "Generate bin stubs for bundled gems to ./bin"
182
+ deprecated_option "clean", :type => :boolean, :banner =>
183
+ "Run bundle clean automatically after install"
184
+ deprecated_option "deployment", :type => :boolean, :banner =>
185
+ "Install using defaults tuned for deployment environments"
186
+ deprecated_option "frozen", :type => :boolean, :banner =>
187
+ "Do not allow the Gemfile.lock to be updated after this install"
188
+ method_option "full-index", :type => :boolean, :banner =>
189
+ "Fall back to using the single-file index of all gems"
190
+ method_option "gemfile", :type => :string, :banner =>
191
+ "Use the specified gemfile instead of Gemfile"
192
+ method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
193
+ "Specify the number of jobs to run in parallel"
194
+ method_option "local", :type => :boolean, :banner =>
195
+ "Do not attempt to fetch gems remotely and use the gem cache instead"
196
+ deprecated_option "no-cache", :type => :boolean, :banner =>
197
+ "Don't update the existing gem cache."
198
+ method_option "redownload", :type => :boolean, :aliases =>
199
+ [Bundler.feature_flag.forget_cli_options? ? nil : "--force"].compact, :banner =>
200
+ "Force downloading every gem."
201
+ deprecated_option "no-prune", :type => :boolean, :banner =>
202
+ "Don't remove stale gems from the cache."
203
+ deprecated_option "path", :type => :string, :banner =>
204
+ "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
205
+ method_option "quiet", :type => :boolean, :banner =>
206
+ "Only output warnings and errors."
207
+ deprecated_option "shebang", :type => :string, :banner =>
208
+ "Specify a different shebang executable name than the default (usually 'ruby')"
209
+ method_option "standalone", :type => :array, :lazy_default => [], :banner =>
210
+ "Make a bundle that can work without the Bundler runtime"
211
+ deprecated_option "system", :type => :boolean, :banner =>
212
+ "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
213
+ method_option "trust-policy", :alias => "P", :type => :string, :banner =>
214
+ "Gem trust policy (like gem install -P). Must be one of " +
215
+ Bundler.rubygems.security_policy_keys.join("|")
216
+ deprecated_option "without", :type => :array, :banner =>
217
+ "Exclude gems that are part of the specified named group."
218
+ deprecated_option "with", :type => :array, :banner =>
219
+ "Include gems that are part of the specified named group."
220
+ map "i" => "install"
221
+ def install
222
+ require "bundler/cli/install"
223
+ Bundler.settings.temporary(:no_install => false) do
224
+ Install.new(options.dup).run
225
+ end
226
+ end
227
+
228
+ desc "update [OPTIONS]", "Update the current environment"
229
+ long_desc <<-D
230
+ Update will install the newest versions of the gems listed in the Gemfile. Use
231
+ update when you have changed the Gemfile, or if you want to get the newest
232
+ possible versions of the gems in the bundle.
233
+ D
234
+ method_option "full-index", :type => :boolean, :banner =>
235
+ "Fall back to using the single-file index of all gems"
236
+ method_option "group", :aliases => "-g", :type => :array, :banner =>
237
+ "Update a specific group"
238
+ method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
239
+ "Specify the number of jobs to run in parallel"
240
+ method_option "local", :type => :boolean, :banner =>
241
+ "Do not attempt to fetch gems remotely and use the gem cache instead"
242
+ method_option "quiet", :type => :boolean, :banner =>
243
+ "Only output warnings and errors."
244
+ method_option "source", :type => :array, :banner =>
245
+ "Update a specific source (and all gems associated with it)"
246
+ method_option "force", :type => :boolean, :banner =>
247
+ "Force downloading every gem."
248
+ method_option "ruby", :type => :boolean, :banner =>
249
+ "Update ruby specified in Gemfile.lock"
250
+ method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner =>
251
+ "Update the locked version of bundler"
252
+ method_option "patch", :type => :boolean, :banner =>
253
+ "Prefer updating only to next patch version"
254
+ method_option "minor", :type => :boolean, :banner =>
255
+ "Prefer updating only to next minor version"
256
+ method_option "major", :type => :boolean, :banner =>
257
+ "Prefer updating to next major version (default)"
258
+ method_option "strict", :type => :boolean, :banner =>
259
+ "Do not allow any gem to be updated past latest --patch | --minor | --major"
260
+ method_option "conservative", :type => :boolean, :banner =>
261
+ "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
262
+ method_option "all", :type => :boolean, :banner =>
263
+ "Update everything."
264
+ def update(*gems)
265
+ require "bundler/cli/update"
266
+ Update.new(options, gems).run
267
+ end
268
+
269
+ desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
270
+ long_desc <<-D
271
+ Show lists the names and versions of all gems that are required by your Gemfile.
272
+ Calling show with [GEM] will list the exact location of that gem on your machine.
273
+ D
274
+ method_option "paths", :type => :boolean,
275
+ :banner => "List the paths of all gems that are required by your Gemfile."
276
+ method_option "outdated", :type => :boolean,
277
+ :banner => "Show verbose output including whether gems are outdated."
278
+ def show(gem_name = nil)
279
+ Bundler::SharedHelpers.major_deprecation(2, "use `bundle list` instead of `bundle show`") if ARGV[0] == "show"
280
+ require "bundler/cli/show"
281
+ Show.new(options, gem_name).run
282
+ end
283
+ # TODO: 2.0 remove `bundle show`
284
+
285
+ if Bundler.feature_flag.list_command?
286
+ desc "list", "List all gems in the bundle"
287
+ method_option "name-only", :type => :boolean, :banner => "print only the gem names"
288
+ def list
289
+ require "bundler/cli/list"
290
+ List.new(options).run
291
+ end
292
+
293
+ map %w[ls] => "list"
294
+ else
295
+ map %w[list] => "show"
296
+ end
297
+
298
+ desc "info GEM [OPTIONS]", "Show information for the given gem"
299
+ method_option "path", :type => :boolean, :banner => "Print full path to gem"
300
+ def info(gem_name)
301
+ require "bundler/cli/info"
302
+ Info.new(options, gem_name).run
303
+ end
304
+
305
+ desc "binstubs GEM [OPTIONS]", "Install the binstubs of the listed gem"
306
+ long_desc <<-D
307
+ Generate binstubs for executables in [GEM]. Binstubs are put into bin,
308
+ or the --binstubs directory if one has been set. Calling binstubs with [GEM [GEM]]
309
+ will create binstubs for all given gems.
310
+ D
311
+ method_option "force", :type => :boolean, :default => false, :banner =>
312
+ "Overwrite existing binstubs if they exist"
313
+ method_option "path", :type => :string, :lazy_default => "bin", :banner =>
314
+ "Binstub destination directory (default bin)"
315
+ method_option "shebang", :type => :string, :banner =>
316
+ "Specify a different shebang executable name than the default (usually 'ruby')"
317
+ method_option "standalone", :type => :boolean, :banner =>
318
+ "Make binstubs that can work without the Bundler runtime"
319
+ def binstubs(*gems)
320
+ require "bundler/cli/binstubs"
321
+ Binstubs.new(options, gems).run
322
+ end
323
+
324
+ desc "add GEM VERSION", "Add gem to Gemfile and run bundle install"
325
+ long_desc <<-D
326
+ Adds the specified gem to Gemfile (if valid) and run 'bundle install' in one step.
327
+ D
328
+ method_option "version", :aliases => "-v", :type => :string
329
+ method_option "group", :aliases => "-g", :type => :string
330
+ method_option "source", :aliases => "-s", :type => :string
331
+
332
+ def add(gem_name)
333
+ require "bundler/cli/add"
334
+ Add.new(options.dup, gem_name).run
335
+ end
336
+
337
+ desc "outdated GEM [OPTIONS]", "List installed gems with newer versions available"
338
+ long_desc <<-D
339
+ Outdated lists the names and versions of gems that have a newer version available
340
+ in the given source. Calling outdated with [GEM [GEM]] will only check for newer
341
+ versions of the given gems. Prerelease gems are ignored by default. If your gems
342
+ are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
343
+
344
+ For more information on patch level options (--major, --minor, --patch,
345
+ --update-strict) see documentation on the same options on the update command.
346
+ D
347
+ method_option "group", :type => :string, :banner => "List gems from a specific group"
348
+ method_option "groups", :type => :boolean, :banner => "List gems organized by groups"
349
+ method_option "local", :type => :boolean, :banner =>
350
+ "Do not attempt to fetch gems remotely and use the gem cache instead"
351
+ method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
352
+ method_option "source", :type => :array, :banner => "Check against a specific source"
353
+ method_option "strict", :type => :boolean, :banner =>
354
+ "Only list newer versions allowed by your Gemfile requirements"
355
+ method_option "update-strict", :type => :boolean, :banner =>
356
+ "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
357
+ method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
358
+ method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
359
+ method_option "patch", :type => :boolean, :banner => "Prefer updating only to next patch version"
360
+ method_option "filter-major", :type => :boolean, :banner => "Only list major newer versions"
361
+ method_option "filter-minor", :type => :boolean, :banner => "Only list minor newer versions"
362
+ method_option "filter-patch", :type => :boolean, :banner => "Only list patch newer versions"
363
+ method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner =>
364
+ "Use minimal formatting for more parseable output"
365
+ def outdated(*gems)
366
+ require "bundler/cli/outdated"
367
+ Outdated.new(options, gems).run
368
+ end
369
+
370
+ if Bundler.feature_flag.cache_command_is_package?
371
+ map %w[cache] => :package
372
+ else
373
+ desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
374
+ unless Bundler.feature_flag.cache_command_is_package?
375
+ method_option "all", :type => :boolean,
376
+ :banner => "Include all sources (including path and git)."
377
+ end
378
+ method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
379
+ method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
380
+ def cache
381
+ require "bundler/cli/cache"
382
+ Cache.new(options).run
383
+ end
384
+ end
385
+
386
+ desc "#{Bundler.feature_flag.cache_command_is_package? ? :cache : :package} [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
387
+ unless Bundler.feature_flag.cache_command_is_package?
388
+ method_option "all", :type => :boolean,
389
+ :banner => "Include all sources (including path and git)."
390
+ end
391
+ method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
392
+ method_option "cache-path", :type => :string, :banner =>
393
+ "Specify a different cache path than the default (vendor/cache)."
394
+ method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
395
+ method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only the package."
396
+ method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
397
+ method_option "path", :type => :string, :banner =>
398
+ "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
399
+ method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
400
+ method_option "frozen", :type => :boolean, :banner =>
401
+ "Do not allow the Gemfile.lock to be updated after this package operation's install"
402
+ long_desc <<-D
403
+ The package command will copy the .gem files for every gem in the bundle into the
404
+ directory ./vendor/cache. If you then check that directory into your source
405
+ control repository, others who check out your source will be able to install the
406
+ bundle without having to download any additional gems.
407
+ D
408
+ def package
409
+ require "bundler/cli/package"
410
+ Package.new(options).run
411
+ end
412
+ map %w[pack] => :package
413
+
414
+ desc "exec [OPTIONS]", "Run the command in context of the bundle"
415
+ method_option :keep_file_descriptors, :type => :boolean, :default => false
416
+ long_desc <<-D
417
+ Exec runs a command, providing it access to the gems in the bundle. While using
418
+ bundle exec you can require and call the bundled gems as if they were installed
419
+ into the system wide RubyGems repository.
420
+ D
421
+ map "e" => "exec"
422
+ def exec(*args)
423
+ require "bundler/cli/exec"
424
+ Exec.new(options, args).run
425
+ end
426
+
427
+ desc "config NAME [VALUE]", "Retrieve or set a configuration value"
428
+ long_desc <<-D
429
+ Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
430
+ existing value with the newly provided one.
431
+
432
+ By default, setting a configuration value sets it for all projects
433
+ on the machine.
434
+
435
+ If a global setting is superceded by local configuration, this command
436
+ will show the current value, as well as any superceded values and
437
+ where they were specified.
438
+ D
439
+ method_option "parseable", :type => :boolean, :banner => "Use minimal formatting for more parseable output"
440
+ def config(*args)
441
+ require "bundler/cli/config"
442
+ Config.new(options, args, self).run
443
+ end
444
+
445
+ desc "open GEM", "Opens the source directory of the given bundled gem"
446
+ def open(name)
447
+ require "bundler/cli/open"
448
+ Open.new(options, name).run
449
+ end
450
+
451
+ if Bundler.feature_flag.console_command?
452
+ desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
453
+ def console(group = nil)
454
+ require "bundler/cli/console"
455
+ Console.new(options, group).run
456
+ end
457
+ end
458
+
459
+ desc "version", "Prints the bundler's version information"
460
+ def version
461
+ cli_help = current_command.name == "cli_help"
462
+ if cli_help || ARGV.include?("version")
463
+ build_info = " (#{BuildMetadata.built_at} commit #{BuildMetadata.git_commit_sha})"
464
+ end
465
+
466
+ if !cli_help && Bundler.feature_flag.print_only_version_number?
467
+ Bundler.ui.info "#{Bundler::VERSION}#{build_info}"
468
+ else
469
+ Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
470
+ end
471
+ end
472
+ map %w[-v --version] => :version
473
+
474
+ desc "licenses", "Prints the license of all gems in the bundle"
475
+ def licenses
476
+ Bundler.load.specs.sort_by {|s| s.license.to_s }.reverse_each do |s|
477
+ gem_name = s.name
478
+ license = s.license || s.licenses
479
+
480
+ if license.empty?
481
+ Bundler.ui.warn "#{gem_name}: Unknown"
482
+ else
483
+ Bundler.ui.info "#{gem_name}: #{license}"
484
+ end
485
+ end
486
+ end
487
+
488
+ desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
489
+ long_desc <<-D
490
+ Viz generates a PNG file of the current Gemfile as a dependency graph.
491
+ Viz requires the ruby-graphviz gem (and its dependencies).
492
+ The associated gems must also be installed via 'bundle install'.
493
+ D
494
+ method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option"
495
+ method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..."
496
+ method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency."
497
+ method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
498
+ method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
499
+ def viz
500
+ require "bundler/cli/viz"
501
+ Viz.new(options.dup).run
502
+ end
503
+
504
+ old_gem = instance_method(:gem)
505
+
506
+ desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
507
+ method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
508
+ method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
509
+ method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
510
+ :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
511
+ :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
512
+ method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
513
+ method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config gem.mit true`."
514
+ method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
515
+ :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config gem.test rspec`."
516
+ def gem(name)
517
+ end
518
+
519
+ commands["gem"].tap do |gem_command|
520
+ def gem_command.run(instance, args = [])
521
+ arity = 1 # name
522
+
523
+ require "bundler/cli/gem"
524
+ cmd_args = args + [instance]
525
+ cmd_args.unshift(instance.options)
526
+
527
+ cmd = begin
528
+ Gem.new(*cmd_args)
529
+ rescue ArgumentError => e
530
+ instance.class.handle_argument_error(self, e, args, arity)
531
+ end
532
+
533
+ cmd.run
534
+ end
535
+ end
536
+
537
+ undef_method(:gem)
538
+ define_method(:gem, old_gem)
539
+ private :gem
540
+
541
+ def self.source_root
542
+ File.expand_path(File.join(File.dirname(__FILE__), "templates"))
543
+ end
544
+
545
+ desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
546
+ method_option "dry-run", :type => :boolean, :default => false, :banner =>
547
+ "Only print out changes, do not clean gems"
548
+ method_option "force", :type => :boolean, :default => false, :banner =>
549
+ "Forces clean even if --path is not set"
550
+ def clean
551
+ require "bundler/cli/clean"
552
+ Clean.new(options.dup).run
553
+ end
554
+
555
+ desc "platform [OPTIONS]", "Displays platform compatibility information"
556
+ method_option "ruby", :type => :boolean, :default => false, :banner =>
557
+ "only display ruby related platform information"
558
+ def platform
559
+ require "bundler/cli/platform"
560
+ Platform.new(options).run
561
+ end
562
+
563
+ desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", :hide => true
564
+ method_option "source", :type => :string, :banner =>
565
+ "Install gem from the given source"
566
+ method_option "group", :type => :string, :banner =>
567
+ "Install gem into a bundler group"
568
+ def inject(name, version)
569
+ SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
570
+ require "bundler/cli/inject"
571
+ Inject.new(options.dup, name, version).run
572
+ end
573
+
574
+ desc "lock", "Creates a lockfile without installing"
575
+ method_option "update", :type => :array, :lazy_default => true, :banner =>
576
+ "ignore the existing lockfile, update all gems by default, or update list of given gems"
577
+ method_option "local", :type => :boolean, :default => false, :banner =>
578
+ "do not attempt to fetch remote gemspecs and use the local gem cache only"
579
+ method_option "print", :type => :boolean, :default => false, :banner =>
580
+ "print the lockfile to STDOUT instead of writing to the file system"
581
+ method_option "lockfile", :type => :string, :default => nil, :banner =>
582
+ "the path the lockfile should be written to"
583
+ method_option "full-index", :type => :boolean, :default => false, :banner =>
584
+ "Fall back to using the single-file index of all gems"
585
+ method_option "add-platform", :type => :array, :default => [], :banner =>
586
+ "Add a new platform to the lockfile"
587
+ method_option "remove-platform", :type => :array, :default => [], :banner =>
588
+ "Remove a platform from the lockfile"
589
+ method_option "patch", :type => :boolean, :banner =>
590
+ "If updating, prefer updating only to next patch version"
591
+ method_option "minor", :type => :boolean, :banner =>
592
+ "If updating, prefer updating only to next minor version"
593
+ method_option "major", :type => :boolean, :banner =>
594
+ "If updating, prefer updating to next major version (default)"
595
+ method_option "strict", :type => :boolean, :banner =>
596
+ "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
597
+ method_option "conservative", :type => :boolean, :banner =>
598
+ "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
599
+ def lock
600
+ require "bundler/cli/lock"
601
+ Lock.new(options).run
602
+ end
603
+
604
+ desc "env", "Print information about the environment Bundler is running under"
605
+ def env
606
+ Env.write($stdout)
607
+ end
608
+
609
+ desc "doctor [OPTIONS]", "Checks the bundle for common problems"
610
+ long_desc <<-D
611
+ Doctor scans the OS dependencies of each of the gems requested in the Gemfile. If
612
+ missing dependencies are detected, Bundler prints them and exits status 1.
613
+ Otherwise, Bundler prints a success message and exits with a status of 0.
614
+ D
615
+ method_option "gemfile", :type => :string, :banner =>
616
+ "Use the specified gemfile instead of Gemfile"
617
+ method_option "quiet", :type => :boolean, :banner =>
618
+ "Only output warnings and errors."
619
+ def doctor
620
+ require "bundler/cli/doctor"
621
+ Doctor.new(options).run
622
+ end
623
+
624
+ desc "issue", "Learn how to report an issue in Bundler"
625
+ def issue
626
+ require "bundler/cli/issue"
627
+ Issue.new.run
628
+ end
629
+
630
+ desc "pristine [GEMS...]", "Restores installed gems to pristine condition"
631
+ long_desc <<-D
632
+ Restores installed gems to pristine condition from files located in the
633
+ gem cache. Gems installed from a git repository will be issued `git
634
+ checkout --force`.
635
+ D
636
+ def pristine(*gems)
637
+ require "bundler/cli/pristine"
638
+ Pristine.new(gems).run
639
+ end
640
+
641
+ if Bundler.feature_flag.plugins?
642
+ require "bundler/cli/plugin"
643
+ desc "plugin", "Manage the bundler plugins"
644
+ subcommand "plugin", Plugin
645
+ end
646
+
647
+ # Reformat the arguments passed to bundle that include a --help flag
648
+ # into the corresponding `bundle help #{command}` call
649
+ def self.reformatted_help_args(args)
650
+ bundler_commands = all_commands.keys
651
+ help_flags = %w[--help -h]
652
+ exec_commands = %w[e ex exe exec]
653
+ help_used = args.index {|a| help_flags.include? a }
654
+ exec_used = args.index {|a| exec_commands.include? a }
655
+ command = args.find {|a| bundler_commands.include? a }
656
+ if exec_used && help_used
657
+ if exec_used + help_used == 1
658
+ %w[help exec]
659
+ else
660
+ args
661
+ end
662
+ elsif help_used
663
+ args = args.dup
664
+ args.delete_at(help_used)
665
+ ["help", command || args].flatten.compact
666
+ else
667
+ args
668
+ end
669
+ end
670
+
671
+ private
672
+
673
+ # Automatically invoke `bundle install` and resume if
674
+ # Bundler.settings[:auto_install] exists. This is set through config cmd
675
+ # `bundle config auto_install 1`.
676
+ #
677
+ # Note that this method `nil`s out the global Definition object, so it
678
+ # should be called first, before you instantiate anything like an
679
+ # `Installer` that'll keep a reference to the old one instead.
680
+ def auto_install
681
+ return unless Bundler.settings[:auto_install]
682
+
683
+ begin
684
+ Bundler.definition.specs
685
+ rescue GemNotFound
686
+ Bundler.ui.info "Automatically installing missing gems."
687
+ Bundler.reset!
688
+ invoke :install, []
689
+ Bundler.reset!
690
+ end
691
+ end
692
+
693
+ def current_command
694
+ _, _, config = @_initializer
695
+ config[:current_command]
696
+ end
697
+
698
+ def print_command
699
+ return unless Bundler.ui.debug?
700
+ cmd = current_command
701
+ command_name = cmd.name
702
+ return if PARSEABLE_COMMANDS.include?(command_name)
703
+ command = ["bundle", command_name] + args
704
+ options_to_print = options.dup
705
+ options_to_print.delete_if do |k, v|
706
+ next unless o = cmd.options[k]
707
+ o.default == v
708
+ end
709
+ command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
710
+ command.reject!(&:empty?)
711
+ Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}"
712
+ end
713
+
714
+ def warn_on_outdated_bundler
715
+ return if Bundler.settings[:disable_version_check]
716
+
717
+ command_name = current_command.name
718
+ return if PARSEABLE_COMMANDS.include?(command_name)
719
+
720
+ return unless SharedHelpers.md5_available?
721
+
722
+ latest = Fetcher::CompactIndex.
723
+ new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
724
+ send(:compact_index_client).
725
+ instance_variable_get(:@cache).
726
+ dependencies("bundler").
727
+ map {|d| Gem::Version.new(d.first) }.
728
+ max
729
+ return unless latest
730
+
731
+ current = Gem::Version.new(VERSION)
732
+ return if current >= latest
733
+ latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
734
+
735
+ installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
736
+ if latest_installed && latest_installed > current
737
+ suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
738
+ suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
739
+ else
740
+ suggestion = installation
741
+ end
742
+
743
+ Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\n#{suggestion}"
744
+ rescue
745
+ nil
746
+ end
747
+ end
748
+ end