bundler 1.17.3 → 2.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3354 -1258
- data/LICENSE.md +18 -19
- data/README.md +10 -15
- data/bundler.gemspec +15 -33
- data/exe/bundle +8 -10
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +5 -13
- data/lib/bundler/capistrano.rb +5 -5
- data/lib/bundler/checksum.rb +254 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +29 -15
- data/lib/bundler/cli/binstubs.rb +13 -5
- data/lib/bundler/cli/cache.rb +24 -17
- data/lib/bundler/cli/check.rb +7 -5
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +50 -14
- data/lib/bundler/cli/config.rb +171 -86
- data/lib/bundler/cli/console.rb +3 -6
- data/lib/bundler/cli/doctor.rb +29 -12
- data/lib/bundler/cli/exec.rb +9 -25
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +268 -53
- data/lib/bundler/cli/info.rb +51 -18
- data/lib/bundler/cli/init.rb +7 -3
- data/lib/bundler/cli/inject.rb +2 -2
- data/lib/bundler/cli/install.rb +55 -73
- data/lib/bundler/cli/issue.rb +9 -8
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +56 -26
- data/lib/bundler/cli/open.rb +10 -7
- data/lib/bundler/cli/outdated.rb +159 -128
- data/lib/bundler/cli/platform.rb +8 -6
- data/lib/bundler/cli/plugin.rb +23 -12
- data/lib/bundler/cli/pristine.rb +39 -26
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +7 -7
- data/lib/bundler/cli/update.rb +51 -19
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +399 -390
- data/lib/bundler/compact_index_client/cache.rb +55 -77
- data/lib/bundler/compact_index_client/cache_file.rb +148 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +32 -0
- data/lib/bundler/compact_index_client/parser.rb +84 -0
- data/lib/bundler/compact_index_client/updater.rb +72 -84
- data/lib/bundler/compact_index_client.rb +61 -73
- data/lib/bundler/constants.rb +9 -2
- data/lib/bundler/current_ruby.rb +20 -21
- data/lib/bundler/definition.rb +663 -505
- data/lib/bundler/dependency.rb +38 -71
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +171 -152
- data/lib/bundler/endpoint_specification.rb +43 -17
- data/lib/bundler/env.rb +11 -18
- data/lib/bundler/environment_preserver.rb +17 -8
- data/lib/bundler/errors.rb +115 -14
- data/lib/bundler/feature_flag.rb +15 -39
- data/lib/bundler/fetcher/base.rb +12 -12
- data/lib/bundler/fetcher/compact_index.rb +41 -47
- data/lib/bundler/fetcher/dependency.rb +4 -8
- data/lib/bundler/fetcher/downloader.rb +27 -20
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +6 -33
- data/lib/bundler/fetcher.rb +109 -90
- data/lib/bundler/force_platform.rb +16 -0
- data/lib/bundler/friendly_errors.rb +50 -55
- data/lib/bundler/gem_helper.rb +81 -46
- data/lib/bundler/gem_helpers.rb +78 -29
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +68 -109
- data/lib/bundler/graph.rb +11 -11
- data/lib/bundler/index.rb +74 -82
- data/lib/bundler/injector.rb +58 -26
- data/lib/bundler/inline.rb +59 -35
- data/lib/bundler/installer/gem_installer.rb +29 -29
- data/lib/bundler/installer/parallel_installer.rb +38 -68
- data/lib/bundler/installer/standalone.rb +76 -16
- data/lib/bundler/installer.rb +60 -135
- data/lib/bundler/lazy_specification.rb +161 -63
- data/lib/bundler/lockfile_generator.rb +14 -5
- data/lib/bundler/lockfile_parser.rb +150 -109
- data/lib/bundler/man/bundle-add.1 +76 -0
- data/lib/bundler/man/bundle-add.1.ronn +87 -0
- data/{man → lib/bundler/man}/bundle-binstubs.1 +15 -22
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +8 -7
- data/lib/bundler/man/bundle-cache.1 +68 -0
- data/lib/bundler/man/bundle-cache.1.ronn +108 -0
- data/{man → lib/bundler/man}/bundle-check.1 +7 -14
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +7 -2
- data/{man → lib/bundler/man}/bundle-clean.1 +4 -11
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +80 -260
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +104 -98
- data/lib/bundler/man/bundle-console.1 +33 -0
- data/lib/bundler/man/bundle-console.1.ronn +39 -0
- data/{man → lib/bundler/man}/bundle-doctor.1 +5 -19
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +1 -1
- data/lib/bundler/man/bundle-env.1 +9 -0
- data/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +20 -78
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +12 -10
- data/lib/bundler/man/bundle-fund.1 +22 -0
- data/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/lib/bundler/man/bundle-gem.1 +87 -0
- data/lib/bundler/man/bundle-gem.1.ronn +149 -0
- data/lib/bundler/man/bundle-help.1 +9 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +17 -0
- data/lib/bundler/man/bundle-info.1.ronn +21 -0
- data/{man → lib/bundler/man}/bundle-init.1 +8 -13
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +5 -2
- data/lib/bundler/man/bundle-inject.1 +31 -0
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +12 -2
- data/{man → lib/bundler/man}/bundle-install.1 +65 -155
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +66 -57
- data/lib/bundler/man/bundle-issue.1 +45 -0
- data/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/lib/bundler/man/bundle-licenses.1 +9 -0
- data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/{man → lib/bundler/man}/bundle-list.1 +9 -24
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +10 -7
- data/{man → lib/bundler/man}/bundle-lock.1 +25 -34
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +25 -4
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +10 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +23 -75
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +21 -22
- data/lib/bundler/man/bundle-platform.1 +49 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
- data/lib/bundler/man/bundle-plugin.1 +58 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +63 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +5 -16
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +4 -14
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +7 -11
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +4 -0
- data/{man → lib/bundler/man}/bundle-update.1 +35 -148
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +21 -12
- data/lib/bundler/man/bundle-version.1 +22 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/{man → lib/bundler/man}/bundle-viz.1 +9 -18
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +9 -3
- data/{man → lib/bundler/man}/bundle.1 +19 -53
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +14 -9
- data/{man → lib/bundler/man}/gemfile.5 +139 -356
- data/{man → lib/bundler/man}/gemfile.5.ronn +134 -97
- data/{man → lib/bundler/man}/index.txt +9 -1
- data/lib/bundler/match_metadata.rb +17 -0
- data/lib/bundler/match_platform.rb +2 -3
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/materialization.rb +59 -0
- data/lib/bundler/mirror.rb +10 -12
- data/lib/bundler/plugin/api/source.rb +34 -18
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/events.rb +24 -0
- data/lib/bundler/plugin/index.rb +44 -9
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/path.rb +18 -0
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +63 -27
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +131 -45
- data/lib/bundler/process_lock.rb +10 -14
- data/lib/bundler/remote_specification.rb +22 -10
- data/lib/bundler/resolver/base.rb +118 -0
- data/lib/bundler/resolver/candidate.rb +82 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +90 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +60 -68
- data/lib/bundler/resolver.rb +454 -303
- data/lib/bundler/retry.rb +6 -6
- data/lib/bundler/ruby_dsl.rb +51 -7
- data/lib/bundler/ruby_version.rb +23 -38
- data/lib/bundler/rubygems_ext.rb +357 -98
- data/lib/bundler/rubygems_gem_installer.rb +131 -65
- data/lib/bundler/rubygems_integration.rb +149 -591
- data/lib/bundler/runtime.rb +51 -51
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +206 -0
- data/lib/bundler/settings.rb +271 -135
- data/lib/bundler/setup.rb +23 -12
- data/lib/bundler/shared_helpers.rb +127 -117
- data/lib/bundler/similarity_detector.rb +3 -3
- data/lib/bundler/source/git/git_proxy.rb +326 -127
- data/lib/bundler/source/git.rb +207 -88
- data/lib/bundler/source/metadata.rb +19 -18
- data/lib/bundler/source/path/installer.rb +11 -32
- data/lib/bundler/source/path.rb +39 -38
- data/lib/bundler/source/rubygems/remote.rb +3 -4
- data/lib/bundler/source/rubygems.rb +223 -255
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +33 -11
- data/lib/bundler/source_list.rb +131 -66
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +239 -94
- data/lib/bundler/stub_specification.rb +77 -39
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +23 -19
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +104 -46
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +19 -2
- data/lib/bundler/templates/newgem/README.md.tt +18 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +44 -6
- data/lib/bundler/templates/newgem/bin/console.tt +1 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +37 -40
- data/lib/bundler/templates/newgem/rubocop.yml.tt +8 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/rg_proxy.rb +2 -2
- data/lib/bundler/ui/shell.rb +64 -23
- data/lib/bundler/ui/silent.rb +33 -6
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/uri_credentials_filter.rb +11 -5
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +175 -0
- data/lib/bundler/vendor/fileutils/.document +1 -0
- data/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1490 -432
- data/lib/bundler/vendor/net-http-persistent/.document +1 -0
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +362 -484
- data/lib/bundler/vendor/pub_grub/.document +1 -0
- data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/lib/bundler/vendor/securerandom/.document +1 -0
- data/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/bundler/vendor/thor/.document +1 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +4 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +8 -18
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +27 -20
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +34 -13
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +47 -28
- data/lib/bundler/vendor/thor/lib/thor/base.rb +200 -54
- data/lib/bundler/vendor/thor/lib/thor/command.rb +34 -18
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +10 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +74 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +15 -4
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +17 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +35 -15
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +45 -13
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +86 -13
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +51 -40
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +99 -148
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +6 -43
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -49
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +182 -17
- data/lib/bundler/vendor/tsort/.document +1 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/lib/bundler/vendor/uri/.document +1 -0
- data/lib/bundler/vendor/uri/COPYING +56 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +876 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1578 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_net_http.rb +23 -0
- data/lib/bundler/vendored_persistent.rb +1 -42
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_securerandom.rb +12 -0
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_timeout.rb +12 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +21 -0
- data/lib/bundler/version.rb +5 -20
- data/lib/bundler/vlad.rb +3 -3
- data/lib/bundler/worker.rb +26 -15
- data/lib/bundler/yaml_serializer.rb +21 -13
- data/lib/bundler.rb +364 -230
- metadata +186 -218
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- data/lib/bundler/dep_proxy.rb +0 -48
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/templates/gems.rb +0 -8
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -3
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -7
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -81
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -136
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -223
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -101
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -837
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -12
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/lib/bundler/version_ranges.rb +0 -76
- data/man/bundle-add.1 +0 -58
- data/man/bundle-add.1.txt +0 -52
- data/man/bundle-add.ronn +0 -40
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -529
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1 +0 -80
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-gem.ronn +0 -78
- data/man/bundle-info.1 +0 -20
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-info.ronn +0 -17
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1 +0 -33
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -396
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1 +0 -32
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
- data/man/bundle-package.ronn +0 -72
- data/man/bundle-platform.1 +0 -61
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -391
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -653
- /data/lib/bundler/{ssl_certs → man}/.document +0 -0
data/lib/bundler/cli.rb
CHANGED
@@ -1,24 +1,32 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require "bundler/vendored_thor"
|
3
|
+
require_relative "vendored_thor"
|
5
4
|
|
6
5
|
module Bundler
|
7
6
|
class CLI < Thor
|
8
|
-
|
7
|
+
require_relative "cli/common"
|
8
|
+
require_relative "cli/install"
|
9
9
|
|
10
10
|
package_name "Bundler"
|
11
11
|
|
12
12
|
AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
|
13
|
-
PARSEABLE_COMMANDS = %w[
|
14
|
-
|
15
|
-
|
13
|
+
PARSEABLE_COMMANDS = %w[check config help exec platform show version].freeze
|
14
|
+
EXTENSIONS = ["c", "rust"].freeze
|
15
|
+
|
16
|
+
COMMAND_ALIASES = {
|
17
|
+
"check" => "c",
|
18
|
+
"install" => "i",
|
19
|
+
"plugin" => "",
|
20
|
+
"list" => "ls",
|
21
|
+
"exec" => ["e", "ex", "exe"],
|
22
|
+
"cache" => ["package", "pack"],
|
23
|
+
"version" => ["-v", "--version"],
|
24
|
+
}.freeze
|
16
25
|
|
17
26
|
def self.start(*)
|
27
|
+
check_deprecated_ext_option(ARGV) if ARGV.include?("--ext")
|
28
|
+
|
18
29
|
super
|
19
|
-
rescue Exception => e
|
20
|
-
Bundler.ui = UI::Shell.new
|
21
|
-
raise e
|
22
30
|
ensure
|
23
31
|
Bundler::SharedHelpers.print_major_deprecations!
|
24
32
|
end
|
@@ -30,19 +38,39 @@ module Bundler
|
|
30
38
|
end
|
31
39
|
end
|
32
40
|
|
41
|
+
def self.all_aliases
|
42
|
+
@all_aliases ||= begin
|
43
|
+
command_aliases = {}
|
44
|
+
|
45
|
+
COMMAND_ALIASES.each do |name, aliases|
|
46
|
+
Array(aliases).each do |one_alias|
|
47
|
+
command_aliases[one_alias] = name
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
command_aliases
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.aliases_for(command_name)
|
56
|
+
COMMAND_ALIASES.select {|k, _| k == command_name }.invert
|
57
|
+
end
|
58
|
+
|
33
59
|
def initialize(*args)
|
34
60
|
super
|
35
61
|
|
36
62
|
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
|
37
63
|
if custom_gemfile && !custom_gemfile.empty?
|
38
64
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
|
39
|
-
Bundler.
|
65
|
+
Bundler.reset_settings_and_root!
|
40
66
|
end
|
41
67
|
|
68
|
+
Bundler.auto_switch
|
69
|
+
|
42
70
|
Bundler.settings.set_command_option_if_given :retry, options[:retry]
|
43
71
|
|
44
72
|
current_cmd = args.last[:current_command].name
|
45
|
-
auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
|
73
|
+
Bundler.auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
|
46
74
|
rescue UnknownArgumentError => e
|
47
75
|
raise InvalidOption, e.message
|
48
76
|
ensure
|
@@ -51,32 +79,17 @@ module Bundler
|
|
51
79
|
Bundler.ui = UI::Shell.new(options)
|
52
80
|
Bundler.ui.level = "debug" if options["verbose"]
|
53
81
|
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
82
|
end
|
63
83
|
|
64
|
-
|
65
|
-
return if Bundler.feature_flag.forget_cli_options?
|
66
|
-
method_option(*args, &blk)
|
67
|
-
end
|
68
|
-
|
69
|
-
check_unknown_options!(:except => [:config, :exec])
|
84
|
+
check_unknown_options!(except: [:config, :exec])
|
70
85
|
stop_on_unknown_option! :exec
|
71
86
|
|
72
|
-
desc "cli_help", "Prints a summary of bundler commands", :
|
87
|
+
desc "cli_help", "Prints a summary of bundler commands", hide: true
|
73
88
|
def cli_help
|
74
89
|
version
|
75
90
|
Bundler.ui.info "\n"
|
76
91
|
|
77
|
-
primary_commands = ["install", "update",
|
78
|
-
Bundler.feature_flag.cache_command_is_package? ? "cache" : "package",
|
79
|
-
"exec", "config", "help"]
|
92
|
+
primary_commands = ["install", "update", "cache", "exec", "config", "help"]
|
80
93
|
|
81
94
|
list = self.class.printable_commands(true)
|
82
95
|
by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
|
@@ -87,37 +100,40 @@ module Bundler
|
|
87
100
|
shell.say "Bundler commands:\n\n"
|
88
101
|
|
89
102
|
shell.say " Primary commands:\n"
|
90
|
-
shell.print_table(primary_commands, :
|
103
|
+
shell.print_table(primary_commands, indent: 4, truncate: true)
|
91
104
|
shell.say
|
92
105
|
shell.say " Utilities:\n"
|
93
|
-
shell.print_table(utilities, :
|
106
|
+
shell.print_table(utilities, indent: 4, truncate: true)
|
94
107
|
shell.say
|
95
108
|
self.class.send(:class_options_help, shell)
|
96
109
|
end
|
97
110
|
default_task(Bundler.feature_flag.default_cli_command)
|
98
111
|
|
99
|
-
class_option "no-color", :
|
100
|
-
class_option "retry",
|
101
|
-
|
102
|
-
class_option "verbose", :
|
112
|
+
class_option "no-color", type: :boolean, desc: "Disable colorization in output"
|
113
|
+
class_option "retry", type: :numeric, aliases: "-r", banner: "NUM",
|
114
|
+
desc: "Specify the number of times you wish to attempt network commands"
|
115
|
+
class_option "verbose", type: :boolean, desc: "Enable verbose output mode", aliases: "-V"
|
103
116
|
|
104
117
|
def help(cli = nil)
|
118
|
+
cli = self.class.all_aliases[cli] if self.class.all_aliases[cli]
|
119
|
+
|
105
120
|
case cli
|
106
121
|
when "gemfile" then command = "gemfile"
|
107
122
|
when nil then command = "bundle"
|
108
123
|
else command = "bundle-#{cli}"
|
109
124
|
end
|
110
125
|
|
111
|
-
man_path
|
112
|
-
man_pages = Hash[Dir.glob(File.join(man_path, "*")).grep(/.*\.\d*\Z/).collect do |f|
|
126
|
+
man_path = File.expand_path("man", __dir__)
|
127
|
+
man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
|
113
128
|
[File.basename(f, ".*"), f]
|
114
129
|
end]
|
115
130
|
|
116
131
|
if man_pages.include?(command)
|
117
|
-
|
118
|
-
|
132
|
+
man_page = man_pages[command]
|
133
|
+
if Bundler.which("man") && !man_path.match?(%r{^file:/.+!/META-INF/jruby.home/.+})
|
134
|
+
Kernel.exec("man", man_page)
|
119
135
|
else
|
120
|
-
puts File.read("#{man_path}/#{File.basename(
|
136
|
+
puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
|
121
137
|
end
|
122
138
|
elsif command_path = Bundler.which("bundler-#{cli}")
|
123
139
|
Kernel.exec(command_path, "--help")
|
@@ -142,9 +158,10 @@ module Bundler
|
|
142
158
|
Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
|
143
159
|
dependency listed in the gemspec file to the newly created Gemfile.
|
144
160
|
D
|
145
|
-
|
161
|
+
method_option "gemspec", type: :string, banner: "Use the specified .gemspec to create the Gemfile"
|
162
|
+
method_option "gemfile", type: :string, banner: "Use the specified name for the gemfile instead of 'Gemfile'"
|
146
163
|
def init
|
147
|
-
|
164
|
+
require_relative "cli/init"
|
148
165
|
Init.new(options.dup).run
|
149
166
|
end
|
150
167
|
|
@@ -154,26 +171,31 @@ module Bundler
|
|
154
171
|
all gems are found, Bundler prints a success message and exits with a status of 0.
|
155
172
|
If not, the first missing gem is listed and Bundler exits status 1.
|
156
173
|
D
|
157
|
-
method_option "dry-run", :
|
158
|
-
|
159
|
-
method_option "
|
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"
|
174
|
+
method_option "dry-run", type: :boolean, default: false, banner: "Lock the Gemfile"
|
175
|
+
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
176
|
+
method_option "path", type: :string, banner: "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?}"
|
164
177
|
def check
|
165
|
-
|
178
|
+
remembered_flag_deprecation("path")
|
179
|
+
|
180
|
+
require_relative "cli/check"
|
166
181
|
Check.new(options).run
|
167
182
|
end
|
168
183
|
|
184
|
+
map aliases_for("check")
|
185
|
+
|
169
186
|
desc "remove [GEM [GEM ...]]", "Removes gems from the Gemfile"
|
170
187
|
long_desc <<-D
|
171
188
|
Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning.
|
172
189
|
D
|
173
|
-
method_option "install", :
|
174
|
-
"Runs 'bundle install' after removing the gems from the Gemfile"
|
190
|
+
method_option "install", type: :boolean, banner: "Runs 'bundle install' after removing the gems from the Gemfile"
|
175
191
|
def remove(*gems)
|
176
|
-
|
192
|
+
if ARGV.include?("--install")
|
193
|
+
message = "The `--install` flag has been deprecated. `bundle install` is triggered by default."
|
194
|
+
removed_message = "The `--install` flag has been removed. `bundle install` is triggered by default."
|
195
|
+
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
|
196
|
+
end
|
197
|
+
|
198
|
+
require_relative "cli/remove"
|
177
199
|
Remove.new(gems, options).run
|
178
200
|
end
|
179
201
|
|
@@ -188,96 +210,75 @@ module Bundler
|
|
188
210
|
|
189
211
|
If the bundle has already been installed, bundler will tell you so and then exit.
|
190
212
|
D
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
method_option "
|
200
|
-
|
201
|
-
method_option "
|
202
|
-
|
203
|
-
method_option "
|
204
|
-
|
205
|
-
method_option "
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
method_option "
|
210
|
-
|
211
|
-
|
212
|
-
"Don't remove stale gems from the cache."
|
213
|
-
deprecated_option "path", :type => :string, :banner =>
|
214
|
-
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
|
215
|
-
method_option "quiet", :type => :boolean, :banner =>
|
216
|
-
"Only output warnings and errors."
|
217
|
-
deprecated_option "shebang", :type => :string, :banner =>
|
218
|
-
"Specify a different shebang executable name than the default (usually 'ruby')"
|
219
|
-
method_option "standalone", :type => :array, :lazy_default => [], :banner =>
|
220
|
-
"Make a bundle that can work without the Bundler runtime"
|
221
|
-
deprecated_option "system", :type => :boolean, :banner =>
|
222
|
-
"Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
|
223
|
-
method_option "trust-policy", :alias => "P", :type => :string, :banner =>
|
224
|
-
"Gem trust policy (like gem install -P). Must be one of " +
|
225
|
-
Bundler.rubygems.security_policy_keys.join("|")
|
226
|
-
deprecated_option "without", :type => :array, :banner =>
|
227
|
-
"Exclude gems that are part of the specified named group."
|
228
|
-
deprecated_option "with", :type => :array, :banner =>
|
229
|
-
"Include gems that are part of the specified named group."
|
230
|
-
map "i" => "install"
|
213
|
+
method_option "binstubs", type: :string, lazy_default: "bin", banner: "Generate bin stubs for bundled gems to ./bin"
|
214
|
+
method_option "clean", type: :boolean, banner: "Run bundle clean automatically after install"
|
215
|
+
method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments"
|
216
|
+
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install"
|
217
|
+
method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
|
218
|
+
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
219
|
+
method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
|
220
|
+
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
221
|
+
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
|
222
|
+
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
|
223
|
+
method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
|
224
|
+
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
|
225
|
+
method_option "path", type: :string, banner: "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?}"
|
226
|
+
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
227
|
+
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
|
228
|
+
method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
|
229
|
+
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
|
230
|
+
method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
|
231
|
+
method_option "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform"
|
232
|
+
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
|
233
|
+
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
|
231
234
|
def install
|
232
235
|
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
233
|
-
|
234
|
-
|
236
|
+
|
237
|
+
%w[clean deployment frozen no-prune path shebang without with].each do |option|
|
238
|
+
remembered_flag_deprecation(option)
|
239
|
+
end
|
240
|
+
|
241
|
+
print_remembered_flag_deprecation("--system", "path.system", "true") if ARGV.include?("--system")
|
242
|
+
|
243
|
+
remembered_negative_flag_deprecation("no-deployment")
|
244
|
+
|
245
|
+
require_relative "cli/install"
|
246
|
+
Bundler.settings.temporary(no_install: false) do
|
235
247
|
Install.new(options.dup).run
|
236
248
|
end
|
237
249
|
end
|
238
250
|
|
251
|
+
map aliases_for("install")
|
252
|
+
|
239
253
|
desc "update [OPTIONS]", "Update the current environment"
|
240
254
|
long_desc <<-D
|
241
255
|
Update will install the newest versions of the gems listed in the Gemfile. Use
|
242
256
|
update when you have changed the Gemfile, or if you want to get the newest
|
243
257
|
possible versions of the gems in the bundle.
|
244
258
|
D
|
245
|
-
method_option "full-index", :
|
246
|
-
|
247
|
-
method_option "
|
248
|
-
|
249
|
-
method_option "
|
250
|
-
|
251
|
-
method_option "
|
252
|
-
|
253
|
-
method_option "
|
254
|
-
|
255
|
-
method_option "
|
256
|
-
|
257
|
-
method_option "
|
258
|
-
|
259
|
-
method_option "
|
260
|
-
|
261
|
-
method_option "
|
262
|
-
"Update ruby specified in Gemfile.lock"
|
263
|
-
method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner =>
|
264
|
-
"Update the locked version of bundler"
|
265
|
-
method_option "patch", :type => :boolean, :banner =>
|
266
|
-
"Prefer updating only to next patch version"
|
267
|
-
method_option "minor", :type => :boolean, :banner =>
|
268
|
-
"Prefer updating only to next minor version"
|
269
|
-
method_option "major", :type => :boolean, :banner =>
|
270
|
-
"Prefer updating to next major version (default)"
|
271
|
-
method_option "strict", :type => :boolean, :banner =>
|
272
|
-
"Do not allow any gem to be updated past latest --patch | --minor | --major"
|
273
|
-
method_option "conservative", :type => :boolean, :banner =>
|
274
|
-
"Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
|
275
|
-
method_option "all", :type => :boolean, :banner =>
|
276
|
-
"Update everything."
|
259
|
+
method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
|
260
|
+
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
261
|
+
method_option "group", aliases: "-g", type: :array, banner: "Update a specific group"
|
262
|
+
method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
|
263
|
+
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
264
|
+
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
265
|
+
method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
|
266
|
+
method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
|
267
|
+
method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
|
268
|
+
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
|
269
|
+
method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
|
270
|
+
method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
|
271
|
+
method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
|
272
|
+
method_option "pre", type: :boolean, banner: "Always choose the highest allowed version when updating gems, regardless of prerelease status"
|
273
|
+
method_option "strict", type: :boolean, banner: "Do not allow any gem to be updated past latest --patch | --minor | --major"
|
274
|
+
method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
|
275
|
+
method_option "all", type: :boolean, banner: "Update everything."
|
277
276
|
def update(*gems)
|
278
277
|
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
279
|
-
|
280
|
-
|
278
|
+
require_relative "cli/update"
|
279
|
+
Bundler.settings.temporary(no_install: false) do
|
280
|
+
Update.new(options, gems).run
|
281
|
+
end
|
281
282
|
end
|
282
283
|
|
283
284
|
desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
|
@@ -285,51 +286,35 @@ module Bundler
|
|
285
286
|
Show lists the names and versions of all gems that are required by your Gemfile.
|
286
287
|
Calling show with [GEM] will list the exact location of that gem on your machine.
|
287
288
|
D
|
288
|
-
method_option "paths", :
|
289
|
-
|
290
|
-
method_option "outdated", :type => :boolean,
|
291
|
-
:banner => "Show verbose output including whether gems are outdated."
|
289
|
+
method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
|
290
|
+
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
|
292
291
|
def show(gem_name = nil)
|
293
|
-
if ARGV
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
new_arguments = rest.map do |arg|
|
299
|
-
next arg if arg != "--paths"
|
300
|
-
next "--path" if new_command == "info"
|
301
|
-
end
|
302
|
-
|
303
|
-
old_argv = ARGV.join(" ")
|
304
|
-
new_argv = [new_command, *new_arguments.compact].join(" ")
|
305
|
-
|
306
|
-
Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
|
292
|
+
if ARGV.include?("--outdated")
|
293
|
+
message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
|
294
|
+
removed_message = "the `--outdated` flag to `bundle show` was undocumented and has been removed without replacement"
|
295
|
+
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
|
307
296
|
end
|
308
|
-
|
297
|
+
require_relative "cli/show"
|
309
298
|
Show.new(options, gem_name).run
|
310
299
|
end
|
311
|
-
# TODO: 2.0 remove `bundle show`
|
312
|
-
|
313
|
-
if Bundler.feature_flag.list_command?
|
314
|
-
desc "list", "List all gems in the bundle"
|
315
|
-
method_option "name-only", :type => :boolean, :banner => "print only the gem names"
|
316
|
-
method_option "only-group", :type => :string, :banner => "print gems from a particular group"
|
317
|
-
method_option "without-group", :type => :string, :banner => "print all gems expect from a group"
|
318
|
-
method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
|
319
|
-
def list
|
320
|
-
require "bundler/cli/list"
|
321
|
-
List.new(options).run
|
322
|
-
end
|
323
300
|
|
324
|
-
|
325
|
-
|
326
|
-
|
301
|
+
desc "list", "List all gems in the bundle"
|
302
|
+
method_option "name-only", type: :boolean, banner: "print only the gem names"
|
303
|
+
method_option "only-group", type: :array, default: [], banner: "print gems from a given set of groups"
|
304
|
+
method_option "without-group", type: :array, default: [], banner: "print all gems except from a given set of groups"
|
305
|
+
method_option "paths", type: :boolean, banner: "print the path to each gem in the bundle"
|
306
|
+
def list
|
307
|
+
require_relative "cli/list"
|
308
|
+
List.new(options).run
|
327
309
|
end
|
328
310
|
|
311
|
+
map aliases_for("list")
|
312
|
+
|
329
313
|
desc "info GEM [OPTIONS]", "Show information for the given gem"
|
330
|
-
method_option "path", :
|
314
|
+
method_option "path", type: :boolean, banner: "Print full path to gem"
|
315
|
+
method_option "version", type: :boolean, banner: "Print gem version"
|
331
316
|
def info(gem_name)
|
332
|
-
|
317
|
+
require_relative "cli/info"
|
333
318
|
Info.new(options, gem_name).run
|
334
319
|
end
|
335
320
|
|
@@ -339,18 +324,14 @@ module Bundler
|
|
339
324
|
or the --binstubs directory if one has been set. Calling binstubs with [GEM [GEM]]
|
340
325
|
will create binstubs for all given gems.
|
341
326
|
D
|
342
|
-
method_option "force", :
|
343
|
-
|
344
|
-
method_option "
|
345
|
-
|
346
|
-
method_option "
|
347
|
-
|
348
|
-
method_option "standalone", :type => :boolean, :banner =>
|
349
|
-
"Make binstubs that can work without the Bundler runtime"
|
350
|
-
method_option "all", :type => :boolean, :banner =>
|
351
|
-
"Install binstubs for all gems"
|
327
|
+
method_option "force", type: :boolean, default: false, banner: "Overwrite existing binstubs if they exist"
|
328
|
+
method_option "path", type: :string, lazy_default: "bin", banner: "Binstub destination directory (default bin)"
|
329
|
+
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
|
330
|
+
method_option "standalone", type: :boolean, banner: "Make binstubs that can work without the Bundler runtime"
|
331
|
+
method_option "all", type: :boolean, banner: "Install binstubs for all gems"
|
332
|
+
method_option "all-platforms", type: :boolean, default: false, banner: "Install binstubs for all platforms"
|
352
333
|
def binstubs(*gems)
|
353
|
-
|
334
|
+
require_relative "cli/binstubs"
|
354
335
|
Binstubs.new(options, gems).run
|
355
336
|
end
|
356
337
|
|
@@ -358,15 +339,22 @@ module Bundler
|
|
358
339
|
long_desc <<-D
|
359
340
|
Adds the specified gem to Gemfile (if valid) and run 'bundle install' in one step.
|
360
341
|
D
|
361
|
-
method_option "version", :
|
362
|
-
method_option "group", :
|
363
|
-
method_option "source", :
|
364
|
-
method_option "
|
365
|
-
|
366
|
-
method_option "
|
367
|
-
method_option "
|
342
|
+
method_option "version", aliases: "-v", type: :string
|
343
|
+
method_option "group", aliases: "-g", type: :string
|
344
|
+
method_option "source", aliases: "-s", type: :string
|
345
|
+
method_option "require", aliases: "-r", type: :string, banner: "Adds require path to gem. Provide false, or a path as a string."
|
346
|
+
method_option "path", type: :string
|
347
|
+
method_option "git", type: :string
|
348
|
+
method_option "github", type: :string
|
349
|
+
method_option "branch", type: :string
|
350
|
+
method_option "ref", type: :string
|
351
|
+
method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
|
352
|
+
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
353
|
+
method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
|
354
|
+
method_option "optimistic", type: :boolean, banner: "Adds optimistic declaration of version to gem"
|
355
|
+
method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"
|
368
356
|
def add(*gems)
|
369
|
-
|
357
|
+
require_relative "cli/add"
|
370
358
|
Add.new(options.dup, gems).run
|
371
359
|
end
|
372
360
|
|
@@ -378,91 +366,94 @@ module Bundler
|
|
378
366
|
are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
|
379
367
|
|
380
368
|
For more information on patch level options (--major, --minor, --patch,
|
381
|
-
--
|
369
|
+
--strict) see documentation on the same options on the update command.
|
382
370
|
D
|
383
|
-
method_option "group", :
|
384
|
-
method_option "groups", :
|
385
|
-
method_option "local", :
|
386
|
-
|
387
|
-
method_option "
|
388
|
-
method_option "
|
389
|
-
method_option "strict", :
|
390
|
-
|
391
|
-
method_option "
|
392
|
-
|
393
|
-
method_option "
|
394
|
-
method_option "
|
395
|
-
method_option "patch", :
|
396
|
-
method_option "
|
397
|
-
method_option "
|
398
|
-
method_option "filter-patch", :type => :boolean, :banner => "Only list patch newer versions"
|
399
|
-
method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner =>
|
400
|
-
"Use minimal formatting for more parseable output"
|
401
|
-
method_option "only-explicit", :type => :boolean, :banner =>
|
402
|
-
"Only list gems specified in your Gemfile, not their dependencies"
|
371
|
+
method_option "group", type: :string, banner: "List gems from a specific group"
|
372
|
+
method_option "groups", type: :boolean, banner: "List gems organized by groups"
|
373
|
+
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
374
|
+
method_option "pre", type: :boolean, banner: "Check for newer pre-release gems"
|
375
|
+
method_option "source", type: :array, banner: "Check against a specific source"
|
376
|
+
method_option "filter-strict", type: :boolean, aliases: "--strict", banner: "Only list newer versions allowed by your Gemfile requirements"
|
377
|
+
method_option "update-strict", type: :boolean, banner: "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
|
378
|
+
method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
|
379
|
+
method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
|
380
|
+
method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
|
381
|
+
method_option "filter-major", type: :boolean, banner: "Only list major newer versions"
|
382
|
+
method_option "filter-minor", type: :boolean, banner: "Only list minor newer versions"
|
383
|
+
method_option "filter-patch", type: :boolean, banner: "Only list patch newer versions"
|
384
|
+
method_option "parseable", aliases: "--porcelain", type: :boolean, banner: "Use minimal formatting for more parseable output"
|
385
|
+
method_option "only-explicit", type: :boolean, banner: "Only list gems specified in your Gemfile, not their dependencies"
|
403
386
|
def outdated(*gems)
|
404
|
-
|
387
|
+
require_relative "cli/outdated"
|
405
388
|
Outdated.new(options, gems).run
|
406
389
|
end
|
407
390
|
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
method_option "all", :type => :boolean,
|
414
|
-
:banner => "Include all sources (including path and git)."
|
415
|
-
end
|
416
|
-
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
|
417
|
-
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
418
|
-
def cache
|
419
|
-
require "bundler/cli/cache"
|
420
|
-
Cache.new(options).run
|
421
|
-
end
|
391
|
+
desc "fund [OPTIONS]", "Lists information about gems seeking funding assistance"
|
392
|
+
method_option "group", aliases: "-g", type: :array, banner: "Fetch funding information for a specific group"
|
393
|
+
def fund
|
394
|
+
require_relative "cli/fund"
|
395
|
+
Fund.new(options).run
|
422
396
|
end
|
423
397
|
|
424
|
-
desc "
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
method_option "
|
430
|
-
method_option "
|
431
|
-
|
432
|
-
method_option "
|
433
|
-
method_option "
|
434
|
-
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
435
|
-
method_option "path", :type => :string, :banner =>
|
436
|
-
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
|
437
|
-
method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
|
438
|
-
method_option "frozen", :type => :boolean, :banner =>
|
439
|
-
"Do not allow the Gemfile.lock to be updated after this package operation's install"
|
398
|
+
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
399
|
+
method_option "all", type: :boolean, default: Bundler.feature_flag.cache_all?, banner: "Include all sources (including path and git)."
|
400
|
+
method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
|
401
|
+
method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
|
402
|
+
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
403
|
+
method_option "no-install", type: :boolean, banner: "Don't install the gems, only update the cache."
|
404
|
+
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
|
405
|
+
method_option "path", type: :string, banner: "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?}"
|
406
|
+
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
407
|
+
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install"
|
440
408
|
long_desc <<-D
|
441
|
-
The
|
409
|
+
The cache command will copy the .gem files for every gem in the bundle into the
|
442
410
|
directory ./vendor/cache. If you then check that directory into your source
|
443
411
|
control repository, others who check out your source will be able to install the
|
444
412
|
bundle without having to download any additional gems.
|
445
413
|
D
|
446
|
-
def
|
447
|
-
|
448
|
-
|
414
|
+
def cache
|
415
|
+
print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
|
416
|
+
|
417
|
+
if ARGV.include?("--path")
|
418
|
+
message =
|
419
|
+
"The `--path` flag is deprecated because its semantics are unclear. " \
|
420
|
+
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
421
|
+
"and `bundle config path` to configure the path where your gems are installed, " \
|
422
|
+
"and stop using this flag"
|
423
|
+
removed_message =
|
424
|
+
"The `--path` flag has been removed because its semantics were unclear. " \
|
425
|
+
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
426
|
+
"and `bundle config path` to configure the path where your gems are installed."
|
427
|
+
SharedHelpers.major_deprecation 2, message, removed_message: removed_message
|
428
|
+
end
|
429
|
+
|
430
|
+
require_relative "cli/cache"
|
431
|
+
Cache.new(options).run
|
449
432
|
end
|
450
|
-
|
433
|
+
|
434
|
+
map aliases_for("cache")
|
451
435
|
|
452
436
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
453
|
-
method_option :keep_file_descriptors, :
|
454
|
-
method_option :gemfile, :
|
437
|
+
method_option :keep_file_descriptors, type: :boolean, default: true, banner: "Passes all file descriptors to the new processes. Default is true, and setting it to false is deprecated"
|
438
|
+
method_option :gemfile, type: :string, required: false, banner: "Use the specified gemfile instead of Gemfile"
|
455
439
|
long_desc <<-D
|
456
440
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
457
441
|
bundle exec you can require and call the bundled gems as if they were installed
|
458
442
|
into the system wide RubyGems repository.
|
459
443
|
D
|
460
|
-
map "e" => "exec"
|
461
444
|
def exec(*args)
|
462
|
-
|
445
|
+
if ARGV.include?("--no-keep-file-descriptors")
|
446
|
+
message = "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to"
|
447
|
+
removed_message = "The `--no-keep-file-descriptors` has been removed. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to"
|
448
|
+
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
|
449
|
+
end
|
450
|
+
|
451
|
+
require_relative "cli/exec"
|
463
452
|
Exec.new(options, args).run
|
464
453
|
end
|
465
454
|
|
455
|
+
map aliases_for("exec")
|
456
|
+
|
466
457
|
desc "config NAME [VALUE]", "Retrieve or set a configuration value"
|
467
458
|
long_desc <<-D
|
468
459
|
Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
|
@@ -471,31 +462,27 @@ module Bundler
|
|
471
462
|
By default, setting a configuration value sets it for all projects
|
472
463
|
on the machine.
|
473
464
|
|
474
|
-
If a global setting is
|
475
|
-
will show the current value, as well as any
|
465
|
+
If a global setting is superseded by local configuration, this command
|
466
|
+
will show the current value, as well as any superseded values and
|
476
467
|
where they were specified.
|
477
468
|
D
|
478
|
-
|
479
|
-
|
480
|
-
require "bundler/cli/config"
|
481
|
-
Config.new(options, args, self).run
|
482
|
-
end
|
469
|
+
require_relative "cli/config"
|
470
|
+
subcommand "config", Config
|
483
471
|
|
484
472
|
desc "open GEM", "Opens the source directory of the given bundled gem"
|
473
|
+
method_option "path", type: :string, lazy_default: "", banner: "Open relative path of the gem source."
|
485
474
|
def open(name)
|
486
|
-
|
475
|
+
require_relative "cli/open"
|
487
476
|
Open.new(options, name).run
|
488
477
|
end
|
489
478
|
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
Console.new(options, group).run
|
495
|
-
end
|
479
|
+
desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
|
480
|
+
def console(group = nil)
|
481
|
+
require_relative "cli/console"
|
482
|
+
Console.new(options, group).run
|
496
483
|
end
|
497
484
|
|
498
|
-
desc "version", "Prints
|
485
|
+
desc "version", "Prints Bundler version information"
|
499
486
|
def version
|
500
487
|
cli_help = current_command.name == "cli_help"
|
501
488
|
if cli_help || ARGV.include?("version")
|
@@ -508,7 +495,8 @@ module Bundler
|
|
508
495
|
Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
|
509
496
|
end
|
510
497
|
end
|
511
|
-
|
498
|
+
|
499
|
+
map aliases_for("version")
|
512
500
|
|
513
501
|
desc "licenses", "Prints the license of all gems in the bundle"
|
514
502
|
def licenses
|
@@ -524,122 +512,95 @@ module Bundler
|
|
524
512
|
end
|
525
513
|
end
|
526
514
|
|
527
|
-
|
528
|
-
desc "viz [OPTIONS]", "Generates a visual dependency graph", :
|
515
|
+
unless Bundler.feature_flag.bundler_3_mode?
|
516
|
+
desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
|
529
517
|
long_desc <<-D
|
530
518
|
Viz generates a PNG file of the current Gemfile as a dependency graph.
|
531
519
|
Viz requires the ruby-graphviz gem (and its dependencies).
|
532
520
|
The associated gems must also be installed via 'bundle install'.
|
533
521
|
D
|
534
|
-
method_option :file, :
|
535
|
-
method_option :format, :
|
536
|
-
method_option :requirements, :
|
537
|
-
method_option :version, :
|
538
|
-
method_option :without, :
|
522
|
+
method_option :file, type: :string, default: "gem_graph", aliases: "-f", desc: "The name to use for the generated file. see format option"
|
523
|
+
method_option :format, type: :string, default: "png", aliases: "-F", desc: "This is output format option. Supported format is png, jpg, svg, dot ..."
|
524
|
+
method_option :requirements, type: :boolean, default: false, aliases: "-R", desc: "Set to show the version of each required dependency."
|
525
|
+
method_option :version, type: :boolean, default: false, aliases: "-v", desc: "Set to show each gem version."
|
526
|
+
method_option :without, type: :array, default: [], aliases: "-W", banner: "GROUP[ GROUP...]", desc: "Exclude gems that are part of the specified named group."
|
539
527
|
def viz
|
540
|
-
SharedHelpers.major_deprecation 2, "The `viz` command has been
|
541
|
-
|
528
|
+
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
|
529
|
+
require_relative "cli/viz"
|
542
530
|
Viz.new(options.dup).run
|
543
531
|
end
|
544
532
|
end
|
545
533
|
|
546
|
-
old_gem = instance_method(:gem)
|
547
|
-
|
548
534
|
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
549
|
-
method_option :exe, :
|
550
|
-
method_option :coc, :
|
551
|
-
method_option :edit, :
|
552
|
-
|
553
|
-
|
554
|
-
method_option :
|
555
|
-
method_option :
|
556
|
-
method_option :
|
557
|
-
|
558
|
-
|
559
|
-
|
535
|
+
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
|
536
|
+
method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
|
537
|
+
method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR", lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
538
|
+
method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
|
539
|
+
method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
|
540
|
+
method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
|
541
|
+
method_option :rubocop, type: :boolean, desc: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
|
542
|
+
method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
|
543
|
+
method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
544
|
+
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
|
545
|
+
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
546
|
+
method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
|
560
547
|
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
require "bundler/cli/gem"
|
566
|
-
cmd_args = args + [instance]
|
567
|
-
cmd_args.unshift(instance.options)
|
568
|
-
|
569
|
-
cmd = begin
|
570
|
-
Gem.new(*cmd_args)
|
571
|
-
rescue ArgumentError => e
|
572
|
-
instance.class.handle_argument_error(self, e, args, arity)
|
573
|
-
end
|
548
|
+
def gem(name)
|
549
|
+
require_relative "cli/gem"
|
550
|
+
cmd_args = args + [self]
|
551
|
+
cmd_args.unshift(options)
|
574
552
|
|
575
|
-
|
576
|
-
end
|
553
|
+
Gem.new(*cmd_args).run
|
577
554
|
end
|
578
555
|
|
579
|
-
undef_method(:gem)
|
580
|
-
define_method(:gem, old_gem)
|
581
|
-
private :gem
|
582
|
-
|
583
556
|
def self.source_root
|
584
|
-
File.expand_path(
|
557
|
+
File.expand_path("templates", __dir__)
|
585
558
|
end
|
586
559
|
|
587
|
-
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :
|
588
|
-
method_option "dry-run", :
|
589
|
-
|
590
|
-
method_option "force", :type => :boolean, :default => false, :banner =>
|
591
|
-
"Forces clean even if --path is not set"
|
560
|
+
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", hide: true
|
561
|
+
method_option "dry-run", type: :boolean, default: false, banner: "Only print out changes, do not clean gems"
|
562
|
+
method_option "force", type: :boolean, default: false, banner: "Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application."
|
592
563
|
def clean
|
593
|
-
|
564
|
+
require_relative "cli/clean"
|
594
565
|
Clean.new(options.dup).run
|
595
566
|
end
|
596
567
|
|
597
568
|
desc "platform [OPTIONS]", "Displays platform compatibility information"
|
598
|
-
method_option "ruby", :
|
599
|
-
"only display ruby related platform information"
|
569
|
+
method_option "ruby", type: :boolean, default: false, banner: "only display ruby related platform information"
|
600
570
|
def platform
|
601
|
-
|
571
|
+
require_relative "cli/platform"
|
602
572
|
Platform.new(options).run
|
603
573
|
end
|
604
574
|
|
605
|
-
desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", :
|
606
|
-
method_option "source", :
|
607
|
-
|
608
|
-
method_option "group", :type => :string, :banner =>
|
609
|
-
"Install gem into a bundler group"
|
575
|
+
desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", hide: true
|
576
|
+
method_option "source", type: :string, banner: "Install gem from the given source"
|
577
|
+
method_option "group", type: :string, banner: "Install gem into a bundler group"
|
610
578
|
def inject(name, version)
|
611
579
|
SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
|
612
|
-
|
580
|
+
require_relative "cli/inject"
|
613
581
|
Inject.new(options.dup, name, version).run
|
614
582
|
end
|
615
583
|
|
616
584
|
desc "lock", "Creates a lockfile without installing"
|
617
|
-
method_option "update", :
|
618
|
-
|
619
|
-
method_option "
|
620
|
-
|
621
|
-
method_option "
|
622
|
-
|
623
|
-
method_option "
|
624
|
-
|
625
|
-
method_option "
|
626
|
-
|
627
|
-
method_option "
|
628
|
-
|
629
|
-
method_option "
|
630
|
-
|
631
|
-
method_option "
|
632
|
-
|
633
|
-
method_option "
|
634
|
-
"If updating, prefer updating only to next minor version"
|
635
|
-
method_option "major", :type => :boolean, :banner =>
|
636
|
-
"If updating, prefer updating to next major version (default)"
|
637
|
-
method_option "strict", :type => :boolean, :banner =>
|
638
|
-
"If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
|
639
|
-
method_option "conservative", :type => :boolean, :banner =>
|
640
|
-
"If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
|
585
|
+
method_option "update", type: :array, lazy_default: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
|
586
|
+
method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
|
587
|
+
method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
|
588
|
+
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
589
|
+
method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
|
590
|
+
method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
|
591
|
+
method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
|
592
|
+
method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
|
593
|
+
method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
|
594
|
+
method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
|
595
|
+
method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
|
596
|
+
method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
|
597
|
+
method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
|
598
|
+
method_option "pre", type: :boolean, banner: "If updating, always choose the highest allowed version, regardless of prerelease status"
|
599
|
+
method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
|
600
|
+
method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
|
601
|
+
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
|
641
602
|
def lock
|
642
|
-
|
603
|
+
require_relative "cli/lock"
|
643
604
|
Lock.new(options).run
|
644
605
|
end
|
645
606
|
|
@@ -654,18 +615,16 @@ module Bundler
|
|
654
615
|
missing dependencies are detected, Bundler prints them and exits status 1.
|
655
616
|
Otherwise, Bundler prints a success message and exits with a status of 0.
|
656
617
|
D
|
657
|
-
method_option "gemfile", :
|
658
|
-
|
659
|
-
method_option "quiet", :type => :boolean, :banner =>
|
660
|
-
"Only output warnings and errors."
|
618
|
+
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
619
|
+
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
661
620
|
def doctor
|
662
|
-
|
621
|
+
require_relative "cli/doctor"
|
663
622
|
Doctor.new(options).run
|
664
623
|
end
|
665
624
|
|
666
625
|
desc "issue", "Learn how to report an issue in Bundler"
|
667
626
|
def issue
|
668
|
-
|
627
|
+
require_relative "cli/issue"
|
669
628
|
Issue.new.run
|
670
629
|
end
|
671
630
|
|
@@ -676,12 +635,14 @@ module Bundler
|
|
676
635
|
checkout --force`.
|
677
636
|
D
|
678
637
|
def pristine(*gems)
|
679
|
-
|
680
|
-
|
638
|
+
require_relative "cli/pristine"
|
639
|
+
Bundler.settings.temporary(no_install: false) do
|
640
|
+
Pristine.new(gems).run
|
641
|
+
end
|
681
642
|
end
|
682
643
|
|
683
644
|
if Bundler.feature_flag.plugins?
|
684
|
-
|
645
|
+
require_relative "cli/plugin"
|
685
646
|
desc "plugin", "Manage the bundler plugins"
|
686
647
|
subcommand "plugin", Plugin
|
687
648
|
end
|
@@ -689,12 +650,16 @@ module Bundler
|
|
689
650
|
# Reformat the arguments passed to bundle that include a --help flag
|
690
651
|
# into the corresponding `bundle help #{command}` call
|
691
652
|
def self.reformatted_help_args(args)
|
692
|
-
bundler_commands =
|
653
|
+
bundler_commands = (COMMAND_ALIASES.keys + COMMAND_ALIASES.values).flatten
|
654
|
+
|
693
655
|
help_flags = %w[--help -h]
|
694
|
-
exec_commands =
|
656
|
+
exec_commands = ["exec"] + COMMAND_ALIASES["exec"]
|
657
|
+
|
695
658
|
help_used = args.index {|a| help_flags.include? a }
|
696
659
|
exec_used = args.index {|a| exec_commands.include? a }
|
660
|
+
|
697
661
|
command = args.find {|a| bundler_commands.include? a }
|
662
|
+
|
698
663
|
if exec_used && help_used
|
699
664
|
if exec_used + help_used == 1
|
700
665
|
%w[help exec]
|
@@ -710,28 +675,42 @@ module Bundler
|
|
710
675
|
end
|
711
676
|
end
|
712
677
|
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
# `Installer` that'll keep a reference to the old one instead.
|
722
|
-
def auto_install
|
723
|
-
return unless Bundler.settings[:auto_install]
|
724
|
-
|
725
|
-
begin
|
726
|
-
Bundler.definition.specs
|
727
|
-
rescue GemNotFound
|
728
|
-
Bundler.ui.info "Automatically installing missing gems."
|
729
|
-
Bundler.reset!
|
730
|
-
invoke :install, []
|
731
|
-
Bundler.reset!
|
678
|
+
def self.check_deprecated_ext_option(arguments)
|
679
|
+
# when deprecated version of `--ext` is called
|
680
|
+
# print out deprecation warning and pretend `--ext=c` was provided
|
681
|
+
if deprecated_ext_value?(arguments)
|
682
|
+
message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been deprecated. Please select a language, e.g. `--ext=rust` to generate a Rust extension. This gem will now be generated as if `--ext=c` was used."
|
683
|
+
removed_message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been removed. Please select a language, e.g. `--ext=rust` to generate a Rust extension."
|
684
|
+
SharedHelpers.major_deprecation 2, message, removed_message: removed_message
|
685
|
+
arguments[arguments.index("--ext")] = "--ext=c"
|
732
686
|
end
|
733
687
|
end
|
734
688
|
|
689
|
+
def self.deprecated_ext_value?(arguments)
|
690
|
+
index = arguments.index("--ext")
|
691
|
+
next_argument = arguments[index + 1]
|
692
|
+
|
693
|
+
# it is ok when --ext is followed with valid extension value
|
694
|
+
# for example `bundle gem hello --ext c`
|
695
|
+
return false if EXTENSIONS.include?(next_argument)
|
696
|
+
|
697
|
+
# deprecated call when --ext is called with no value in last position
|
698
|
+
# for example `bundle gem hello_gem --ext`
|
699
|
+
return true if next_argument.nil?
|
700
|
+
|
701
|
+
# deprecated call when --ext is followed by other parameter
|
702
|
+
# for example `bundle gem --ext --no-ci hello_gem`
|
703
|
+
return true if next_argument.start_with?("-")
|
704
|
+
|
705
|
+
# deprecated call when --ext is followed by gem name
|
706
|
+
# for example `bundle gem --ext hello_gem`
|
707
|
+
return true if next_argument
|
708
|
+
|
709
|
+
false
|
710
|
+
end
|
711
|
+
|
712
|
+
private
|
713
|
+
|
735
714
|
def current_command
|
736
715
|
_, _, config = @_initializer
|
737
716
|
config[:current_command]
|
@@ -761,30 +740,60 @@ module Bundler
|
|
761
740
|
|
762
741
|
return unless SharedHelpers.md5_available?
|
763
742
|
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
dependencies("bundler").
|
769
|
-
map {|d| Gem::Version.new(d.first) }.
|
770
|
-
max
|
743
|
+
require_relative "vendored_uri"
|
744
|
+
remote = Source::Rubygems::Remote.new(Gem::URI("https://rubygems.org"))
|
745
|
+
cache_path = Bundler.user_cache.join("compact_index", remote.cache_slug)
|
746
|
+
latest = Bundler::CompactIndexClient.new(cache_path).latest_version("bundler")
|
771
747
|
return unless latest
|
772
748
|
|
773
749
|
current = Gem::Version.new(VERSION)
|
774
750
|
return if current >= latest
|
775
|
-
latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
|
776
|
-
|
777
|
-
installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
|
778
|
-
if latest_installed && latest_installed > current
|
779
|
-
suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
|
780
|
-
suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
|
781
|
-
else
|
782
|
-
suggestion = installation
|
783
|
-
end
|
784
751
|
|
785
|
-
Bundler.ui.warn
|
752
|
+
Bundler.ui.warn \
|
753
|
+
"The latest bundler is #{latest}, but you are currently running #{current}.\n" \
|
754
|
+
"To update to the most recent version, run `bundle update --bundler`"
|
786
755
|
rescue RuntimeError
|
787
756
|
nil
|
788
757
|
end
|
758
|
+
|
759
|
+
def remembered_negative_flag_deprecation(name)
|
760
|
+
positive_name = name.gsub(/\Ano-/, "")
|
761
|
+
option = current_command.options[positive_name]
|
762
|
+
flag_name = "--no-" + option.switch_name.gsub(/\A--/, "")
|
763
|
+
|
764
|
+
flag_deprecation(positive_name, flag_name, option)
|
765
|
+
end
|
766
|
+
|
767
|
+
def remembered_flag_deprecation(name)
|
768
|
+
option = current_command.options[name]
|
769
|
+
flag_name = option.switch_name
|
770
|
+
|
771
|
+
flag_deprecation(name, flag_name, option)
|
772
|
+
end
|
773
|
+
|
774
|
+
def flag_deprecation(name, flag_name, option)
|
775
|
+
name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
|
776
|
+
return unless name_index
|
777
|
+
|
778
|
+
value = options[name]
|
779
|
+
value = value.join(" ").to_s if option.type == :array
|
780
|
+
value = "'#{value}'" unless option.type == :boolean
|
781
|
+
|
782
|
+
print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
|
783
|
+
end
|
784
|
+
|
785
|
+
def print_remembered_flag_deprecation(flag_name, option_name, option_value)
|
786
|
+
message =
|
787
|
+
"The `#{flag_name}` flag is deprecated because it relies on being " \
|
788
|
+
"remembered across bundler invocations, which bundler will no longer " \
|
789
|
+
"do in future versions. Instead please use `bundle config set #{option_name} " \
|
790
|
+
"#{option_value}`, and stop using this flag"
|
791
|
+
removed_message =
|
792
|
+
"The `#{flag_name}` flag has been removed because it relied on being " \
|
793
|
+
"remembered across bundler invocations, which bundler will no longer " \
|
794
|
+
"do. Instead please use `bundle config set #{option_name} " \
|
795
|
+
"#{option_value}`, and stop using this flag"
|
796
|
+
Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
|
797
|
+
end
|
789
798
|
end
|
790
799
|
end
|