bundler-clone 4.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5670 -0
  3. data/LICENSE.md +22 -0
  4. data/README.md +58 -0
  5. data/bundler.gemspec +46 -0
  6. data/exe/bundle +29 -0
  7. data/exe/bundler +4 -0
  8. data/lib/bundler/.document +1 -0
  9. data/lib/bundler/build_metadata.rb +44 -0
  10. data/lib/bundler/capistrano.rb +4 -0
  11. data/lib/bundler/checksum.rb +270 -0
  12. data/lib/bundler/ci_detector.rb +75 -0
  13. data/lib/bundler/cli/add.rb +62 -0
  14. data/lib/bundler/cli/binstubs.rb +57 -0
  15. data/lib/bundler/cli/cache.rb +32 -0
  16. data/lib/bundler/cli/check.rb +40 -0
  17. data/lib/bundler/cli/clean.rb +25 -0
  18. data/lib/bundler/cli/common.rb +161 -0
  19. data/lib/bundler/cli/config.rb +208 -0
  20. data/lib/bundler/cli/console.rb +47 -0
  21. data/lib/bundler/cli/doctor/diagnose.rb +167 -0
  22. data/lib/bundler/cli/doctor/ssl.rb +249 -0
  23. data/lib/bundler/cli/doctor.rb +33 -0
  24. data/lib/bundler/cli/exec.rb +114 -0
  25. data/lib/bundler/cli/fund.rb +36 -0
  26. data/lib/bundler/cli/gem.rb +493 -0
  27. data/lib/bundler/cli/info.rb +83 -0
  28. data/lib/bundler/cli/init.rb +51 -0
  29. data/lib/bundler/cli/install.rb +127 -0
  30. data/lib/bundler/cli/issue.rb +41 -0
  31. data/lib/bundler/cli/list.rb +97 -0
  32. data/lib/bundler/cli/lock.rb +94 -0
  33. data/lib/bundler/cli/open.rb +29 -0
  34. data/lib/bundler/cli/outdated.rb +337 -0
  35. data/lib/bundler/cli/platform.rb +48 -0
  36. data/lib/bundler/cli/plugin.rb +39 -0
  37. data/lib/bundler/cli/pristine.rb +64 -0
  38. data/lib/bundler/cli/remove.rb +17 -0
  39. data/lib/bundler/cli/show.rb +71 -0
  40. data/lib/bundler/cli/update.rb +125 -0
  41. data/lib/bundler/cli.rb +829 -0
  42. data/lib/bundler/compact_index_client/cache.rb +96 -0
  43. data/lib/bundler/compact_index_client/cache_file.rb +148 -0
  44. data/lib/bundler/compact_index_client/parser.rb +87 -0
  45. data/lib/bundler/compact_index_client/updater.rb +105 -0
  46. data/lib/bundler/compact_index_client.rb +92 -0
  47. data/lib/bundler/constants.rb +14 -0
  48. data/lib/bundler/current_ruby.rb +94 -0
  49. data/lib/bundler/definition.rb +1304 -0
  50. data/lib/bundler/dependency.rb +151 -0
  51. data/lib/bundler/deployment.rb +6 -0
  52. data/lib/bundler/deprecate.rb +44 -0
  53. data/lib/bundler/digest.rb +71 -0
  54. data/lib/bundler/dsl.rb +642 -0
  55. data/lib/bundler/endpoint_specification.rb +184 -0
  56. data/lib/bundler/env.rb +148 -0
  57. data/lib/bundler/environment_preserver.rb +69 -0
  58. data/lib/bundler/errors.rb +277 -0
  59. data/lib/bundler/feature_flag.rb +20 -0
  60. data/lib/bundler/fetcher/base.rb +55 -0
  61. data/lib/bundler/fetcher/compact_index.rb +133 -0
  62. data/lib/bundler/fetcher/dependency.rb +85 -0
  63. data/lib/bundler/fetcher/downloader.rb +116 -0
  64. data/lib/bundler/fetcher/gem_remote_fetcher.rb +24 -0
  65. data/lib/bundler/fetcher/index.rb +25 -0
  66. data/lib/bundler/fetcher.rb +365 -0
  67. data/lib/bundler/force_platform.rb +16 -0
  68. data/lib/bundler/friendly_errors.rb +127 -0
  69. data/lib/bundler/gem_helper.rb +237 -0
  70. data/lib/bundler/gem_tasks.rb +7 -0
  71. data/lib/bundler/gem_version_promoter.rb +147 -0
  72. data/lib/bundler/index.rb +203 -0
  73. data/lib/bundler/injector.rb +284 -0
  74. data/lib/bundler/inline.rb +106 -0
  75. data/lib/bundler/installer/gem_installer.rb +88 -0
  76. data/lib/bundler/installer/parallel_installer.rb +280 -0
  77. data/lib/bundler/installer/standalone.rb +113 -0
  78. data/lib/bundler/installer.rb +241 -0
  79. data/lib/bundler/lazy_specification.rb +270 -0
  80. data/lib/bundler/lockfile_generator.rb +119 -0
  81. data/lib/bundler/lockfile_parser.rb +328 -0
  82. data/lib/bundler/man/.document +1 -0
  83. data/lib/bundler/man/bundle-add.1 +79 -0
  84. data/lib/bundler/man/bundle-add.1.ronn +92 -0
  85. data/lib/bundler/man/bundle-binstubs.1 +30 -0
  86. data/lib/bundler/man/bundle-binstubs.1.ronn +42 -0
  87. data/lib/bundler/man/bundle-cache.1 +56 -0
  88. data/lib/bundler/man/bundle-cache.1.ronn +95 -0
  89. data/lib/bundler/man/bundle-check.1 +21 -0
  90. data/lib/bundler/man/bundle-check.1.ronn +26 -0
  91. data/lib/bundler/man/bundle-clean.1 +17 -0
  92. data/lib/bundler/man/bundle-clean.1.ronn +18 -0
  93. data/lib/bundler/man/bundle-config.1 +339 -0
  94. data/lib/bundler/man/bundle-config.1.ronn +455 -0
  95. data/lib/bundler/man/bundle-console.1 +33 -0
  96. data/lib/bundler/man/bundle-console.1.ronn +39 -0
  97. data/lib/bundler/man/bundle-doctor.1 +69 -0
  98. data/lib/bundler/man/bundle-doctor.1.ronn +77 -0
  99. data/lib/bundler/man/bundle-env.1 +9 -0
  100. data/lib/bundler/man/bundle-env.1.ronn +10 -0
  101. data/lib/bundler/man/bundle-exec.1 +104 -0
  102. data/lib/bundler/man/bundle-exec.1.ronn +150 -0
  103. data/lib/bundler/man/bundle-fund.1 +22 -0
  104. data/lib/bundler/man/bundle-fund.1.ronn +25 -0
  105. data/lib/bundler/man/bundle-gem.1 +107 -0
  106. data/lib/bundler/man/bundle-gem.1.ronn +150 -0
  107. data/lib/bundler/man/bundle-help.1 +9 -0
  108. data/lib/bundler/man/bundle-help.1.ronn +12 -0
  109. data/lib/bundler/man/bundle-info.1 +17 -0
  110. data/lib/bundler/man/bundle-info.1.ronn +21 -0
  111. data/lib/bundler/man/bundle-init.1 +20 -0
  112. data/lib/bundler/man/bundle-init.1.ronn +32 -0
  113. data/lib/bundler/man/bundle-install.1 +178 -0
  114. data/lib/bundler/man/bundle-install.1.ronn +314 -0
  115. data/lib/bundler/man/bundle-issue.1 +45 -0
  116. data/lib/bundler/man/bundle-issue.1.ronn +37 -0
  117. data/lib/bundler/man/bundle-licenses.1 +9 -0
  118. data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  119. data/lib/bundler/man/bundle-list.1 +40 -0
  120. data/lib/bundler/man/bundle-list.1.ronn +41 -0
  121. data/lib/bundler/man/bundle-lock.1 +75 -0
  122. data/lib/bundler/man/bundle-lock.1.ronn +115 -0
  123. data/lib/bundler/man/bundle-open.1 +32 -0
  124. data/lib/bundler/man/bundle-open.1.ronn +28 -0
  125. data/lib/bundler/man/bundle-outdated.1 +106 -0
  126. data/lib/bundler/man/bundle-outdated.1.ronn +117 -0
  127. data/lib/bundler/man/bundle-platform.1 +49 -0
  128. data/lib/bundler/man/bundle-platform.1.ronn +49 -0
  129. data/lib/bundler/man/bundle-plugin.1 +76 -0
  130. data/lib/bundler/man/bundle-plugin.1.ronn +84 -0
  131. data/lib/bundler/man/bundle-pristine.1 +23 -0
  132. data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
  133. data/lib/bundler/man/bundle-remove.1 +15 -0
  134. data/lib/bundler/man/bundle-remove.1.ronn +16 -0
  135. data/lib/bundler/man/bundle-show.1 +16 -0
  136. data/lib/bundler/man/bundle-show.1.ronn +21 -0
  137. data/lib/bundler/man/bundle-update.1 +284 -0
  138. data/lib/bundler/man/bundle-update.1.ronn +367 -0
  139. data/lib/bundler/man/bundle-version.1 +22 -0
  140. data/lib/bundler/man/bundle-version.1.ronn +24 -0
  141. data/lib/bundler/man/bundle.1 +93 -0
  142. data/lib/bundler/man/bundle.1.ronn +107 -0
  143. data/lib/bundler/man/gemfile.5 +503 -0
  144. data/lib/bundler/man/gemfile.5.ronn +586 -0
  145. data/lib/bundler/man/index.txt +31 -0
  146. data/lib/bundler/match_metadata.rb +30 -0
  147. data/lib/bundler/match_platform.rb +42 -0
  148. data/lib/bundler/match_remote_metadata.rb +29 -0
  149. data/lib/bundler/materialization.rb +59 -0
  150. data/lib/bundler/mirror.rb +221 -0
  151. data/lib/bundler/plugin/api/source.rb +330 -0
  152. data/lib/bundler/plugin/api.rb +81 -0
  153. data/lib/bundler/plugin/dsl.rb +53 -0
  154. data/lib/bundler/plugin/events.rb +85 -0
  155. data/lib/bundler/plugin/index.rb +203 -0
  156. data/lib/bundler/plugin/installer/git.rb +34 -0
  157. data/lib/bundler/plugin/installer/path.rb +26 -0
  158. data/lib/bundler/plugin/installer/rubygems.rb +19 -0
  159. data/lib/bundler/plugin/installer.rb +123 -0
  160. data/lib/bundler/plugin/source_list.rb +31 -0
  161. data/lib/bundler/plugin/unloaded_source.rb +25 -0
  162. data/lib/bundler/plugin.rb +387 -0
  163. data/lib/bundler/process_lock.rb +20 -0
  164. data/lib/bundler/remote_specification.rb +126 -0
  165. data/lib/bundler/resolver/base.rb +127 -0
  166. data/lib/bundler/resolver/candidate.rb +85 -0
  167. data/lib/bundler/resolver/incompatibility.rb +15 -0
  168. data/lib/bundler/resolver/package.rb +95 -0
  169. data/lib/bundler/resolver/root.rb +25 -0
  170. data/lib/bundler/resolver/spec_group.rb +74 -0
  171. data/lib/bundler/resolver/strategy.rb +43 -0
  172. data/lib/bundler/resolver.rb +603 -0
  173. data/lib/bundler/retry.rb +92 -0
  174. data/lib/bundler/ruby_dsl.rb +67 -0
  175. data/lib/bundler/ruby_version.rb +135 -0
  176. data/lib/bundler/rubygems_ext.rb +503 -0
  177. data/lib/bundler/rubygems_gem_installer.rb +206 -0
  178. data/lib/bundler/rubygems_integration.rb +456 -0
  179. data/lib/bundler/runtime.rb +331 -0
  180. data/lib/bundler/safe_marshal.rb +31 -0
  181. data/lib/bundler/self_manager.rb +197 -0
  182. data/lib/bundler/settings/validator.rb +86 -0
  183. data/lib/bundler/settings.rb +585 -0
  184. data/lib/bundler/setup.rb +39 -0
  185. data/lib/bundler/shared_helpers.rb +392 -0
  186. data/lib/bundler/source/gemspec.rb +19 -0
  187. data/lib/bundler/source/git/git_proxy.rb +509 -0
  188. data/lib/bundler/source/git.rb +451 -0
  189. data/lib/bundler/source/metadata.rb +67 -0
  190. data/lib/bundler/source/path/installer.rb +53 -0
  191. data/lib/bundler/source/path.rb +256 -0
  192. data/lib/bundler/source/rubygems/remote.rb +86 -0
  193. data/lib/bundler/source/rubygems.rb +606 -0
  194. data/lib/bundler/source/rubygems_aggregate.rb +71 -0
  195. data/lib/bundler/source.rb +120 -0
  196. data/lib/bundler/source_list.rb +240 -0
  197. data/lib/bundler/source_map.rb +72 -0
  198. data/lib/bundler/spec_set.rb +390 -0
  199. data/lib/bundler/stub_specification.rb +147 -0
  200. data/lib/bundler/templates/.document +1 -0
  201. data/lib/bundler/templates/Executable +16 -0
  202. data/lib/bundler/templates/Executable.standalone +14 -0
  203. data/lib/bundler/templates/Gemfile +5 -0
  204. data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  205. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +10 -0
  206. data/lib/bundler/templates/newgem/Cargo.toml.tt +13 -0
  207. data/lib/bundler/templates/newgem/Gemfile.tt +24 -0
  208. data/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  209. data/lib/bundler/templates/newgem/README.md.tt +49 -0
  210. data/lib/bundler/templates/newgem/Rakefile.tt +72 -0
  211. data/lib/bundler/templates/newgem/bin/console.tt +11 -0
  212. data/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  213. data/lib/bundler/templates/newgem/circleci/config.yml.tt +37 -0
  214. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  215. data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +22 -0
  216. data/lib/bundler/templates/newgem/ext/newgem/build.rs.tt +5 -0
  217. data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
  218. data/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
  219. data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  220. data/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
  221. data/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
  222. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  223. data/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
  224. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  225. data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +23 -0
  226. data/lib/bundler/templates/newgem/github/workflows/build-gems.yml.tt +69 -0
  227. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +48 -0
  228. data/lib/bundler/templates/newgem/gitignore.tt +23 -0
  229. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +27 -0
  230. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
  231. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
  232. data/lib/bundler/templates/newgem/newgem.gemspec.tt +58 -0
  233. data/lib/bundler/templates/newgem/rspec.tt +3 -0
  234. data/lib/bundler/templates/newgem/rubocop.yml.tt +8 -0
  235. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  236. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +19 -0
  237. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
  238. data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  239. data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  240. data/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +19 -0
  241. data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  242. data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  243. data/lib/bundler/ui/rg_proxy.rb +19 -0
  244. data/lib/bundler/ui/shell.rb +191 -0
  245. data/lib/bundler/ui/silent.rb +96 -0
  246. data/lib/bundler/ui.rb +9 -0
  247. data/lib/bundler/uri_credentials_filter.rb +43 -0
  248. data/lib/bundler/uri_normalizer.rb +23 -0
  249. data/lib/bundler/vendor/.document +1 -0
  250. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  251. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +227 -0
  252. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  253. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
  254. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +230 -0
  255. data/lib/bundler/vendor/fileutils/COPYING +56 -0
  256. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +2701 -0
  257. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  258. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
  259. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
  260. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +80 -0
  261. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1153 -0
  262. data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  263. data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  264. data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +169 -0
  265. data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  266. data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
  267. data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  268. data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  269. data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  270. data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  271. data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
  272. data/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
  273. data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  274. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  275. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
  276. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +423 -0
  277. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +236 -0
  278. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  279. data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  280. data/lib/bundler/vendor/securerandom/COPYING +56 -0
  281. data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  282. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  283. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +105 -0
  284. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
  285. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
  286. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
  287. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +407 -0
  288. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
  289. data/lib/bundler/vendor/thor/lib/thor/actions.rb +340 -0
  290. data/lib/bundler/vendor/thor/lib/thor/base.rb +825 -0
  291. data/lib/bundler/vendor/thor/lib/thor/command.rb +151 -0
  292. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
  293. data/lib/bundler/vendor/thor/lib/thor/error.rb +106 -0
  294. data/lib/bundler/vendor/thor/lib/thor/group.rb +292 -0
  295. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  296. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
  297. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  298. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  299. data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  300. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +86 -0
  301. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
  302. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
  303. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +294 -0
  304. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  305. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
  306. data/lib/bundler/vendor/thor/lib/thor/runner.rb +335 -0
  307. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +384 -0
  308. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +112 -0
  309. data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
  310. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +81 -0
  311. data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
  312. data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
  313. data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
  314. data/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  315. data/lib/bundler/vendor/thor/lib/thor/util.rb +285 -0
  316. data/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  317. data/lib/bundler/vendor/thor/lib/thor.rb +674 -0
  318. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  319. data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
  320. data/lib/bundler/vendor/uri/COPYING +56 -0
  321. data/lib/bundler/vendor/uri/lib/uri/common.rb +922 -0
  322. data/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
  323. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  324. data/lib/bundler/vendor/uri/lib/uri/generic.rb +1592 -0
  325. data/lib/bundler/vendor/uri/lib/uri/http.rb +137 -0
  326. data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  327. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  328. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
  329. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
  330. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +547 -0
  331. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
  332. data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  333. data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
  334. data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
  335. data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  336. data/lib/bundler/vendored_fileutils.rb +4 -0
  337. data/lib/bundler/vendored_net_http.rb +23 -0
  338. data/lib/bundler/vendored_persistent.rb +11 -0
  339. data/lib/bundler/vendored_pub_grub.rb +4 -0
  340. data/lib/bundler/vendored_securerandom.rb +12 -0
  341. data/lib/bundler/vendored_thor.rb +8 -0
  342. data/lib/bundler/vendored_timeout.rb +12 -0
  343. data/lib/bundler/vendored_tsort.rb +4 -0
  344. data/lib/bundler/vendored_uri.rb +21 -0
  345. data/lib/bundler/version.rb +21 -0
  346. data/lib/bundler/vlad.rb +4 -0
  347. data/lib/bundler/worker.rb +125 -0
  348. data/lib/bundler/yaml_serializer.rb +98 -0
  349. data/lib/bundler.rb +691 -0
  350. metadata +409 -0
@@ -0,0 +1,337 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::Outdated
5
+ attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict
6
+ attr_accessor :outdated_gems
7
+
8
+ def initialize(options, gems)
9
+ @options = options
10
+ @gems = gems
11
+ @sources = Array(options[:source])
12
+
13
+ @filter_options_patch = options.keys & %w[filter-major filter-minor filter-patch]
14
+
15
+ @outdated_gems = []
16
+
17
+ @options_include_groups = [:group, :groups].any? do |v|
18
+ options.keys.include?(v.to_s)
19
+ end
20
+
21
+ # the patch level options imply strict is also true. It wouldn't make
22
+ # sense otherwise.
23
+ @strict = options["filter-strict"] || Bundler::CLI::Common.patch_level_options(options).any?
24
+ end
25
+
26
+ def run
27
+ check_for_deployment_mode!
28
+
29
+ Bundler::CLI::Common.validate_cooldown!(options[:cooldown])
30
+ Bundler.settings.set_command_option_if_given :cooldown, options[:cooldown]
31
+
32
+ Bundler.definition.validate_runtime!
33
+ current_specs = Bundler.ui.silence { Bundler.definition.resolve }
34
+
35
+ gems.each do |gem_name|
36
+ if current_specs[gem_name].empty?
37
+ raise GemNotFound, "Could not find gem '#{gem_name}'."
38
+ end
39
+ end
40
+
41
+ current_dependencies = Bundler.ui.silence do
42
+ Bundler.load.dependencies.map {|dep| [dep.name, dep] }.to_h
43
+ end
44
+
45
+ definition = if gems.empty? && sources.empty?
46
+ # We're doing a full update
47
+ Bundler.definition(true)
48
+ else
49
+ Bundler.definition(gems: gems, sources: sources)
50
+ end
51
+
52
+ Bundler::CLI::Common.configure_gem_version_promoter(
53
+ Bundler.definition,
54
+ options.merge(strict: @strict)
55
+ )
56
+
57
+ definition_resolution = proc do
58
+ options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
59
+ end
60
+
61
+ if options[:parseable]
62
+ Bundler.ui.progress(&definition_resolution)
63
+ else
64
+ definition_resolution.call
65
+ end
66
+
67
+ Bundler.ui.info ""
68
+
69
+ # Loop through the current specs
70
+ gemfile_specs, dependency_specs = current_specs.partition do |spec|
71
+ current_dependencies.key? spec.name
72
+ end
73
+
74
+ specs = if options["only-explicit"]
75
+ gemfile_specs
76
+ else
77
+ gemfile_specs + dependency_specs
78
+ end
79
+
80
+ specs.sort_by(&:name).uniq(&:name).each do |current_spec|
81
+ next unless gems.empty? || gems.include?(current_spec.name)
82
+
83
+ active_spec = retrieve_active_spec(definition, current_spec)
84
+ next unless active_spec
85
+
86
+ next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
87
+
88
+ gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
89
+ next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
90
+
91
+ dependency = current_dependencies[current_spec.name]
92
+ groups = ""
93
+ if dependency && !options[:parseable]
94
+ groups = dependency.groups.join(", ")
95
+ end
96
+
97
+ outdated_gems << {
98
+ active_spec: active_spec,
99
+ current_spec: current_spec,
100
+ dependency: dependency,
101
+ groups: groups,
102
+ }
103
+ end
104
+
105
+ relevant_outdated_gems = if options_include_groups
106
+ outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
107
+ contains_group = groups.split(", ").include?(options[:group])
108
+ next unless options[:groups] || contains_group
109
+
110
+ gems
111
+ end.compact
112
+ else
113
+ outdated_gems
114
+ end
115
+
116
+ if relevant_outdated_gems.empty?
117
+ unless options[:parseable]
118
+ Bundler.ui.info(nothing_outdated_message)
119
+ end
120
+ else
121
+ if options[:parseable]
122
+ print_gems(relevant_outdated_gems)
123
+ else
124
+ print_gems_table(relevant_outdated_gems)
125
+ end
126
+
127
+ exit 1
128
+ end
129
+ end
130
+
131
+ private
132
+
133
+ def loaded_from_for(spec)
134
+ return unless spec.respond_to?(:loaded_from)
135
+
136
+ spec.loaded_from
137
+ end
138
+
139
+ def groups_text(group_text, groups)
140
+ "#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
141
+ end
142
+
143
+ def nothing_outdated_message
144
+ if filter_options_patch.any?
145
+ display = filter_options_patch.map do |o|
146
+ o.sub("filter-", "")
147
+ end.join(" or ")
148
+
149
+ "No #{display} updates to display.\n"
150
+ else
151
+ "Bundle up to date!\n"
152
+ end
153
+ end
154
+
155
+ def retrieve_active_spec(definition, current_spec)
156
+ active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
157
+ return unless active_spec
158
+
159
+ return active_spec if strict
160
+
161
+ active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.installable_on_platform?(current_spec.platform) }.sort_by(&:version)
162
+ if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
163
+ active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
164
+ end
165
+ active_specs.last
166
+ end
167
+
168
+ def print_gems(gems_list)
169
+ gems_list.each do |gem|
170
+ print_gem(
171
+ gem[:current_spec],
172
+ gem[:active_spec],
173
+ gem[:dependency],
174
+ gem[:groups],
175
+ )
176
+ end
177
+ end
178
+
179
+ def print_gems_table(gems_list)
180
+ data = gems_list.map do |gem|
181
+ gem_column_for(
182
+ gem[:current_spec],
183
+ gem[:active_spec],
184
+ gem[:dependency],
185
+ gem[:groups],
186
+ )
187
+ end
188
+
189
+ print_indented([table_header] + data)
190
+ end
191
+
192
+ def print_gem(current_spec, active_spec, dependency, groups)
193
+ spec_version = "#{active_spec.version}#{active_spec.git_version}"
194
+ if Bundler.ui.debug?
195
+ loaded_from = loaded_from_for(active_spec)
196
+ spec_version += " (from #{loaded_from})" if loaded_from
197
+ end
198
+ current_version = "#{current_spec.version}#{current_spec.git_version}"
199
+
200
+ if dependency&.specific?
201
+ dependency_version = %(, requested #{dependency.requirement})
202
+ end
203
+
204
+ spec_outdated_info = "#{active_spec.name} (newest #{spec_version}, " \
205
+ "installed #{current_version}#{dependency_version}"
206
+
207
+ release_date = release_date_for(active_spec)
208
+ spec_outdated_info += ", released #{release_date}" unless release_date.empty?
209
+
210
+ remaining = cooldown_days_remaining(active_spec)
211
+ spec_outdated_info += ", in cooldown for #{remaining} more day#{"s" if remaining > 1}" if remaining
212
+
213
+ spec_outdated_info += ")"
214
+
215
+ output_message = if options[:parseable]
216
+ spec_outdated_info.to_s
217
+ elsif options_include_groups || groups.empty?
218
+ " * #{spec_outdated_info}"
219
+ else
220
+ " * #{spec_outdated_info} in #{groups_text("group", groups)}"
221
+ end
222
+
223
+ Bundler.ui.info output_message.rstrip
224
+ end
225
+
226
+ def gem_column_for(current_spec, active_spec, dependency, groups)
227
+ current_version = "#{current_spec.version}#{current_spec.git_version}"
228
+ spec_version = "#{active_spec.version}#{active_spec.git_version}"
229
+ remaining = cooldown_days_remaining(active_spec)
230
+ spec_version += " (cooldown #{remaining}d)" if remaining
231
+ dependency = dependency.requirement if dependency
232
+
233
+ ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
234
+ ret_val << release_date_for(active_spec)
235
+ ret_val << loaded_from_for(active_spec).to_s if Bundler.ui.debug?
236
+ ret_val
237
+ end
238
+
239
+ def cooldown_days_remaining(spec, now = Time.now)
240
+ return nil unless spec.respond_to?(:created_at) && spec.created_at
241
+ return nil unless spec.respond_to?(:remote) && spec.remote
242
+ days = spec.remote.effective_cooldown
243
+ return nil if days.nil? || days <= 0
244
+ remaining = days - ((now - spec.created_at) / 86_400.0)
245
+ remaining > 0 ? remaining.ceil : nil
246
+ end
247
+
248
+ def check_for_deployment_mode!
249
+ return unless Bundler.frozen_bundle?
250
+ suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
251
+ "bundle config unset frozen"
252
+ elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
253
+ "bundle config unset deployment"
254
+ end
255
+ raise ProductionError, "You are trying to check outdated gems in " \
256
+ "deployment mode. Run `bundle outdated` elsewhere.\n" \
257
+ "\nIf this is a development machine, remove the " \
258
+ "#{Bundler.default_gemfile} freeze" \
259
+ "\nby running `#{suggested_command}`."
260
+ end
261
+
262
+ def update_present_via_semver_portions(current_spec, active_spec, options)
263
+ current_major = current_spec.version.segments.first
264
+ active_major = active_spec.version.segments.first
265
+
266
+ update_present = false
267
+ update_present = active_major > current_major if options["filter-major"]
268
+
269
+ if !update_present && (options["filter-minor"] || options["filter-patch"]) && current_major == active_major
270
+ current_minor = get_version_semver_portion_value(current_spec, 1)
271
+ active_minor = get_version_semver_portion_value(active_spec, 1)
272
+
273
+ update_present = active_minor > current_minor if options["filter-minor"]
274
+
275
+ if !update_present && options["filter-patch"] && current_minor == active_minor
276
+ current_patch = get_version_semver_portion_value(current_spec, 2)
277
+ active_patch = get_version_semver_portion_value(active_spec, 2)
278
+
279
+ update_present = active_patch > current_patch
280
+ end
281
+ end
282
+
283
+ update_present
284
+ end
285
+
286
+ def get_version_semver_portion_value(spec, version_portion_index)
287
+ version_section = spec.version.segments[version_portion_index, 1]
288
+ version_section.to_a[0].to_i
289
+ end
290
+
291
+ def print_indented(matrix)
292
+ header = matrix[0]
293
+ data = matrix[1..-1]
294
+
295
+ column_sizes = Array.new(header.size) do |index|
296
+ matrix.max_by {|row| row[index].length }[index].length
297
+ end
298
+
299
+ Bundler.ui.info justify(header, column_sizes)
300
+
301
+ data.sort_by! {|row| row[0] }
302
+
303
+ data.each do |row|
304
+ Bundler.ui.info justify(row, column_sizes)
305
+ end
306
+ end
307
+
308
+ def table_header
309
+ header = ["Gem", "Current", "Latest", "Requested", "Groups", "Release Date"]
310
+ header << "Path" if Bundler.ui.debug?
311
+ header
312
+ end
313
+
314
+ def release_date_for(spec)
315
+ return "" unless spec.respond_to?(:date)
316
+
317
+ date = spec.date
318
+ return "" unless date
319
+
320
+ return "" unless Gem.const_defined?(:DEFAULT_SOURCE_DATE_EPOCH)
321
+ default_date = Time.at(Gem::DEFAULT_SOURCE_DATE_EPOCH).utc
322
+ default_date = Time.utc(default_date.year, default_date.month, default_date.day)
323
+
324
+ date = date.utc if date.respond_to?(:utc)
325
+
326
+ return "" if date == default_date
327
+
328
+ date.strftime("%Y-%m-%d")
329
+ end
330
+
331
+ def justify(row, sizes)
332
+ row.each_with_index.map do |element, index|
333
+ element.ljust(sizes[index])
334
+ end.join(" ").strip + "\n"
335
+ end
336
+ end
337
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::Platform
5
+ attr_reader :options
6
+ def initialize(options)
7
+ @options = options
8
+ end
9
+
10
+ def run
11
+ ruby_version = if Bundler.locked_gems
12
+ Bundler.locked_gems.ruby_version&.gsub(/p\d+\Z/, "")
13
+ else
14
+ Bundler.definition.ruby_version&.single_version_string
15
+ end
16
+
17
+ output = []
18
+
19
+ if options[:ruby]
20
+ if ruby_version
21
+ output << ruby_version
22
+ else
23
+ output << "No ruby version specified"
24
+ end
25
+ else
26
+ platforms = Bundler.definition.platforms.map {|p| "* #{p}" }
27
+
28
+ output << "Your platform is: #{Gem::Platform.local}"
29
+ output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
30
+
31
+ if ruby_version
32
+ output << "Your Gemfile specifies a Ruby version requirement:\n* #{ruby_version}"
33
+
34
+ begin
35
+ Bundler.definition.validate_runtime!
36
+ output << "Your current platform satisfies the Ruby version requirement."
37
+ rescue RubyVersionMismatch => e
38
+ output << e.message
39
+ end
40
+ else
41
+ output << "Your Gemfile does not specify a Ruby version requirement."
42
+ end
43
+ end
44
+
45
+ Bundler.ui.info output.join("\n\n")
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../vendored_thor"
4
+ module Bundler
5
+ class CLI::Plugin < Thor
6
+ desc "install PLUGINS", "Install the plugin from the source"
7
+ long_desc <<-D
8
+ Install plugins either from the rubygems source provided (with --source option), from a git source provided with --git, or a local path provided with --path. If no sources are provided, it uses Gem.sources
9
+ D
10
+ method_option "source", type: :string, default: nil, banner: "URL of the RubyGems source to fetch the plugin from"
11
+ method_option "version", type: :string, default: nil, banner: "The version of the plugin to fetch"
12
+ method_option "git", type: :string, default: nil, banner: "URL of the git repo to fetch from"
13
+ method_option "local_git", type: :string, default: nil, banner: "Path of the local git repo to fetch from (removed)"
14
+ method_option "branch", type: :string, default: nil, banner: "The git branch to checkout"
15
+ method_option "ref", type: :string, default: nil, banner: "The git revision to check out"
16
+ method_option "path", type: :string, default: nil, banner: "Path of a local gem to directly use"
17
+ def install(*plugins)
18
+ if options.key?(:local_git)
19
+ raise InvalidOption, "--local_git has been removed, use --git"
20
+ end
21
+
22
+ Bundler::Plugin.install(plugins, options)
23
+ end
24
+
25
+ desc "uninstall PLUGINS", "Uninstall the plugins"
26
+ long_desc <<-D
27
+ Uninstall given list of plugins. To uninstall all the plugins, use -all option.
28
+ D
29
+ method_option "all", type: :boolean, default: nil, banner: "Uninstall all the installed plugins. If no plugin is installed, then it does nothing."
30
+ def uninstall(*plugins)
31
+ Bundler::Plugin.uninstall(plugins, options)
32
+ end
33
+
34
+ desc "list", "List the installed plugins and available commands"
35
+ def list
36
+ Bundler::Plugin.list
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::Pristine
5
+ def initialize(gems)
6
+ @gems = gems
7
+ end
8
+
9
+ def run
10
+ CLI::Common.ensure_all_gems_in_lockfile!(@gems)
11
+ definition = Bundler.definition
12
+ definition.validate_runtime!
13
+ installer = Bundler::Installer.new(Bundler.root, definition)
14
+ git_sources = []
15
+
16
+ ProcessLock.lock do
17
+ installed_specs = definition.specs.reject do |spec|
18
+ next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
19
+ next if !@gems.empty? && !@gems.include?(spec.name)
20
+
21
+ gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
22
+ gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
23
+
24
+ case source = spec.source
25
+ when Source::Rubygems
26
+ cached_gem = spec.cache_file
27
+ unless File.exist?(cached_gem)
28
+ Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
29
+ next
30
+ end
31
+
32
+ FileUtils.rm_rf spec.full_gem_path
33
+ when Source::Git
34
+ if source.local?
35
+ Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overridden.")
36
+ next
37
+ end
38
+
39
+ source.remote!
40
+ if extension_cache_path = source.extension_cache_path(spec)
41
+ FileUtils.rm_rf extension_cache_path
42
+ end
43
+ FileUtils.rm_rf spec.extension_dir
44
+ FileUtils.rm_rf spec.full_gem_path
45
+
46
+ next if git_sources.include?(source)
47
+ git_sources << source
48
+ else
49
+ Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
50
+ next
51
+ end
52
+
53
+ true
54
+ end.map(&:name)
55
+
56
+ jobs = Bundler.settings.installation_parallelization
57
+ pristine_count = definition.specs.count - installed_specs.count
58
+ # allow a pristining a single gem to skip the parallel worker
59
+ jobs = [jobs, pristine_count].min
60
+ ParallelInstaller.call(installer, definition.specs, jobs, false, true, skip: installed_specs)
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::Remove
5
+ def initialize(gems, options)
6
+ @gems = gems
7
+ @options = options
8
+ end
9
+
10
+ def run
11
+ raise InvalidOption, "Please specify gems to remove." if @gems.empty?
12
+
13
+ Injector.remove(@gems, {})
14
+ Installer.install(Bundler.root, Bundler.definition)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::Show
5
+ attr_reader :options, :gem_name, :latest_specs
6
+ def initialize(options, gem_name)
7
+ @options = options
8
+ @gem_name = gem_name
9
+ @verbose = options[:verbose]
10
+ @latest_specs = fetch_latest_specs if @verbose
11
+ end
12
+
13
+ def run
14
+ Bundler.ui.silence do
15
+ Bundler.definition.validate_runtime!
16
+ Bundler.load.lock
17
+ end
18
+
19
+ if gem_name
20
+ if gem_name == "bundler"
21
+ path = File.expand_path("../../..", __dir__)
22
+ else
23
+ spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
24
+ return unless spec
25
+ path = spec.full_gem_path
26
+ unless File.directory?(path)
27
+ return Bundler.ui.warn "The gem #{gem_name} is missing. It should be installed at #{path}, but was not found"
28
+ end
29
+ end
30
+ return Bundler.ui.info(path)
31
+ end
32
+
33
+ if options[:paths]
34
+ Bundler.load.specs.sort_by(&:name).map do |s|
35
+ Bundler.ui.info s.full_gem_path
36
+ end
37
+ else
38
+ Bundler.ui.info "Gems included by the bundle:"
39
+ Bundler.load.specs.sort_by(&:name).each do |s|
40
+ desc = " * #{s.name} (#{s.version}#{s.git_version})"
41
+ if @verbose
42
+ latest = latest_specs.find {|l| l.name == s.name }
43
+ Bundler.ui.info <<~END
44
+ #{desc.lstrip}
45
+ \tSummary: #{s.summary || "No description available."}
46
+ \tHomepage: #{s.homepage || "No website available."}
47
+ \tStatus: #{outdated?(s, latest) ? "Outdated - #{s.version} < #{latest.version}" : "Up to date"}
48
+ END
49
+ else
50
+ Bundler.ui.info desc
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ private
57
+
58
+ def fetch_latest_specs
59
+ definition = Bundler.definition(true)
60
+ Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
61
+ Bundler.ui.silence { definition.remotely! }
62
+ Bundler.reset!
63
+ definition.specs
64
+ end
65
+
66
+ def outdated?(current, latest)
67
+ return false unless latest
68
+ Gem::Version.new(current.version) < Gem::Version.new(latest.version)
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,125 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::Update
5
+ attr_reader :options, :gems
6
+ def initialize(options, gems)
7
+ @options = options
8
+ @gems = gems
9
+ end
10
+
11
+ def run
12
+ Bundler.ui.level = "warn" if options[:quiet]
13
+
14
+ update_bundler = options[:bundler]
15
+
16
+ Bundler.self_manager.update_bundler_and_restart_with_it_if_needed(update_bundler) if update_bundler
17
+
18
+ Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins]
19
+
20
+ sources = Array(options[:source])
21
+ groups = Array(options[:group]).map(&:to_sym)
22
+
23
+ full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !update_bundler
24
+
25
+ if full_update && !options[:all]
26
+ if Bundler.settings[:update_requires_all_flag]
27
+ raise InvalidOption, "To update everything, pass the `--all` flag."
28
+ end
29
+ SharedHelpers.feature_deprecated! "Pass --all to `bundle update` to update everything"
30
+ elsif !full_update && options[:all]
31
+ raise InvalidOption, "Cannot specify --all along with specific options."
32
+ end
33
+
34
+ conservative = options[:conservative]
35
+
36
+ if full_update
37
+ if conservative
38
+ Bundler.definition(conservative: conservative)
39
+ else
40
+ Bundler.definition(true)
41
+ end
42
+ else
43
+ unless Bundler.default_lockfile.exist?
44
+ raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
45
+ "Run `bundle install` to update and install the bundled gems."
46
+ end
47
+ Bundler::CLI::Common.ensure_all_gems_in_lockfile!(gems)
48
+
49
+ if groups.any?
50
+ deps = Bundler.definition.dependencies.select {|d| (d.groups & groups).any? }
51
+ gems.concat(deps.map(&:name))
52
+ end
53
+
54
+ Bundler.definition(gems: gems, sources: sources, ruby: options[:ruby],
55
+ conservative: conservative,
56
+ bundler: update_bundler)
57
+ end
58
+
59
+ Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
60
+
61
+ Bundler::Fetcher.disable_endpoint = options["full-index"]
62
+
63
+ opts = options.dup
64
+ opts["update"] = true
65
+ opts["local"] = options[:local]
66
+ opts["force"] = options[:redownload] if options[:redownload]
67
+
68
+ Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
69
+ Bundler::CLI::Common.validate_cooldown!(options[:cooldown])
70
+ Bundler.settings.set_command_option_if_given :cooldown, options[:cooldown]
71
+
72
+ Bundler.definition.validate_runtime!
73
+
74
+ if locked_gems = Bundler.definition.locked_gems
75
+ previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
76
+ h[s.name] = { spec: s, version: s.version, source: s.source.identifier }
77
+ h
78
+ end
79
+ end
80
+
81
+ installer = Installer.install Bundler.root, Bundler.definition, opts
82
+ Bundler.load.cache if Bundler.app_cache.exist?
83
+
84
+ if CLI::Common.clean_after_install?
85
+ require_relative "clean"
86
+ Bundler::CLI::Clean.new(options).run
87
+ end
88
+
89
+ if locked_gems
90
+ gems.each do |name|
91
+ locked_info = previous_locked_info[name]
92
+ next unless locked_info
93
+
94
+ locked_spec = locked_info[:spec]
95
+ new_spec = Bundler.definition.specs[name].first
96
+ unless new_spec
97
+ unless locked_spec.installable_on_platform?(Bundler.local_platform)
98
+ Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one"
99
+ end
100
+
101
+ next
102
+ end
103
+
104
+ locked_source = locked_info[:source]
105
+ new_source = new_spec.source.identifier
106
+ next if locked_source != new_source
107
+
108
+ new_version = new_spec.version
109
+ locked_version = locked_info[:version]
110
+ if new_version < locked_version
111
+ Bundler.ui.warn "Note: #{name} version regressed from #{locked_version} to #{new_version}"
112
+ elsif new_version == locked_version
113
+ Bundler.ui.warn "Bundler attempted to update #{name} but its version stayed the same"
114
+ end
115
+ end
116
+ end
117
+
118
+ Bundler.ui.confirm "Bundle updated!"
119
+ Bundler::CLI::Common.output_without_groups_message(:update)
120
+ Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
121
+
122
+ Bundler::CLI::Common.output_fund_metadata_summary
123
+ end
124
+ end
125
+ end