bundler 2.1.4 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2468 -1430
- data/README.md +8 -10
- data/bundler.gemspec +10 -13
- data/exe/bundle +7 -8
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli/add.rb +2 -2
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +3 -8
- data/lib/bundler/cli/check.rb +5 -3
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +32 -3
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/console.rb +3 -3
- data/lib/bundler/cli/doctor.rb +23 -6
- data/lib/bundler/cli/exec.rb +5 -10
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +258 -45
- data/lib/bundler/cli/info.rb +38 -6
- data/lib/bundler/cli/init.rb +7 -3
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +27 -57
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +11 -4
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +106 -79
- data/lib/bundler/cli/platform.rb +2 -2
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +20 -9
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +149 -85
- data/lib/bundler/compact_index_client/cache.rb +7 -24
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +56 -51
- data/lib/bundler/compact_index_client.rb +3 -9
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +17 -6
- data/lib/bundler/definition.rb +343 -440
- data/lib/bundler/dependency.rb +23 -77
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +77 -85
- data/lib/bundler/endpoint_specification.rb +20 -14
- data/lib/bundler/env.rb +3 -3
- data/lib/bundler/environment_preserver.rb +30 -2
- data/lib/bundler/errors.rb +31 -14
- data/lib/bundler/feature_flag.rb +0 -9
- data/lib/bundler/fetcher/base.rb +7 -9
- data/lib/bundler/fetcher/compact_index.rb +20 -27
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +11 -11
- data/lib/bundler/fetcher/index.rb +2 -30
- data/lib/bundler/fetcher.rb +24 -29
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +45 -49
- data/lib/bundler/gem_helper.rb +53 -31
- data/lib/bundler/gem_helpers.rb +42 -24
- data/lib/bundler/gem_version_promoter.rb +54 -99
- data/lib/bundler/graph.rb +4 -4
- data/lib/bundler/index.rb +14 -52
- data/lib/bundler/injector.rb +40 -8
- data/lib/bundler/inline.rb +6 -15
- data/lib/bundler/installer/gem_installer.rb +19 -24
- data/lib/bundler/installer/parallel_installer.rb +32 -42
- data/lib/bundler/installer/standalone.rb +58 -11
- data/lib/bundler/installer.rb +47 -87
- data/lib/bundler/lazy_specification.rb +76 -35
- data/lib/bundler/lockfile_generator.rb +3 -3
- data/lib/bundler/lockfile_parser.rb +24 -49
- data/lib/bundler/man/.document +1 -0
- data/{man → lib/bundler/man}/bundle-add.1 +21 -5
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +16 -4
- data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man → lib/bundler/man}/bundle-cache.1 +7 -1
- data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +7 -0
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man → lib/bundler/man}/bundle-clean.1 +2 -2
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +65 -47
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +74 -65
- data/lib/bundler/man/bundle-console.1 +53 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +2 -2
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
- data/lib/bundler/man/bundle-gem.1 +105 -0
- data/lib/bundler/man/bundle-gem.1.ronn +117 -0
- data/lib/bundler/man/bundle-help.1 +13 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +5 -2
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +3 -1
- data/{man → lib/bundler/man}/bundle-install.1 +35 -33
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +33 -34
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +3 -10
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +1 -10
- data/{man → lib/bundler/man}/bundle-platform.1 +16 -6
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
- data/lib/bundler/man/bundle-plugin.1 +81 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +5 -5
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +5 -4
- data/lib/bundler/man/bundle-version.1 +35 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/{man → lib/bundler/man}/bundle-viz.1 +4 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +2 -0
- data/{man → lib/bundler/man}/bundle.1 +15 -10
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +12 -7
- data/{man → lib/bundler/man}/gemfile.5 +120 -83
- data/{man → lib/bundler/man}/gemfile.5.ronn +109 -88
- data/{man → lib/bundler/man}/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +0 -1
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +7 -9
- data/lib/bundler/plugin/api/source.rb +25 -9
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +17 -5
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +11 -11
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +58 -11
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +15 -6
- data/lib/bundler/resolver/base.rb +46 -0
- data/lib/bundler/resolver/candidate.rb +92 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +63 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +49 -74
- data/lib/bundler/resolver.rb +320 -344
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +6 -19
- data/lib/bundler/rubygems_ext.rb +231 -32
- data/lib/bundler/rubygems_gem_installer.rb +89 -16
- data/lib/bundler/rubygems_integration.rb +72 -162
- data/lib/bundler/runtime.rb +23 -31
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +145 -72
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +19 -34
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +244 -114
- data/lib/bundler/source/git.rb +62 -46
- data/lib/bundler/source/metadata.rb +3 -8
- data/lib/bundler/source/path/installer.rb +11 -32
- data/lib/bundler/source/path.rb +15 -9
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +167 -199
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +25 -5
- data/lib/bundler/source_list.rb +112 -64
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +64 -61
- data/lib/bundler/stub_specification.rb +30 -10
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +10 -15
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +15 -1
- data/lib/bundler/templates/newgem/README.md.tt +13 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +33 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- 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.rb.tt → extconf-c.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- 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 +34 -18
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -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/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -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/shell.rb +37 -14
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/uri_credentials_filter.rb +3 -1
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +41 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
- 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 +151 -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 +53 -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 +124 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -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/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +9 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +10 -5
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +28 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +28 -7
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +76 -91
- data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +32 -13
- data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
- data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +14 -21
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +11 -17
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- 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 +3 -3
- data/lib/bundler/vendored_persistent.rb +1 -40
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/worker.rb +25 -12
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/lib/bundler.rb +95 -108
- metadata +132 -118
- data/lib/bundler/dep_proxy.rb +0 -48
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- 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 -158
- 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/version_ranges.rb +0 -122
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -528
- 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.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -401
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- 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 -390
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -649
- /data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- /data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- /data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- /data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- /data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- /data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- /data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- /data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
data/lib/bundler/cli/update.rb
CHANGED
@@ -9,14 +9,18 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
-
Bundler.ui.level = "
|
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
|
13
17
|
|
14
18
|
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
15
19
|
|
16
20
|
sources = Array(options[:source])
|
17
21
|
groups = Array(options[:group]).map(&:to_sym)
|
18
22
|
|
19
|
-
full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !
|
23
|
+
full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !update_bundler
|
20
24
|
|
21
25
|
if full_update && !options[:all]
|
22
26
|
if Bundler.feature_flag.update_requires_all_flag?
|
@@ -27,9 +31,14 @@ module Bundler
|
|
27
31
|
raise InvalidOption, "Cannot specify --all along with specific options."
|
28
32
|
end
|
29
33
|
|
34
|
+
conservative = options[:conservative]
|
35
|
+
|
30
36
|
if full_update
|
31
|
-
|
32
|
-
|
37
|
+
if conservative
|
38
|
+
Bundler.definition(:conservative => conservative)
|
39
|
+
else
|
40
|
+
Bundler.definition(true)
|
41
|
+
end
|
33
42
|
else
|
34
43
|
unless Bundler.default_lockfile.exist?
|
35
44
|
raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
|
@@ -43,8 +52,8 @@ module Bundler
|
|
43
52
|
end
|
44
53
|
|
45
54
|
Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
|
46
|
-
:
|
47
|
-
:bundler =>
|
55
|
+
:conservative => conservative,
|
56
|
+
:bundler => update_bundler)
|
48
57
|
end
|
49
58
|
|
50
59
|
Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
|
@@ -61,7 +70,7 @@ module Bundler
|
|
61
70
|
|
62
71
|
if locked_gems = Bundler.definition.locked_gems
|
63
72
|
previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
|
64
|
-
h[s.name] = { :spec => s, :version => s.version, :source => s.source.
|
73
|
+
h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier }
|
65
74
|
h
|
66
75
|
end
|
67
76
|
end
|
@@ -82,7 +91,7 @@ module Bundler
|
|
82
91
|
locked_spec = locked_info[:spec]
|
83
92
|
new_spec = Bundler.definition.specs[name].first
|
84
93
|
unless new_spec
|
85
|
-
|
94
|
+
unless locked_spec.match_platform(Bundler.local_platform)
|
86
95
|
Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one"
|
87
96
|
end
|
88
97
|
|
@@ -90,7 +99,7 @@ module Bundler
|
|
90
99
|
end
|
91
100
|
|
92
101
|
locked_source = locked_info[:source]
|
93
|
-
new_source = new_spec.source.
|
102
|
+
new_source = new_spec.source.identifier
|
94
103
|
next if locked_source != new_source
|
95
104
|
|
96
105
|
new_version = new_spec.version
|
@@ -106,6 +115,8 @@ module Bundler
|
|
106
115
|
Bundler.ui.confirm "Bundle updated!"
|
107
116
|
Bundler::CLI::Common.output_without_groups_message(:update)
|
108
117
|
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
|
118
|
+
|
119
|
+
Bundler::CLI::Common.output_fund_metadata_summary
|
109
120
|
end
|
110
121
|
end
|
111
122
|
end
|
data/lib/bundler/cli/viz.rb
CHANGED
@@ -23,7 +23,7 @@ module Bundler
|
|
23
23
|
Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:"
|
24
24
|
Bundler.ui.warn "`gem install ruby-graphviz`"
|
25
25
|
rescue StandardError => e
|
26
|
-
raise unless e.message
|
26
|
+
raise unless e.message.to_s.include?("GraphViz not installed or dot not in PATH")
|
27
27
|
Bundler.ui.error e.message
|
28
28
|
Bundler.ui.warn "Please install GraphViz. On a Mac with Homebrew, you can run `brew install graphviz`."
|
29
29
|
end
|
data/lib/bundler/cli.rb
CHANGED
@@ -10,10 +10,12 @@ module Bundler
|
|
10
10
|
|
11
11
|
AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
|
12
12
|
PARSEABLE_COMMANDS = %w[check config help exec platform show version].freeze
|
13
|
+
EXTENSIONS = ["c", "rust"].freeze
|
13
14
|
|
14
15
|
COMMAND_ALIASES = {
|
15
16
|
"check" => "c",
|
16
17
|
"install" => "i",
|
18
|
+
"plugin" => "",
|
17
19
|
"list" => "ls",
|
18
20
|
"exec" => ["e", "ex", "exe"],
|
19
21
|
"cache" => ["package", "pack"],
|
@@ -21,6 +23,8 @@ module Bundler
|
|
21
23
|
}.freeze
|
22
24
|
|
23
25
|
def self.start(*)
|
26
|
+
check_deprecated_ext_option(ARGV) if ARGV.include?("--ext")
|
27
|
+
|
24
28
|
super
|
25
29
|
ensure
|
26
30
|
Bundler::SharedHelpers.print_major_deprecations!
|
@@ -57,9 +61,11 @@ module Bundler
|
|
57
61
|
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
|
58
62
|
if custom_gemfile && !custom_gemfile.empty?
|
59
63
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
|
60
|
-
Bundler.
|
64
|
+
Bundler.reset_settings_and_root!
|
61
65
|
end
|
62
66
|
|
67
|
+
Bundler.self_manager.restart_with_locked_bundler_if_needed
|
68
|
+
|
63
69
|
Bundler.settings.set_command_option_if_given :retry, options[:retry]
|
64
70
|
|
65
71
|
current_cmd = args.last[:current_command].name
|
@@ -72,14 +78,6 @@ module Bundler
|
|
72
78
|
Bundler.ui = UI::Shell.new(options)
|
73
79
|
Bundler.ui.level = "debug" if options["verbose"]
|
74
80
|
unprinted_warnings.each {|w| Bundler.ui.warn(w) }
|
75
|
-
|
76
|
-
if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
|
77
|
-
Bundler.ui.warn(
|
78
|
-
"The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
|
79
|
-
"experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
|
80
|
-
"To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
|
81
|
-
)
|
82
|
-
end
|
83
81
|
end
|
84
82
|
|
85
83
|
check_unknown_options!(:except => [:config, :exec])
|
@@ -122,16 +120,17 @@ module Bundler
|
|
122
120
|
else command = "bundle-#{cli}"
|
123
121
|
end
|
124
122
|
|
125
|
-
man_path
|
126
|
-
man_pages = Hash[Dir.glob(File.join(man_path, "*")).grep(/.*\.\d*\Z/).collect do |f|
|
123
|
+
man_path = File.expand_path("man", __dir__)
|
124
|
+
man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
|
127
125
|
[File.basename(f, ".*"), f]
|
128
126
|
end]
|
129
127
|
|
130
128
|
if man_pages.include?(command)
|
129
|
+
man_page = man_pages[command]
|
131
130
|
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
132
|
-
Kernel.exec "man #{
|
131
|
+
Kernel.exec "man #{man_page}"
|
133
132
|
else
|
134
|
-
puts File.read("#{man_path}/#{File.basename(
|
133
|
+
puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
|
135
134
|
end
|
136
135
|
elsif command_path = Bundler.which("bundler-#{cli}")
|
137
136
|
Kernel.exec(command_path, "--help")
|
@@ -190,6 +189,7 @@ module Bundler
|
|
190
189
|
method_option "install", :type => :boolean, :banner =>
|
191
190
|
"Runs 'bundle install' after removing the gems from the Gemfile"
|
192
191
|
def remove(*gems)
|
192
|
+
SharedHelpers.major_deprecation(2, "The `--install` flag has been deprecated. `bundle install` is triggered by default.") if ARGV.include?("--install")
|
193
193
|
require_relative "cli/remove"
|
194
194
|
Remove.new(gems, options).run
|
195
195
|
end
|
@@ -221,6 +221,8 @@ module Bundler
|
|
221
221
|
"Specify the number of jobs to run in parallel"
|
222
222
|
method_option "local", :type => :boolean, :banner =>
|
223
223
|
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
224
|
+
method_option "prefer-local", :type => :boolean, :banner =>
|
225
|
+
"Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
|
224
226
|
method_option "no-cache", :type => :boolean, :banner =>
|
225
227
|
"Don't update the existing gem cache."
|
226
228
|
method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
|
@@ -239,7 +241,7 @@ module Bundler
|
|
239
241
|
"Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
|
240
242
|
method_option "trust-policy", :alias => "P", :type => :string, :banner =>
|
241
243
|
"Gem trust policy (like gem install -P). Must be one of " +
|
242
|
-
|
244
|
+
Bundler.rubygems.security_policy_keys.join("|")
|
243
245
|
method_option "without", :type => :array, :banner =>
|
244
246
|
"Exclude gems that are part of the specified named group."
|
245
247
|
method_option "with", :type => :array, :banner =>
|
@@ -247,10 +249,12 @@ module Bundler
|
|
247
249
|
def install
|
248
250
|
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
249
251
|
|
250
|
-
%w[clean deployment frozen no-
|
252
|
+
%w[clean deployment frozen no-prune path shebang system without with].each do |option|
|
251
253
|
remembered_flag_deprecation(option)
|
252
254
|
end
|
253
255
|
|
256
|
+
remembered_negative_flag_deprecation("no-deployment")
|
257
|
+
|
254
258
|
require_relative "cli/install"
|
255
259
|
Bundler.settings.temporary(:no_install => false) do
|
256
260
|
Install.new(options.dup).run
|
@@ -291,6 +295,8 @@ module Bundler
|
|
291
295
|
"Prefer updating only to next minor version"
|
292
296
|
method_option "major", :type => :boolean, :banner =>
|
293
297
|
"Prefer updating to next major version (default)"
|
298
|
+
method_option "pre", :type => :boolean, :banner =>
|
299
|
+
"Always choose the highest allowed version when updating gems, regardless of prerelease status"
|
294
300
|
method_option "strict", :type => :boolean, :banner =>
|
295
301
|
"Do not allow any gem to be updated past latest --patch | --minor | --major"
|
296
302
|
method_option "conservative", :type => :boolean, :banner =>
|
@@ -305,45 +311,25 @@ module Bundler
|
|
305
311
|
end
|
306
312
|
end
|
307
313
|
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
if flag = rest.find{|arg| ["--verbose", "--outdated"].include?(arg) }
|
323
|
-
Bundler::SharedHelpers.major_deprecation(2, "the `#{flag}` flag to `bundle show` was undocumented and will be removed without replacement")
|
324
|
-
else
|
325
|
-
new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
|
326
|
-
|
327
|
-
new_arguments = rest.map do |arg|
|
328
|
-
next arg if arg != "--paths"
|
329
|
-
next "--path" if new_command == "info"
|
330
|
-
end
|
331
|
-
|
332
|
-
old_argv = ARGV.join(" ")
|
333
|
-
new_argv = [new_command, *new_arguments.compact].join(" ")
|
334
|
-
|
335
|
-
Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
|
336
|
-
end
|
337
|
-
end
|
338
|
-
require_relative "cli/show"
|
339
|
-
Show.new(options, gem_name).run
|
340
|
-
end
|
314
|
+
desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
|
315
|
+
long_desc <<-D
|
316
|
+
Show lists the names and versions of all gems that are required by your Gemfile.
|
317
|
+
Calling show with [GEM] will list the exact location of that gem on your machine.
|
318
|
+
D
|
319
|
+
method_option "paths", :type => :boolean,
|
320
|
+
:banner => "List the paths of all gems that are required by your Gemfile."
|
321
|
+
method_option "outdated", :type => :boolean,
|
322
|
+
:banner => "Show verbose output including whether gems are outdated."
|
323
|
+
def show(gem_name = nil)
|
324
|
+
SharedHelpers.major_deprecation(2, "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement") if ARGV.include?("--outdated")
|
325
|
+
require_relative "cli/show"
|
326
|
+
Show.new(options, gem_name).run
|
341
327
|
end
|
342
328
|
|
343
329
|
desc "list", "List all gems in the bundle"
|
344
330
|
method_option "name-only", :type => :boolean, :banner => "print only the gem names"
|
345
|
-
method_option "only-group", :type => :
|
346
|
-
method_option "without-group", :type => :
|
331
|
+
method_option "only-group", :type => :array, :default => [], :banner => "print gems from a given set of groups"
|
332
|
+
method_option "without-group", :type => :array, :default => [], :banner => "print all gems except from a given set of groups"
|
347
333
|
method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
|
348
334
|
def list
|
349
335
|
require_relative "cli/list"
|
@@ -354,6 +340,7 @@ module Bundler
|
|
354
340
|
|
355
341
|
desc "info GEM [OPTIONS]", "Show information for the given gem"
|
356
342
|
method_option "path", :type => :boolean, :banner => "Print full path to gem"
|
343
|
+
method_option "version", :type => :boolean, :banner => "Print gem version"
|
357
344
|
def info(gem_name)
|
358
345
|
require_relative "cli/info"
|
359
346
|
Info.new(options, gem_name).run
|
@@ -375,6 +362,8 @@ module Bundler
|
|
375
362
|
"Make binstubs that can work without the Bundler runtime"
|
376
363
|
method_option "all", :type => :boolean, :banner =>
|
377
364
|
"Install binstubs for all gems"
|
365
|
+
method_option "all-platforms", :type => :boolean, :default => false, :banner =>
|
366
|
+
"Install binstubs for all platforms"
|
378
367
|
def binstubs(*gems)
|
379
368
|
require_relative "cli/binstubs"
|
380
369
|
Binstubs.new(options, gems).run
|
@@ -387,8 +376,12 @@ module Bundler
|
|
387
376
|
method_option "version", :aliases => "-v", :type => :string
|
388
377
|
method_option "group", :aliases => "-g", :type => :string
|
389
378
|
method_option "source", :aliases => "-s", :type => :string
|
379
|
+
method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string."
|
380
|
+
method_option "path", :type => :string
|
390
381
|
method_option "git", :type => :string
|
382
|
+
method_option "github", :type => :string
|
391
383
|
method_option "branch", :type => :string
|
384
|
+
method_option "ref", :type => :string
|
392
385
|
method_option "skip-install", :type => :boolean, :banner =>
|
393
386
|
"Adds gem to the Gemfile but does not install it"
|
394
387
|
method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
|
@@ -406,7 +399,7 @@ module Bundler
|
|
406
399
|
are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
|
407
400
|
|
408
401
|
For more information on patch level options (--major, --minor, --patch,
|
409
|
-
--
|
402
|
+
--strict) see documentation on the same options on the update command.
|
410
403
|
D
|
411
404
|
method_option "group", :type => :string, :banner => "List gems from a specific group"
|
412
405
|
method_option "groups", :type => :boolean, :banner => "List gems organized by groups"
|
@@ -414,10 +407,9 @@ module Bundler
|
|
414
407
|
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
415
408
|
method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
|
416
409
|
method_option "source", :type => :array, :banner => "Check against a specific source"
|
417
|
-
|
418
|
-
method_option "filter-strict", :type => :boolean, :aliases => strict_is_update ? [] : %w[--strict], :banner =>
|
410
|
+
method_option "filter-strict", :type => :boolean, :aliases => "--strict", :banner =>
|
419
411
|
"Only list newer versions allowed by your Gemfile requirements"
|
420
|
-
method_option "update-strict", :type => :boolean, :
|
412
|
+
method_option "update-strict", :type => :boolean, :banner =>
|
421
413
|
"Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
|
422
414
|
method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
|
423
415
|
method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
|
@@ -434,11 +426,18 @@ module Bundler
|
|
434
426
|
Outdated.new(options, gems).run
|
435
427
|
end
|
436
428
|
|
437
|
-
desc "
|
438
|
-
|
439
|
-
|
440
|
-
|
429
|
+
desc "fund [OPTIONS]", "Lists information about gems seeking funding assistance"
|
430
|
+
method_option "group", :aliases => "-g", :type => :array, :banner =>
|
431
|
+
"Fetch funding information for a specific group"
|
432
|
+
def fund
|
433
|
+
require_relative "cli/fund"
|
434
|
+
Fund.new(options).run
|
441
435
|
end
|
436
|
+
|
437
|
+
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
438
|
+
method_option "all", :type => :boolean,
|
439
|
+
:default => Bundler.feature_flag.cache_all?,
|
440
|
+
:banner => "Include all sources (including path and git)."
|
442
441
|
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
|
443
442
|
method_option "cache-path", :type => :string, :banner =>
|
444
443
|
"Specify a different cache path than the default (vendor/cache)."
|
@@ -457,6 +456,18 @@ module Bundler
|
|
457
456
|
bundle without having to download any additional gems.
|
458
457
|
D
|
459
458
|
def cache
|
459
|
+
SharedHelpers.major_deprecation 2,
|
460
|
+
"The `--all` flag is deprecated because it relies on being " \
|
461
|
+
"remembered across bundler invocations, which bundler will no longer " \
|
462
|
+
"do in future versions. Instead please use `bundle config set cache_all true`, " \
|
463
|
+
"and stop using this flag" if ARGV.include?("--all")
|
464
|
+
|
465
|
+
SharedHelpers.major_deprecation 2,
|
466
|
+
"The `--path` flag is deprecated because its semantics are unclear. " \
|
467
|
+
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
468
|
+
"and `bundle config path` to configure the path where your gems are installed, " \
|
469
|
+
"and stop using this flag" if ARGV.include?("--path")
|
470
|
+
|
460
471
|
require_relative "cli/cache"
|
461
472
|
Cache.new(options).run
|
462
473
|
end
|
@@ -464,7 +475,7 @@ module Bundler
|
|
464
475
|
map aliases_for("cache")
|
465
476
|
|
466
477
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
467
|
-
method_option :keep_file_descriptors, :type => :boolean, :default =>
|
478
|
+
method_option :keep_file_descriptors, :type => :boolean, :default => true
|
468
479
|
method_option :gemfile, :type => :string, :required => false
|
469
480
|
long_desc <<-D
|
470
481
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
@@ -472,6 +483,10 @@ module Bundler
|
|
472
483
|
into the system wide RubyGems repository.
|
473
484
|
D
|
474
485
|
def exec(*args)
|
486
|
+
if ARGV.include?("--no-keep-file-descriptors")
|
487
|
+
SharedHelpers.major_deprecation(2, "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")
|
488
|
+
end
|
489
|
+
|
475
490
|
require_relative "cli/exec"
|
476
491
|
Exec.new(options, args).run
|
477
492
|
end
|
@@ -486,8 +501,8 @@ module Bundler
|
|
486
501
|
By default, setting a configuration value sets it for all projects
|
487
502
|
on the machine.
|
488
503
|
|
489
|
-
If a global setting is
|
490
|
-
will show the current value, as well as any
|
504
|
+
If a global setting is superseded by local configuration, this command
|
505
|
+
will show the current value, as well as any superseded values and
|
491
506
|
where they were specified.
|
492
507
|
D
|
493
508
|
require_relative "cli/config"
|
@@ -507,7 +522,7 @@ module Bundler
|
|
507
522
|
end
|
508
523
|
end
|
509
524
|
|
510
|
-
desc "version", "Prints
|
525
|
+
desc "version", "Prints Bundler version information"
|
511
526
|
def version
|
512
527
|
cli_help = current_command.name == "cli_help"
|
513
528
|
if cli_help || ARGV.include?("version")
|
@@ -550,7 +565,7 @@ module Bundler
|
|
550
565
|
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
|
551
566
|
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
|
552
567
|
def viz
|
553
|
-
SharedHelpers.major_deprecation 2, "The `viz` command has been
|
568
|
+
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
|
554
569
|
require_relative "cli/viz"
|
555
570
|
Viz.new(options.dup).run
|
556
571
|
end
|
@@ -560,15 +575,23 @@ module Bundler
|
|
560
575
|
|
561
576
|
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
562
577
|
method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
|
563
|
-
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set gem.coc true`."
|
578
|
+
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
|
564
579
|
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
|
565
580
|
:lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
|
566
581
|
:desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
567
|
-
method_option :ext, :type => :
|
582
|
+
method_option :ext, :type => :string, :desc => "Generate the boilerplate for C extension code.", :enum => EXTENSIONS
|
568
583
|
method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
|
569
|
-
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
|
570
|
-
method_option :
|
571
|
-
|
584
|
+
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
|
585
|
+
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`."
|
586
|
+
method_option :changelog, :type => :boolean, :desc => "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
|
587
|
+
method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library",
|
588
|
+
: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)`."
|
589
|
+
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
|
590
|
+
:desc => "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
|
591
|
+
method_option :linter, :type => :string, :lazy_default => Bundler.settings["gem.linter"] || "",
|
592
|
+
:desc => "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
593
|
+
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>`."
|
594
|
+
|
572
595
|
def gem(name)
|
573
596
|
end
|
574
597
|
|
@@ -595,14 +618,14 @@ module Bundler
|
|
595
618
|
private :gem
|
596
619
|
|
597
620
|
def self.source_root
|
598
|
-
File.expand_path(
|
621
|
+
File.expand_path("templates", __dir__)
|
599
622
|
end
|
600
623
|
|
601
624
|
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
|
602
625
|
method_option "dry-run", :type => :boolean, :default => false, :banner =>
|
603
626
|
"Only print out changes, do not clean gems"
|
604
627
|
method_option "force", :type => :boolean, :default => false, :banner =>
|
605
|
-
"Forces
|
628
|
+
"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."
|
606
629
|
def clean
|
607
630
|
require_relative "cli/clean"
|
608
631
|
Clean.new(options.dup).run
|
@@ -650,10 +673,14 @@ module Bundler
|
|
650
673
|
"If updating, prefer updating only to next minor version"
|
651
674
|
method_option "major", :type => :boolean, :banner =>
|
652
675
|
"If updating, prefer updating to next major version (default)"
|
676
|
+
method_option "pre", :type => :boolean, :banner =>
|
677
|
+
"If updating, always choose the highest allowed version, regardless of prerelease status"
|
653
678
|
method_option "strict", :type => :boolean, :banner =>
|
654
679
|
"If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
|
655
680
|
method_option "conservative", :type => :boolean, :banner =>
|
656
681
|
"If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
|
682
|
+
method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner =>
|
683
|
+
"Update the locked version of bundler"
|
657
684
|
def lock
|
658
685
|
require_relative "cli/lock"
|
659
686
|
Lock.new(options).run
|
@@ -731,11 +758,43 @@ module Bundler
|
|
731
758
|
end
|
732
759
|
end
|
733
760
|
|
734
|
-
|
761
|
+
def self.check_deprecated_ext_option(arguments)
|
762
|
+
# when deprecated version of `--ext` is called
|
763
|
+
# print out deprecation warning and pretend `--ext=c` was provided
|
764
|
+
if deprecated_ext_value?(arguments)
|
765
|
+
SharedHelpers.major_deprecation 2, "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."
|
766
|
+
arguments[arguments.index("--ext")] = "--ext=c"
|
767
|
+
end
|
768
|
+
end
|
769
|
+
|
770
|
+
def self.deprecated_ext_value?(arguments)
|
771
|
+
index = arguments.index("--ext")
|
772
|
+
next_argument = arguments[index+1]
|
773
|
+
|
774
|
+
# it is ok when --ext is followed with valid extension value
|
775
|
+
# for example `bundle gem hello --ext c`
|
776
|
+
return false if EXTENSIONS.include?(next_argument)
|
777
|
+
|
778
|
+
# deprecated call when --ext is called with no value in last position
|
779
|
+
# for example `bundle gem hello_gem --ext`
|
780
|
+
return true if next_argument.nil?
|
781
|
+
|
782
|
+
# deprecated call when --ext is followed by other parameter
|
783
|
+
# for example `bundle gem --ext --no-ci hello_gem`
|
784
|
+
return true if next_argument.start_with?("-")
|
785
|
+
|
786
|
+
# deprecated call when --ext is followed by gem name
|
787
|
+
# for example `bundle gem --ext hello_gem`
|
788
|
+
return true if next_argument
|
789
|
+
|
790
|
+
false
|
791
|
+
end
|
792
|
+
|
793
|
+
private
|
735
794
|
|
736
795
|
# Automatically invoke `bundle install` and resume if
|
737
796
|
# Bundler.settings[:auto_install] exists. This is set through config cmd
|
738
|
-
# `bundle config set auto_install 1`.
|
797
|
+
# `bundle config set --global auto_install 1`.
|
739
798
|
#
|
740
799
|
# Note that this method `nil`s out the global Definition object, so it
|
741
800
|
# should be called first, before you instantiate anything like an
|
@@ -793,35 +852,40 @@ module Bundler
|
|
793
852
|
|
794
853
|
current = Gem::Version.new(VERSION)
|
795
854
|
return if current >= latest
|
796
|
-
latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
|
797
|
-
|
798
|
-
installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
|
799
|
-
if latest_installed && latest_installed > current
|
800
|
-
suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
|
801
|
-
suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
|
802
|
-
else
|
803
|
-
suggestion = installation
|
804
|
-
end
|
805
855
|
|
806
|
-
Bundler.ui.warn
|
856
|
+
Bundler.ui.warn \
|
857
|
+
"The latest bundler is #{latest}, but you are currently running #{current}.\n" \
|
858
|
+
"To update to the most recent version, run `bundle update --bundler`"
|
807
859
|
rescue RuntimeError
|
808
860
|
nil
|
809
861
|
end
|
810
862
|
|
863
|
+
def remembered_negative_flag_deprecation(name)
|
864
|
+
positive_name = name.gsub(/\Ano-/, "")
|
865
|
+
option = current_command.options[positive_name]
|
866
|
+
flag_name = "--no-" + option.switch_name.gsub(/\A--/, "")
|
867
|
+
|
868
|
+
flag_deprecation(positive_name, flag_name, option)
|
869
|
+
end
|
870
|
+
|
811
871
|
def remembered_flag_deprecation(name)
|
812
872
|
option = current_command.options[name]
|
813
873
|
flag_name = option.switch_name
|
814
874
|
|
815
|
-
|
875
|
+
flag_deprecation(name, flag_name, option)
|
876
|
+
end
|
877
|
+
|
878
|
+
def flag_deprecation(name, flag_name, option)
|
879
|
+
name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
|
816
880
|
return unless name_index
|
817
881
|
|
818
882
|
value = options[name]
|
819
883
|
value = value.join(" ").to_s if option.type == :array
|
820
884
|
|
821
|
-
Bundler::SharedHelpers.major_deprecation 2
|
885
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
822
886
|
"The `#{flag_name}` flag is deprecated because it relies on being " \
|
823
887
|
"remembered across bundler invocations, which bundler will no longer " \
|
824
|
-
"do in future versions. Instead please use `bundle config set #{name} " \
|
888
|
+
"do in future versions. Instead please use `bundle config set --local #{name.tr("-", "_")} " \
|
825
889
|
"'#{value}'`, and stop using this flag"
|
826
890
|
end
|
827
891
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "gem_parser"
|
4
|
+
|
3
5
|
module Bundler
|
4
6
|
class CompactIndexClient
|
5
7
|
class Cache
|
@@ -66,7 +68,7 @@ module Bundler
|
|
66
68
|
|
67
69
|
def info_path(name)
|
68
70
|
name = name.to_s
|
69
|
-
if
|
71
|
+
if /[^a-z0-9_-]/.match?(name)
|
70
72
|
name += "-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}"
|
71
73
|
info_roots.last.join(name)
|
72
74
|
else
|
@@ -74,16 +76,7 @@ module Bundler
|
|
74
76
|
end
|
75
77
|
end
|
76
78
|
|
77
|
-
|
78
|
-
pattern = [version, platform].compact.join("-")
|
79
|
-
return nil if pattern.empty?
|
80
|
-
|
81
|
-
gem_lines = info_path(name).read
|
82
|
-
gem_line = gem_lines[/^#{Regexp.escape(pattern)}\b.*/, 0]
|
83
|
-
gem_line ? parse_gem(gem_line) : nil
|
84
|
-
end
|
85
|
-
|
86
|
-
private
|
79
|
+
private
|
87
80
|
|
88
81
|
def lines(path)
|
89
82
|
return [] unless path.file?
|
@@ -92,19 +85,9 @@ module Bundler
|
|
92
85
|
header ? lines[header + 1..-1] : lines
|
93
86
|
end
|
94
87
|
|
95
|
-
def parse_gem(
|
96
|
-
|
97
|
-
|
98
|
-
dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
|
99
|
-
dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
|
100
|
-
requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
|
101
|
-
[version, platform, dependencies, requirements]
|
102
|
-
end
|
103
|
-
|
104
|
-
def parse_dependency(string)
|
105
|
-
dependency = string.split(":")
|
106
|
-
dependency[-1] = dependency[-1].split("&") if dependency.size > 1
|
107
|
-
dependency
|
88
|
+
def parse_gem(line)
|
89
|
+
@dependency_parser ||= GemParser.new
|
90
|
+
@dependency_parser.parse(line)
|
108
91
|
end
|
109
92
|
|
110
93
|
def info_roots
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CompactIndexClient
|
5
|
+
if defined?(Gem::Resolver::APISet::GemParser)
|
6
|
+
GemParser = Gem::Resolver::APISet::GemParser
|
7
|
+
else
|
8
|
+
class GemParser
|
9
|
+
def parse(line)
|
10
|
+
version_and_platform, rest = line.split(" ", 2)
|
11
|
+
version, platform = version_and_platform.split("-", 2)
|
12
|
+
dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
|
13
|
+
dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
|
14
|
+
requirements = requirements ? requirements.map {|d| parse_dependency(d) } : []
|
15
|
+
[version, platform, dependencies, requirements]
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def parse_dependency(string)
|
21
|
+
dependency = string.split(":")
|
22
|
+
dependency[-1] = dependency[-1].split("&") if dependency.size > 1
|
23
|
+
dependency
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|