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/definition.rb
CHANGED
@@ -1,18 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "lockfile_parser"
|
4
|
-
require "set"
|
5
4
|
|
6
5
|
module Bundler
|
7
6
|
class Definition
|
8
7
|
include GemHelpers
|
9
8
|
|
9
|
+
class << self
|
10
|
+
# Do not create or modify a lockfile (Makes #lock a noop)
|
11
|
+
attr_accessor :no_lock
|
12
|
+
end
|
13
|
+
|
10
14
|
attr_reader(
|
11
15
|
:dependencies,
|
12
16
|
:locked_deps,
|
13
17
|
:locked_gems,
|
14
18
|
:platforms,
|
15
|
-
:requires,
|
16
19
|
:ruby_version,
|
17
20
|
:lockfile,
|
18
21
|
:gemfiles
|
@@ -57,10 +60,8 @@ module Bundler
|
|
57
60
|
@unlocking_bundler = false
|
58
61
|
@unlocking = unlock
|
59
62
|
else
|
60
|
-
unlock = unlock.dup
|
61
63
|
@unlocking_bundler = unlock.delete(:bundler)
|
62
|
-
unlock.
|
63
|
-
@unlocking = !unlock.empty?
|
64
|
+
@unlocking = unlock.any? {|_k, v| !Array(v).empty? }
|
64
65
|
end
|
65
66
|
|
66
67
|
@dependencies = dependencies
|
@@ -68,6 +69,7 @@ module Bundler
|
|
68
69
|
@unlock = unlock
|
69
70
|
@optional_groups = optional_groups
|
70
71
|
@remote = false
|
72
|
+
@prefer_local = false
|
71
73
|
@specs = nil
|
72
74
|
@ruby_version = ruby_version
|
73
75
|
@gemfiles = gemfiles
|
@@ -76,7 +78,7 @@ module Bundler
|
|
76
78
|
@lockfile_contents = String.new
|
77
79
|
@locked_bundler_version = nil
|
78
80
|
@locked_ruby_version = nil
|
79
|
-
@
|
81
|
+
@new_platform = nil
|
80
82
|
|
81
83
|
if lockfile && File.exist?(lockfile)
|
82
84
|
@lockfile_contents = Bundler.read_file(lockfile)
|
@@ -85,10 +87,11 @@ module Bundler
|
|
85
87
|
@platforms = @locked_platforms.dup
|
86
88
|
@locked_bundler_version = @locked_gems.bundler_version
|
87
89
|
@locked_ruby_version = @locked_gems.ruby_version
|
90
|
+
@originally_locked_specs = SpecSet.new(@locked_gems.specs)
|
88
91
|
|
89
92
|
if unlock != true
|
90
93
|
@locked_deps = @locked_gems.dependencies
|
91
|
-
@locked_specs =
|
94
|
+
@locked_specs = @originally_locked_specs
|
92
95
|
@locked_sources = @locked_gems.sources
|
93
96
|
else
|
94
97
|
@unlock = {}
|
@@ -102,60 +105,75 @@ module Bundler
|
|
102
105
|
@locked_gems = nil
|
103
106
|
@locked_deps = {}
|
104
107
|
@locked_specs = SpecSet.new([])
|
108
|
+
@originally_locked_specs = @locked_specs
|
105
109
|
@locked_sources = []
|
106
110
|
@locked_platforms = []
|
107
111
|
end
|
108
112
|
|
109
|
-
@
|
113
|
+
locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
|
114
|
+
@multisource_allowed = locked_gem_sources.size == 1 && locked_gem_sources.first.multiple_remotes? && Bundler.frozen_bundle?
|
115
|
+
|
116
|
+
if @multisource_allowed
|
117
|
+
unless sources.aggregate_global_source?
|
118
|
+
msg = "Your lockfile contains a single rubygems source section with multiple remotes, which is insecure. Make sure you run `bundle install` in non frozen mode and commit the result to make your lockfile secure."
|
119
|
+
|
120
|
+
Bundler::SharedHelpers.major_deprecation 2, msg
|
121
|
+
end
|
122
|
+
|
123
|
+
@sources.merged_gem_lockfile_sections!(locked_gem_sources.first)
|
124
|
+
end
|
125
|
+
|
110
126
|
@unlock[:sources] ||= []
|
111
127
|
@unlock[:ruby] ||= if @ruby_version && locked_ruby_version_object
|
112
128
|
@ruby_version.diff(locked_ruby_version_object)
|
113
129
|
end
|
114
130
|
@unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
|
115
131
|
|
116
|
-
add_current_platform unless Bundler.frozen_bundle?
|
132
|
+
add_current_platform unless current_ruby_platform_locked? || Bundler.frozen_bundle?
|
117
133
|
|
118
134
|
converge_path_sources_to_gemspec_sources
|
119
135
|
@path_changes = converge_paths
|
120
136
|
@source_changes = converge_sources
|
121
137
|
|
122
|
-
|
123
|
-
|
124
|
-
|
138
|
+
if @unlock[:conservative]
|
139
|
+
@unlock[:gems] ||= @dependencies.map(&:name)
|
140
|
+
else
|
141
|
+
eager_unlock = (@unlock[:gems] || []).map {|name| Dependency.new(name, ">= 0") }
|
142
|
+
@unlock[:gems] = @locked_specs.for(eager_unlock, false, platforms).map(&:name).uniq
|
125
143
|
end
|
126
144
|
|
127
145
|
@dependency_changes = converge_dependencies
|
128
146
|
@local_changes = converge_locals
|
129
147
|
|
130
|
-
@
|
148
|
+
@incomplete_lockfile = check_missing_lockfile_specs
|
131
149
|
end
|
132
150
|
|
133
151
|
def gem_version_promoter
|
134
|
-
@gem_version_promoter ||=
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
152
|
+
@gem_version_promoter ||= GemVersionPromoter.new
|
153
|
+
end
|
154
|
+
|
155
|
+
def resolve_only_locally!
|
156
|
+
@remote = false
|
157
|
+
sources.local_only!
|
158
|
+
resolve
|
159
|
+
end
|
160
|
+
|
161
|
+
def resolve_prefering_local!
|
162
|
+
@prefer_local = true
|
163
|
+
@remote = true
|
164
|
+
sources.remote!
|
165
|
+
resolve
|
146
166
|
end
|
147
167
|
|
148
168
|
def resolve_with_cache!
|
149
|
-
raise "Specs already loaded" if @specs
|
150
169
|
sources.cached!
|
151
|
-
|
170
|
+
resolve
|
152
171
|
end
|
153
172
|
|
154
173
|
def resolve_remotely!
|
155
|
-
raise "Specs already loaded" if @specs
|
156
174
|
@remote = true
|
157
175
|
sources.remote!
|
158
|
-
|
176
|
+
resolve
|
159
177
|
end
|
160
178
|
|
161
179
|
# For given dependency list returns a SpecSet with Gemspec of all the required
|
@@ -165,25 +183,7 @@ module Bundler
|
|
165
183
|
#
|
166
184
|
# @return [Bundler::SpecSet]
|
167
185
|
def specs
|
168
|
-
@specs ||=
|
169
|
-
begin
|
170
|
-
specs = resolve.materialize(requested_dependencies)
|
171
|
-
rescue GemNotFound => e # Handle yanked gem
|
172
|
-
gem_name, gem_version = extract_gem_info(e)
|
173
|
-
locked_gem = @locked_specs[gem_name].last
|
174
|
-
raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
|
175
|
-
raise GemNotFound, "Your bundle is locked to #{locked_gem}, but that version could not " \
|
176
|
-
"be found in any of the sources listed in your Gemfile. If you haven't changed sources, " \
|
177
|
-
"that means the author of #{locked_gem} has removed it. You'll need to update your bundle " \
|
178
|
-
"to a version other than #{locked_gem} that hasn't been removed in order to install."
|
179
|
-
end
|
180
|
-
unless specs["bundler"].any?
|
181
|
-
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
|
182
|
-
specs["bundler"] = bundler
|
183
|
-
end
|
184
|
-
|
185
|
-
specs
|
186
|
-
end
|
186
|
+
@specs ||= materialize(requested_dependencies)
|
187
187
|
end
|
188
188
|
|
189
189
|
def new_specs
|
@@ -194,14 +194,8 @@ module Bundler
|
|
194
194
|
@locked_specs - specs
|
195
195
|
end
|
196
196
|
|
197
|
-
def new_platform?
|
198
|
-
@new_platform
|
199
|
-
end
|
200
|
-
|
201
197
|
def missing_specs
|
202
|
-
|
203
|
-
resolve.materialize(requested_dependencies, missing)
|
204
|
-
missing
|
198
|
+
resolve.materialize(requested_dependencies).missing_specs
|
205
199
|
end
|
206
200
|
|
207
201
|
def missing_specs?
|
@@ -210,8 +204,8 @@ module Bundler
|
|
210
204
|
Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}"
|
211
205
|
true
|
212
206
|
rescue BundlerError => e
|
213
|
-
@index = nil
|
214
207
|
@resolve = nil
|
208
|
+
@resolver = nil
|
215
209
|
@specs = nil
|
216
210
|
@gem_version_promoter = nil
|
217
211
|
|
@@ -220,21 +214,42 @@ module Bundler
|
|
220
214
|
end
|
221
215
|
|
222
216
|
def requested_specs
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
217
|
+
specs_for(requested_groups)
|
218
|
+
end
|
219
|
+
|
220
|
+
def requested_dependencies
|
221
|
+
dependencies_for(requested_groups)
|
228
222
|
end
|
229
223
|
|
230
224
|
def current_dependencies
|
231
|
-
dependencies.select
|
225
|
+
dependencies.select do |d|
|
226
|
+
d.should_include? && !d.gem_platforms([generic_local_platform]).empty?
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
def locked_dependencies
|
231
|
+
@locked_deps.values
|
232
|
+
end
|
233
|
+
|
234
|
+
def new_deps
|
235
|
+
@new_deps ||= @dependencies - locked_dependencies
|
236
|
+
end
|
237
|
+
|
238
|
+
def deleted_deps
|
239
|
+
@deleted_deps ||= locked_dependencies - @dependencies
|
232
240
|
end
|
233
241
|
|
234
242
|
def specs_for(groups)
|
235
|
-
|
236
|
-
deps
|
237
|
-
|
243
|
+
return specs if groups.empty?
|
244
|
+
deps = dependencies_for(groups)
|
245
|
+
materialize(deps)
|
246
|
+
end
|
247
|
+
|
248
|
+
def dependencies_for(groups)
|
249
|
+
groups.map!(&:to_sym)
|
250
|
+
current_dependencies.reject do |d|
|
251
|
+
(d.groups & groups).empty?
|
252
|
+
end
|
238
253
|
end
|
239
254
|
|
240
255
|
# Resolve all the dependencies specified in Gemfile. It ensures that
|
@@ -243,78 +258,26 @@ module Bundler
|
|
243
258
|
#
|
244
259
|
# @return [SpecSet] resolved dependencies
|
245
260
|
def resolve
|
246
|
-
@resolve ||=
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
261
|
+
@resolve ||= if Bundler.frozen_bundle?
|
262
|
+
Bundler.ui.debug "Frozen, using resolution from the lockfile"
|
263
|
+
@locked_specs
|
264
|
+
elsif !unlocking? && nothing_changed?
|
265
|
+
if deleted_deps.any?
|
266
|
+
Bundler.ui.debug "Some dependencies were deleted, using a subset of the resolution from the lockfile"
|
267
|
+
SpecSet.new(filter_specs(@locked_specs, @dependencies - deleted_deps))
|
268
|
+
else
|
269
|
+
Bundler.ui.debug "Found no changes, using resolution from the lockfile"
|
270
|
+
if @locked_gems.may_include_redundant_platform_specific_gems?
|
271
|
+
SpecSet.new(filter_specs(@locked_specs, @dependencies))
|
255
272
|
else
|
256
|
-
|
257
|
-
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
258
|
-
last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
273
|
+
@locked_specs
|
259
274
|
end
|
260
|
-
|
261
|
-
# filter out gems that _can_ be installed on multiple platforms, but don't need
|
262
|
-
# to be
|
263
|
-
resolve.for(expand_dependencies(dependencies, true), [], false, false, false)
|
264
|
-
end
|
265
|
-
end
|
266
|
-
|
267
|
-
def index
|
268
|
-
@index ||= Index.build do |idx|
|
269
|
-
dependency_names = @dependencies.map(&:name)
|
270
|
-
|
271
|
-
sources.all_sources.each do |source|
|
272
|
-
source.dependency_names = dependency_names - pinned_spec_names(source)
|
273
|
-
idx.add_source source.specs
|
274
|
-
dependency_names.concat(source.unmet_deps).uniq!
|
275
|
-
end
|
276
|
-
|
277
|
-
double_check_for_index(idx, dependency_names)
|
278
|
-
end
|
279
|
-
end
|
280
|
-
|
281
|
-
# Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
|
282
|
-
# sources A and B. At this point, the API request will have found all the versions of Bar in source A,
|
283
|
-
# but will not have found any versions of Bar from source B, which is a problem if the requested version
|
284
|
-
# of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
|
285
|
-
# each spec we found, we add all possible versions from all sources to the index.
|
286
|
-
def double_check_for_index(idx, dependency_names)
|
287
|
-
pinned_names = pinned_spec_names
|
288
|
-
loop do
|
289
|
-
idxcount = idx.size
|
290
|
-
|
291
|
-
names = :names # do this so we only have to traverse to get dependency_names from the index once
|
292
|
-
unmet_dependency_names = lambda do
|
293
|
-
return names unless names == :names
|
294
|
-
new_names = sources.all_sources.map(&:dependency_names_to_double_check)
|
295
|
-
return names = nil if new_names.compact!
|
296
|
-
names = new_names.flatten(1).concat(dependency_names)
|
297
|
-
names.uniq!
|
298
|
-
names -= pinned_names
|
299
|
-
names
|
300
|
-
end
|
301
|
-
|
302
|
-
sources.all_sources.each do |source|
|
303
|
-
source.double_check_for(unmet_dependency_names)
|
304
275
|
end
|
305
|
-
|
306
|
-
|
276
|
+
else
|
277
|
+
Bundler.ui.debug "Found changes from the lockfile, re-resolving dependencies because #{change_reason}"
|
278
|
+
start_resolution
|
307
279
|
end
|
308
280
|
end
|
309
|
-
private :double_check_for_index
|
310
|
-
|
311
|
-
def has_rubygems_remotes?
|
312
|
-
sources.rubygems_sources.any? {|s| s.remotes.any? }
|
313
|
-
end
|
314
|
-
|
315
|
-
def has_local_dependencies?
|
316
|
-
!sources.path_sources.empty? || !sources.git_sources.empty?
|
317
|
-
end
|
318
281
|
|
319
282
|
def spec_git_paths
|
320
283
|
sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
|
@@ -325,20 +288,19 @@ module Bundler
|
|
325
288
|
end
|
326
289
|
|
327
290
|
def lock(file, preserve_unknown_sections = false)
|
291
|
+
return if Definition.no_lock
|
292
|
+
|
328
293
|
contents = to_lock
|
329
294
|
|
330
295
|
# Convert to \r\n if the existing lock has them
|
331
296
|
# i.e., Windows with `git config core.autocrlf=true`
|
332
|
-
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n")
|
297
|
+
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match?("\r\n")
|
333
298
|
|
334
299
|
if @locked_bundler_version
|
335
300
|
locked_major = @locked_bundler_version.segments.first
|
336
|
-
current_major =
|
301
|
+
current_major = Bundler.gem_version.segments.first
|
337
302
|
|
338
|
-
|
339
|
-
Bundler.ui.warn "Warning: the lockfile is being updated to Bundler #{current_major}, " \
|
340
|
-
"after which you will be unable to return to Bundler #{@locked_bundler_version.segments.first}."
|
341
|
-
end
|
303
|
+
updating_major = locked_major < current_major
|
342
304
|
end
|
343
305
|
|
344
306
|
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
@@ -355,14 +317,6 @@ module Bundler
|
|
355
317
|
end
|
356
318
|
end
|
357
319
|
|
358
|
-
def locked_bundler_version
|
359
|
-
if @locked_bundler_version && @locked_bundler_version < Gem::Version.new(Bundler::VERSION)
|
360
|
-
new_version = Bundler::VERSION
|
361
|
-
end
|
362
|
-
|
363
|
-
new_version || @locked_bundler_version || Bundler::VERSION
|
364
|
-
end
|
365
|
-
|
366
320
|
def locked_ruby_version
|
367
321
|
return unless ruby_version
|
368
322
|
if @unlock[:ruby] || !@locked_ruby_version
|
@@ -396,15 +350,13 @@ module Bundler
|
|
396
350
|
"updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
|
397
351
|
|
398
352
|
unless explicit_flag
|
399
|
-
suggested_command = if Bundler.settings.locations("frozen")[:global]
|
353
|
+
suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
|
400
354
|
"bundle config unset frozen"
|
401
355
|
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
|
402
356
|
"bundle config unset deployment"
|
403
|
-
else
|
404
|
-
"bundle install --no-deployment"
|
405
357
|
end
|
406
358
|
msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
|
407
|
-
"freeze \nby running `#{suggested_command}`."
|
359
|
+
"freeze \nby running `#{suggested_command}`." if suggested_command
|
408
360
|
end
|
409
361
|
|
410
362
|
added = []
|
@@ -416,44 +368,28 @@ module Bundler
|
|
416
368
|
added.concat new_platforms.map {|p| "* platform: #{p}" }
|
417
369
|
deleted.concat deleted_platforms.map {|p| "* platform: #{p}" }
|
418
370
|
|
419
|
-
|
371
|
+
added.concat new_deps.map {|d| "* #{pretty_dep(d)}" } if new_deps.any?
|
372
|
+
deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" } if deleted_deps.any?
|
420
373
|
|
421
|
-
|
422
|
-
|
374
|
+
both_sources = Hash.new {|h, k| h[k] = [] }
|
375
|
+
@dependencies.each {|d| both_sources[d.name][0] = d }
|
423
376
|
|
424
|
-
|
425
|
-
|
377
|
+
locked_dependencies.each do |d|
|
378
|
+
next if !Bundler.feature_flag.bundler_3_mode? && @locked_specs[d.name].empty?
|
426
379
|
|
427
|
-
|
428
|
-
if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
|
429
|
-
new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
|
430
|
-
deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
|
380
|
+
both_sources[d.name][1] = d
|
431
381
|
end
|
432
382
|
|
433
|
-
|
434
|
-
if
|
435
|
-
added.concat new_sources.map {|source| "* source: #{source}" }
|
436
|
-
end
|
383
|
+
both_sources.each do |name, (dep, lock_dep)|
|
384
|
+
next if dep.nil? || lock_dep.nil?
|
437
385
|
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
end
|
386
|
+
gemfile_source = dep.source || sources.default_source
|
387
|
+
lock_source = lock_dep.source || sources.default_source
|
388
|
+
next if lock_source.include?(gemfile_source)
|
442
389
|
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
end
|
447
|
-
|
448
|
-
both_sources = Hash.new {|h, k| h[k] = [] }
|
449
|
-
@dependencies.each {|d| both_sources[d.name][0] = d }
|
450
|
-
@locked_deps.each {|name, d| both_sources[name][1] = d.source }
|
451
|
-
|
452
|
-
both_sources.each do |name, (dep, lock_source)|
|
453
|
-
next unless (dep.nil? && !lock_source.nil?) || (!dep.nil? && !lock_source.nil? && !lock_source.can_lock?(dep))
|
454
|
-
gemfile_source_name = (dep && dep.source) || "no specified source"
|
455
|
-
lockfile_source_name = lock_source || "no specified source"
|
456
|
-
changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`"
|
390
|
+
gemfile_source_name = dep.source ? gemfile_source.identifier : "no specified source"
|
391
|
+
lockfile_source_name = lock_dep.source ? lock_source.identifier : "no specified source"
|
392
|
+
changed << "* #{name} from `#{lockfile_source_name}` to `#{gemfile_source_name}`"
|
457
393
|
end
|
458
394
|
|
459
395
|
reason = change_reason
|
@@ -497,15 +433,11 @@ module Bundler
|
|
497
433
|
end
|
498
434
|
|
499
435
|
def validate_platforms!
|
500
|
-
return if
|
501
|
-
Bundler.rubygems.platforms.any? do |local_platform|
|
502
|
-
MatchPlatform.platforms_match?(bundle_platform, local_platform)
|
503
|
-
end
|
504
|
-
end
|
436
|
+
return if current_platform_locked?
|
505
437
|
|
506
438
|
raise ProductionError, "Your bundle only supports platforms #{@platforms.map(&:to_s)} " \
|
507
|
-
"but your local
|
508
|
-
"
|
439
|
+
"but your local platform is #{Bundler.local_platform}. " \
|
440
|
+
"Add the current platform to the lockfile with\n`bundle lock --add-platform #{Bundler.local_platform}` and try again."
|
509
441
|
end
|
510
442
|
|
511
443
|
def add_platform(platform)
|
@@ -518,39 +450,143 @@ module Bundler
|
|
518
450
|
raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
|
519
451
|
end
|
520
452
|
|
521
|
-
def
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
def find_resolved_spec(current_spec)
|
526
|
-
specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
527
|
-
end
|
528
|
-
|
529
|
-
def find_indexed_specs(current_spec)
|
530
|
-
index[current_spec.name].select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
|
453
|
+
def most_specific_locked_platform
|
454
|
+
@platforms.min_by do |bundle_platform|
|
455
|
+
platform_specificity_match(bundle_platform, local_platform)
|
456
|
+
end
|
531
457
|
end
|
532
458
|
|
533
459
|
attr_reader :sources
|
534
460
|
private :sources
|
535
461
|
|
536
462
|
def nothing_changed?
|
537
|
-
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@
|
463
|
+
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@incomplete_lockfile
|
538
464
|
end
|
539
465
|
|
540
466
|
def unlocking?
|
541
467
|
@unlocking
|
542
468
|
end
|
543
469
|
|
544
|
-
|
470
|
+
private
|
471
|
+
|
472
|
+
def resolver
|
473
|
+
@resolver ||= begin
|
474
|
+
last_resolve = converge_locked_specs
|
475
|
+
remove_ruby_from_platforms_if_necessary!(current_dependencies)
|
476
|
+
Resolver.new(source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve(last_resolve))
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
def expanded_dependencies
|
481
|
+
@expanded_dependencies ||= dependencies + metadata_dependencies
|
482
|
+
end
|
483
|
+
|
484
|
+
def resolution_packages
|
485
|
+
@resolution_packages ||= begin
|
486
|
+
packages = Hash.new do |h, k|
|
487
|
+
h[k] = Resolver::Package.new(k, @platforms, @originally_locked_specs, @unlock[:gems])
|
488
|
+
end
|
489
|
+
|
490
|
+
expanded_dependencies.each do |dep|
|
491
|
+
name = dep.name
|
492
|
+
platforms = dep.gem_platforms(@platforms)
|
493
|
+
|
494
|
+
packages[name] = Resolver::Package.new(name, platforms, @originally_locked_specs, @unlock[:gems], :dependency => dep)
|
495
|
+
end
|
496
|
+
|
497
|
+
packages
|
498
|
+
end
|
499
|
+
end
|
500
|
+
|
501
|
+
def filter_specs(specs, deps)
|
502
|
+
SpecSet.new(specs).for(deps, false, platforms)
|
503
|
+
end
|
504
|
+
|
505
|
+
def materialize(dependencies)
|
506
|
+
specs = resolve.materialize(dependencies)
|
507
|
+
missing_specs = specs.missing_specs
|
508
|
+
|
509
|
+
if missing_specs.any?
|
510
|
+
missing_specs.each do |s|
|
511
|
+
locked_gem = @locked_specs[s.name].last
|
512
|
+
next if locked_gem.nil? || locked_gem.version != s.version || !@remote
|
513
|
+
raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
|
514
|
+
"no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
|
515
|
+
"You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
|
516
|
+
"removed in order to install."
|
517
|
+
end
|
518
|
+
|
519
|
+
missing_specs_list = missing_specs.group_by(&:source).map do |source, missing_specs_for_source|
|
520
|
+
"#{missing_specs_for_source.map(&:full_name).join(", ")} in #{source}"
|
521
|
+
end
|
522
|
+
|
523
|
+
raise GemNotFound, "Could not find #{missing_specs_list.join(" nor ")}"
|
524
|
+
end
|
525
|
+
|
526
|
+
incomplete_specs = specs.incomplete_specs
|
527
|
+
loop do
|
528
|
+
break if incomplete_specs.empty?
|
529
|
+
|
530
|
+
Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
|
531
|
+
@resolve = start_resolution(:exclude_specs => incomplete_specs)
|
532
|
+
specs = resolve.materialize(dependencies)
|
533
|
+
|
534
|
+
still_incomplete_specs = specs.incomplete_specs
|
535
|
+
|
536
|
+
if still_incomplete_specs == incomplete_specs
|
537
|
+
package = resolution_packages[incomplete_specs.first.name]
|
538
|
+
resolver.raise_not_found! package
|
539
|
+
end
|
540
|
+
|
541
|
+
incomplete_specs = still_incomplete_specs
|
542
|
+
end
|
543
|
+
|
544
|
+
bundler = sources.metadata_source.specs.search(["bundler", Bundler.gem_version]).last
|
545
|
+
specs["bundler"] = bundler
|
546
|
+
|
547
|
+
specs
|
548
|
+
end
|
549
|
+
|
550
|
+
def start_resolution(exclude_specs: [])
|
551
|
+
result = resolver.start(expanded_dependencies, resolution_packages, :exclude_specs => exclude_specs)
|
552
|
+
|
553
|
+
SpecSet.new(SpecSet.new(result).for(dependencies, false, @platforms))
|
554
|
+
end
|
555
|
+
|
556
|
+
def precompute_source_requirements_for_indirect_dependencies?
|
557
|
+
@remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
|
558
|
+
end
|
559
|
+
|
560
|
+
def pin_locally_available_names(source_requirements)
|
561
|
+
source_requirements.each_with_object({}) do |(name, original_source), new_source_requirements|
|
562
|
+
local_source = original_source.dup
|
563
|
+
local_source.local_only!
|
545
564
|
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
565
|
+
new_source_requirements[name] = if local_source.specs.search(name).any?
|
566
|
+
local_source
|
567
|
+
else
|
568
|
+
original_source
|
569
|
+
end
|
551
570
|
end
|
552
571
|
end
|
553
572
|
|
573
|
+
def current_ruby_platform_locked?
|
574
|
+
return false unless generic_local_platform == Gem::Platform::RUBY
|
575
|
+
return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY)
|
576
|
+
|
577
|
+
current_platform_locked?
|
578
|
+
end
|
579
|
+
|
580
|
+
def current_platform_locked?
|
581
|
+
@platforms.any? do |bundle_platform|
|
582
|
+
MatchPlatform.platforms_match?(bundle_platform, Bundler.local_platform)
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
def add_current_platform
|
587
|
+
add_platform(local_platform)
|
588
|
+
end
|
589
|
+
|
554
590
|
def change_reason
|
555
591
|
if unlocking?
|
556
592
|
unlock_reason = @unlock.reject {|_k, v| Array(v).empty? }.map do |k, v|
|
@@ -569,12 +605,12 @@ module Bundler
|
|
569
605
|
[@new_platform, "you added a new platform to your gemfile"],
|
570
606
|
[@path_changes, "the gemspecs for path gems changed"],
|
571
607
|
[@local_changes, "the gemspecs for git local gems changed"],
|
572
|
-
[@
|
608
|
+
[@incomplete_lockfile, "your lock file is missing some gems"],
|
573
609
|
].select(&:first).map(&:last).join(", ")
|
574
610
|
end
|
575
611
|
|
576
|
-
def pretty_dep(dep
|
577
|
-
SharedHelpers.pretty_dependency(dep
|
612
|
+
def pretty_dep(dep)
|
613
|
+
SharedHelpers.pretty_dependency(dep)
|
578
614
|
end
|
579
615
|
|
580
616
|
# Check if the specs of the given source changed
|
@@ -587,9 +623,9 @@ module Bundler
|
|
587
623
|
|
588
624
|
def dependencies_for_source_changed?(source, locked_source = source)
|
589
625
|
deps_for_source = @dependencies.select {|s| s.source == source }
|
590
|
-
locked_deps_for_source =
|
626
|
+
locked_deps_for_source = locked_dependencies.select {|dep| dep.source == locked_source }
|
591
627
|
|
592
|
-
|
628
|
+
deps_for_source.uniq.sort != locked_deps_for_source.sort
|
593
629
|
end
|
594
630
|
|
595
631
|
def specs_for_source_changed?(source)
|
@@ -624,6 +660,14 @@ module Bundler
|
|
624
660
|
!sources_with_changes.each {|source| @unlock[:sources] << source.name }.empty?
|
625
661
|
end
|
626
662
|
|
663
|
+
def check_missing_lockfile_specs
|
664
|
+
all_locked_specs = @locked_specs.map(&:name) << "bundler"
|
665
|
+
|
666
|
+
@locked_specs.any? do |s|
|
667
|
+
s.dependencies.any? {|dep| !all_locked_specs.include?(dep.name) }
|
668
|
+
end
|
669
|
+
end
|
670
|
+
|
627
671
|
def converge_paths
|
628
672
|
sources.path_sources.any? do |source|
|
629
673
|
specs_changed?(source)
|
@@ -648,36 +692,11 @@ module Bundler
|
|
648
692
|
end
|
649
693
|
end
|
650
694
|
|
651
|
-
def converge_rubygems_sources
|
652
|
-
return false if Bundler.feature_flag.disable_multisource?
|
653
|
-
|
654
|
-
changes = false
|
655
|
-
|
656
|
-
# Get the RubyGems sources from the Gemfile.lock
|
657
|
-
locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
|
658
|
-
# Get the RubyGems remotes from the Gemfile
|
659
|
-
actual_remotes = sources.rubygems_remotes
|
660
|
-
|
661
|
-
# If there is a RubyGems source in both
|
662
|
-
if !locked_gem_sources.empty? && !actual_remotes.empty?
|
663
|
-
locked_gem_sources.each do |locked_gem|
|
664
|
-
# Merge the remotes from the Gemfile into the Gemfile.lock
|
665
|
-
changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
|
666
|
-
end
|
667
|
-
end
|
668
|
-
|
669
|
-
changes
|
670
|
-
end
|
671
|
-
|
672
695
|
def converge_sources
|
673
|
-
changes = false
|
674
|
-
|
675
|
-
changes |= converge_rubygems_sources
|
676
|
-
|
677
696
|
# Replace the sources from the Gemfile with the sources from the Gemfile.lock,
|
678
697
|
# if they exist in the Gemfile.lock and are `==`. If you can't find an equivalent
|
679
698
|
# source in the Gemfile.lock, use the one from the Gemfile.
|
680
|
-
changes
|
699
|
+
changes = sources.replace_sources!(@locked_sources)
|
681
700
|
|
682
701
|
sources.all_sources.each do |source|
|
683
702
|
# If the source is unlockable and the current command allows an unlock of
|
@@ -695,28 +714,14 @@ module Bundler
|
|
695
714
|
end
|
696
715
|
|
697
716
|
def converge_dependencies
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
# after locked_source and sources don't match, we still use locked_source.
|
703
|
-
if frozen && !locked_source.nil? &&
|
704
|
-
locked_source.respond_to?(:source) && locked_source.source.instance_of?(Source::Path) && locked_source.source.path.exist?
|
705
|
-
dep.source = locked_source.source
|
706
|
-
elsif dep.source
|
717
|
+
changes = false
|
718
|
+
|
719
|
+
@dependencies.each do |dep|
|
720
|
+
if dep.source
|
707
721
|
dep.source = sources.get(dep.source)
|
708
722
|
end
|
709
|
-
if dep.source.is_a?(Source::Gemspec)
|
710
|
-
dep.platforms.concat(@platforms.map {|p| Dependency::REVERSE_PLATFORM_MAP[p] }.flatten(1)).uniq!
|
711
|
-
end
|
712
|
-
end
|
713
723
|
|
714
|
-
|
715
|
-
# We want to know if all match, but don't want to check all entries
|
716
|
-
# This means we need to return false if any dependency doesn't match
|
717
|
-
# the lock or doesn't exist in the lock.
|
718
|
-
@dependencies.each do |dependency|
|
719
|
-
unless locked_dep = @locked_deps[dependency.name]
|
724
|
+
unless locked_dep = @locked_deps[dep.name]
|
720
725
|
changes = true
|
721
726
|
next
|
722
727
|
end
|
@@ -727,11 +732,11 @@ module Bundler
|
|
727
732
|
# directive, the lockfile dependencies and resolved dependencies end up
|
728
733
|
# with a mismatch on #type. Work around that by setting the type on the
|
729
734
|
# dep from the lockfile.
|
730
|
-
locked_dep.instance_variable_set(:@type,
|
735
|
+
locked_dep.instance_variable_set(:@type, dep.type)
|
731
736
|
|
732
737
|
# We already know the name matches from the hash lookup
|
733
738
|
# so we only need to check the requirement now
|
734
|
-
changes ||=
|
739
|
+
changes ||= dep.requirement != locked_dep.requirement
|
735
740
|
end
|
736
741
|
|
737
742
|
changes
|
@@ -741,50 +746,50 @@ module Bundler
|
|
741
746
|
# commonly happen if the Gemfile has changed since the lockfile was last
|
742
747
|
# generated
|
743
748
|
def converge_locked_specs
|
744
|
-
|
749
|
+
converged = converge_specs(@locked_specs)
|
745
750
|
|
746
|
-
|
747
|
-
# and Gemfile.lock. If the Gemfile modified a dependency, but
|
748
|
-
# the gem in the Gemfile.lock still satisfies it, this is fine
|
749
|
-
# too.
|
750
|
-
@dependencies.each do |dep|
|
751
|
-
locked_dep = @locked_deps[dep.name]
|
751
|
+
resolve = SpecSet.new(converged.reject {|s| @unlock[:gems].include?(s.name) })
|
752
752
|
|
753
|
-
|
754
|
-
locked_dep = nil unless locked_dep == dep
|
753
|
+
diff = nil
|
755
754
|
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
@locked_specs.each do |s|
|
760
|
-
@unlock[:gems] << s.name if s.source == dep.source
|
761
|
-
end
|
755
|
+
# Now, we unlock any sources that do not have anymore gems pinned to it
|
756
|
+
sources.all_sources.each do |source|
|
757
|
+
next unless source.respond_to?(:unlock!)
|
762
758
|
|
763
|
-
|
764
|
-
|
759
|
+
unless resolve.any? {|s| s.source == source }
|
760
|
+
diff ||= @locked_specs.to_a - resolve.to_a
|
761
|
+
source.unlock! if diff.any? {|s| s.source == source }
|
765
762
|
end
|
766
763
|
end
|
767
764
|
|
768
|
-
|
765
|
+
resolve
|
766
|
+
end
|
769
767
|
|
768
|
+
def converge_specs(specs)
|
770
769
|
converged = []
|
771
|
-
|
772
|
-
|
770
|
+
|
771
|
+
deps = @dependencies.select do |dep|
|
772
|
+
specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
|
773
|
+
end
|
774
|
+
|
775
|
+
@specs_that_changed_sources = []
|
776
|
+
|
777
|
+
specs.each do |s|
|
773
778
|
dep = @dependencies.find {|d| s.satisfies?(d) }
|
774
|
-
s.source = (dep && dep.source) || sources.get(s.source)
|
775
779
|
|
776
|
-
#
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
+
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
781
|
+
s.source = if dep && dep.source
|
782
|
+
gemfile_source = dep.source
|
783
|
+
lockfile_source = s.source
|
780
784
|
|
781
|
-
|
782
|
-
# unlock a single gem by passing its name via `--source`. See issue #3759
|
783
|
-
# TODO: delete in Bundler 2
|
784
|
-
next if unlock_source_unlocks_spec && @unlock[:sources].include?(s.name)
|
785
|
+
@specs_that_changed_sources << s if gemfile_source != lockfile_source
|
785
786
|
|
786
|
-
|
787
|
-
|
787
|
+
gemfile_source
|
788
|
+
else
|
789
|
+
sources.get_with_fallback(s.source)
|
790
|
+
end
|
791
|
+
|
792
|
+
next if @unlock[:sources].include?(s.source.name)
|
788
793
|
|
789
794
|
# Path sources have special logic
|
790
795
|
if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
|
@@ -793,160 +798,73 @@ module Bundler
|
|
793
798
|
rescue PathError, GitError
|
794
799
|
# if we won't need the source (according to the lockfile),
|
795
800
|
# don't error if the path/git source isn't available
|
796
|
-
next if
|
797
|
-
for(requested_dependencies,
|
801
|
+
next if specs.
|
802
|
+
for(requested_dependencies, false).
|
798
803
|
none? {|locked_spec| locked_spec.source == s.source }
|
799
804
|
|
800
805
|
raise
|
801
806
|
end
|
802
807
|
|
803
808
|
new_spec = new_specs[s].first
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
# If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it
|
812
|
-
next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) }
|
813
|
-
|
814
|
-
s.dependencies.replace(new_spec.dependencies)
|
809
|
+
if new_spec
|
810
|
+
s.dependencies.replace(new_spec.dependencies)
|
811
|
+
else
|
812
|
+
# If the spec is no longer in the path source, unlock it. This
|
813
|
+
# commonly happens if the version changed in the gemspec
|
814
|
+
@unlock[:gems] << s.name
|
815
|
+
end
|
815
816
|
end
|
816
817
|
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
@locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(deps), @unlock[:gems], true, true)
|
822
|
-
resolve = resolve.for(expand_dependencies(deps, true), @unlock[:gems], false, false, false)
|
823
|
-
diff = nil
|
824
|
-
|
825
|
-
# Now, we unlock any sources that do not have anymore gems pinned to it
|
826
|
-
sources.all_sources.each do |source|
|
827
|
-
next unless source.respond_to?(:unlock!)
|
828
|
-
|
829
|
-
unless resolve.any? {|s| s.source == source }
|
830
|
-
diff ||= @locked_specs.to_a - resolve.to_a
|
831
|
-
source.unlock! if diff.any? {|s| s.source == source }
|
818
|
+
if dep.nil? && requested_dependencies.find {|d| s.name == d.name }
|
819
|
+
@unlock[:gems] << s.name
|
820
|
+
else
|
821
|
+
converged << s
|
832
822
|
end
|
833
823
|
end
|
834
824
|
|
835
|
-
|
836
|
-
end
|
837
|
-
|
838
|
-
def in_locked_deps?(dep, locked_dep)
|
839
|
-
# Because the lockfile can't link a dep to a specific remote, we need to
|
840
|
-
# treat sources as equivalent anytime the locked dep has all the remotes
|
841
|
-
# that the Gemfile dep does.
|
842
|
-
locked_dep && locked_dep.source && dep.source && locked_dep.source.include?(dep.source)
|
843
|
-
end
|
844
|
-
|
845
|
-
def satisfies_locked_spec?(dep)
|
846
|
-
@locked_specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
|
847
|
-
end
|
848
|
-
|
849
|
-
# This list of dependencies is only used in #resolve, so it's OK to add
|
850
|
-
# the metadata dependencies here
|
851
|
-
def expanded_dependencies
|
852
|
-
@expanded_dependencies ||= begin
|
853
|
-
expand_dependencies(dependencies + metadata_dependencies, @remote)
|
854
|
-
end
|
825
|
+
filter_specs(converged, deps)
|
855
826
|
end
|
856
827
|
|
857
828
|
def metadata_dependencies
|
858
|
-
@metadata_dependencies ||=
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby]
|
863
|
-
end
|
864
|
-
[
|
865
|
-
Dependency.new("Ruby\0", ruby_versions),
|
866
|
-
Dependency.new("RubyGems\0", Gem::VERSION),
|
867
|
-
]
|
868
|
-
end
|
869
|
-
end
|
870
|
-
|
871
|
-
def concat_ruby_version_requirements(ruby_version, ruby_versions = [])
|
872
|
-
return ruby_versions unless ruby_version
|
873
|
-
if ruby_version.patchlevel
|
874
|
-
ruby_versions << ruby_version.to_gem_version_with_patchlevel
|
875
|
-
else
|
876
|
-
ruby_versions.concat(ruby_version.versions.map do |version|
|
877
|
-
requirement = Gem::Requirement.new(version)
|
878
|
-
if requirement.exact?
|
879
|
-
"~> #{version}.0"
|
880
|
-
else
|
881
|
-
requirement
|
882
|
-
end
|
883
|
-
end)
|
884
|
-
end
|
885
|
-
end
|
886
|
-
|
887
|
-
def expand_dependencies(dependencies, remote = false)
|
888
|
-
sorted_platforms = Resolver.sort_platforms(@platforms)
|
889
|
-
deps = []
|
890
|
-
dependencies.each do |dep|
|
891
|
-
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
|
892
|
-
next if !remote && !dep.current_platform?
|
893
|
-
platforms = dep.gem_platforms(sorted_platforms)
|
894
|
-
if platforms.empty? && !Bundler.settings[:disable_platform_warnings]
|
895
|
-
mapped_platforms = dep.expanded_platforms
|
896
|
-
Bundler.ui.warn \
|
897
|
-
"The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \
|
898
|
-
"Bundler is installing for #{@platforms.join ", "} but the dependency " \
|
899
|
-
"is only for #{mapped_platforms.join ", "}. " \
|
900
|
-
"To add those platforms to the bundle, " \
|
901
|
-
"run `bundle lock --add-platform #{mapped_platforms.join " "}`."
|
902
|
-
end
|
903
|
-
platforms.each do |p|
|
904
|
-
deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
|
905
|
-
end
|
906
|
-
end
|
907
|
-
deps
|
908
|
-
end
|
909
|
-
|
910
|
-
def requested_dependencies
|
911
|
-
groups = requested_groups
|
912
|
-
groups.map!(&:to_sym)
|
913
|
-
dependencies.reject {|d| !d.should_include? || (d.groups & groups).empty? }
|
829
|
+
@metadata_dependencies ||= [
|
830
|
+
Dependency.new("Ruby\0", Gem.ruby_version),
|
831
|
+
Dependency.new("RubyGems\0", Gem::VERSION),
|
832
|
+
]
|
914
833
|
end
|
915
834
|
|
916
835
|
def source_requirements
|
917
|
-
# Load all specs from remote sources
|
918
|
-
index
|
919
|
-
|
920
836
|
# Record the specs available in each gem's source, so that those
|
921
837
|
# specs will be available later when the resolver knows where to
|
922
838
|
# look for that gemspec (or its dependencies)
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
839
|
+
source_requirements = if precompute_source_requirements_for_indirect_dependencies?
|
840
|
+
all_requirements = source_map.all_requirements
|
841
|
+
all_requirements = pin_locally_available_names(all_requirements) if @prefer_local
|
842
|
+
{ :default => sources.default_source }.merge(all_requirements)
|
843
|
+
else
|
844
|
+
{ :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
|
929
845
|
end
|
846
|
+
source_requirements.merge!(source_map.locked_requirements) unless @remote
|
930
847
|
metadata_dependencies.each do |dep|
|
931
848
|
source_requirements[dep.name] = sources.metadata_source
|
932
849
|
end
|
850
|
+
source_requirements[:default_bundler] = source_requirements["bundler"] || sources.default_source
|
933
851
|
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
|
852
|
+
verify_changed_sources!
|
934
853
|
source_requirements
|
935
854
|
end
|
936
855
|
|
937
|
-
def
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
next if dep_source == skip
|
943
|
-
pinned_names << dep.name
|
856
|
+
def verify_changed_sources!
|
857
|
+
@specs_that_changed_sources.each do |s|
|
858
|
+
if s.source.specs.search(s.name).empty?
|
859
|
+
raise GemNotFound, "Could not find gem '#{s.name}' in #{s.source}"
|
860
|
+
end
|
944
861
|
end
|
945
|
-
pinned_names
|
946
862
|
end
|
947
863
|
|
948
864
|
def requested_groups
|
949
|
-
groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
|
865
|
+
values = groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
|
866
|
+
values &= Bundler.settings[:only] unless Bundler.settings[:only].empty?
|
867
|
+
values
|
950
868
|
end
|
951
869
|
|
952
870
|
def lockfiles_equal?(current, proposed, preserve_unknown_sections)
|
@@ -962,41 +880,26 @@ module Bundler
|
|
962
880
|
current == proposed
|
963
881
|
end
|
964
882
|
|
965
|
-
def
|
966
|
-
|
967
|
-
|
968
|
-
|
883
|
+
def additional_base_requirements_for_resolve(last_resolve)
|
884
|
+
return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
885
|
+
converge_specs(@originally_locked_specs - last_resolve).map do |locked_spec|
|
886
|
+
Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
|
887
|
+
end.uniq
|
969
888
|
end
|
970
889
|
|
971
|
-
def
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
end
|
978
|
-
requires
|
979
|
-
end
|
980
|
-
end
|
890
|
+
def remove_ruby_from_platforms_if_necessary!(dependencies)
|
891
|
+
return if Bundler.frozen_bundle? ||
|
892
|
+
Bundler.local_platform == Gem::Platform::RUBY ||
|
893
|
+
!platforms.include?(Gem::Platform::RUBY) ||
|
894
|
+
(@new_platform && platforms.last == Gem::Platform::RUBY) ||
|
895
|
+
!@originally_locked_specs.incomplete_ruby_specs?(dependencies)
|
981
896
|
|
982
|
-
|
983
|
-
|
984
|
-
dependencies_by_name = dependencies.inject({}) {|memo, dep| memo.update(dep.name => dep) }
|
985
|
-
@locked_gems.specs.reduce({}) do |requirements, locked_spec|
|
986
|
-
name = locked_spec.name
|
987
|
-
dependency = dependencies_by_name[name]
|
988
|
-
next requirements if @locked_gems.dependencies[name] != dependency
|
989
|
-
next requirements if dependency && dependency.source.is_a?(Source::Path)
|
990
|
-
dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
|
991
|
-
requirements[name] = DepProxy.new(dep, locked_spec.platform)
|
992
|
-
requirements
|
993
|
-
end.values
|
897
|
+
remove_platform(Gem::Platform::RUBY)
|
898
|
+
add_current_platform
|
994
899
|
end
|
995
900
|
|
996
|
-
def
|
997
|
-
|
998
|
-
|
999
|
-
Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
|
901
|
+
def source_map
|
902
|
+
@source_map ||= SourceMap.new(sources, dependencies, @locked_specs)
|
1000
903
|
end
|
1001
904
|
end
|
1002
905
|
end
|