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
@@ -20,18 +20,38 @@ module Bundler
|
|
20
20
|
@dependency_names = []
|
21
21
|
@allow_remote = false
|
22
22
|
@allow_cached = false
|
23
|
+
@allow_local = options["allow_local"] || false
|
23
24
|
@caches = [cache_path, *Bundler.rubygems.gem_cache]
|
24
25
|
|
25
|
-
Array(options["remotes"]
|
26
|
+
Array(options["remotes"]).reverse_each {|r| add_remote(r) }
|
27
|
+
end
|
28
|
+
|
29
|
+
def local_only!
|
30
|
+
@specs = nil
|
31
|
+
@allow_local = true
|
32
|
+
@allow_cached = false
|
33
|
+
@allow_remote = false
|
34
|
+
end
|
35
|
+
|
36
|
+
def local!
|
37
|
+
return if @allow_local
|
38
|
+
|
39
|
+
@specs = nil
|
40
|
+
@allow_local = true
|
26
41
|
end
|
27
42
|
|
28
43
|
def remote!
|
44
|
+
return if @allow_remote
|
45
|
+
|
29
46
|
@specs = nil
|
30
47
|
@allow_remote = true
|
31
48
|
end
|
32
49
|
|
33
50
|
def cached!
|
51
|
+
return if @allow_cached
|
52
|
+
|
34
53
|
@specs = nil
|
54
|
+
@allow_local = true
|
35
55
|
@allow_cached = true
|
36
56
|
end
|
37
57
|
|
@@ -49,9 +69,17 @@ module Bundler
|
|
49
69
|
o.is_a?(Rubygems) && (o.credless_remotes - credless_remotes).empty?
|
50
70
|
end
|
51
71
|
|
72
|
+
def multiple_remotes?
|
73
|
+
@remotes.size > 1
|
74
|
+
end
|
75
|
+
|
76
|
+
def no_remotes?
|
77
|
+
@remotes.size == 0
|
78
|
+
end
|
79
|
+
|
52
80
|
def can_lock?(spec)
|
53
|
-
return super
|
54
|
-
spec.source
|
81
|
+
return super unless multiple_remotes?
|
82
|
+
include?(spec.source)
|
55
83
|
end
|
56
84
|
|
57
85
|
def options
|
@@ -73,12 +101,27 @@ module Bundler
|
|
73
101
|
def to_s
|
74
102
|
if remotes.empty?
|
75
103
|
"locally installed gems"
|
76
|
-
|
77
|
-
|
104
|
+
elsif @allow_remote && @allow_cached && @allow_local
|
105
|
+
"rubygems repository #{remote_names}, cached gems or installed locally"
|
106
|
+
elsif @allow_remote && @allow_local
|
78
107
|
"rubygems repository #{remote_names} or installed locally"
|
108
|
+
elsif @allow_remote
|
109
|
+
"rubygems repository #{remote_names}"
|
110
|
+
elsif @allow_cached && @allow_local
|
111
|
+
"cached gems or installed locally"
|
112
|
+
else
|
113
|
+
"locally installed gems"
|
79
114
|
end
|
80
115
|
end
|
81
|
-
|
116
|
+
|
117
|
+
def identifier
|
118
|
+
if remotes.empty?
|
119
|
+
"locally installed gems"
|
120
|
+
else
|
121
|
+
"rubygems repository #{remote_names}"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
alias_method :name, :identifier
|
82
125
|
|
83
126
|
def specs
|
84
127
|
@specs ||= begin
|
@@ -87,120 +130,84 @@ module Bundler
|
|
87
130
|
# small_idx.use large_idx.
|
88
131
|
idx = @allow_remote ? remote_specs.dup : Index.new
|
89
132
|
idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
|
90
|
-
idx.use(installed_specs, :override_dupes)
|
133
|
+
idx.use(installed_specs, :override_dupes) if @allow_local
|
91
134
|
idx
|
92
135
|
end
|
93
136
|
end
|
94
137
|
|
95
|
-
def install(spec,
|
96
|
-
force =
|
97
|
-
ensure_builtin_gems_cached =
|
138
|
+
def install(spec, options = {})
|
139
|
+
force = options[:force]
|
140
|
+
ensure_builtin_gems_cached = options[:ensure_builtin_gems_cached]
|
98
141
|
|
99
|
-
if ensure_builtin_gems_cached &&
|
100
|
-
|
101
|
-
|
102
|
-
force = true
|
103
|
-
else
|
104
|
-
spec.loaded_from = loaded_from(spec)
|
105
|
-
end
|
142
|
+
if ensure_builtin_gems_cached && spec.default_gem? && !cached_path(spec)
|
143
|
+
cached_built_in_gem(spec) unless spec.remote
|
144
|
+
force = true
|
106
145
|
end
|
107
146
|
|
108
|
-
if
|
109
|
-
print_using_message "Using #{version_message(spec)}"
|
147
|
+
if installed?(spec) && !force
|
148
|
+
print_using_message "Using #{version_message(spec, options[:previous_spec])}"
|
110
149
|
return nil # no post-install message
|
111
150
|
end
|
112
151
|
|
113
|
-
# Download the gem to get the spec, because some specs that are returned
|
114
|
-
# by rubygems.org are broken and wrong.
|
115
152
|
if spec.remote
|
116
153
|
# Check for this spec from other sources
|
117
|
-
uris = [spec.remote.anonymized_uri
|
118
|
-
uris += remotes_for_spec(spec).map(&:anonymized_uri)
|
119
|
-
uris.uniq!
|
154
|
+
uris = [spec.remote, *remotes_for_spec(spec)].map(&:anonymized_uri).uniq
|
120
155
|
Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
|
156
|
+
end
|
157
|
+
|
158
|
+
path = fetch_gem_if_possible(spec, options[:previous_spec])
|
159
|
+
raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
|
160
|
+
|
161
|
+
return if Bundler.settings[:no_install]
|
121
162
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
163
|
+
install_path = rubygems_dir
|
164
|
+
bin_path = Bundler.system_bindir
|
165
|
+
|
166
|
+
require_relative "../rubygems_gem_installer"
|
167
|
+
|
168
|
+
installer = Bundler::RubyGemsGemInstaller.at(
|
169
|
+
path,
|
170
|
+
:security_policy => Bundler.rubygems.security_policies[Bundler.settings["trust-policy"]],
|
171
|
+
:install_dir => install_path.to_s,
|
172
|
+
:bin_dir => bin_path.to_s,
|
173
|
+
:ignore_dependencies => true,
|
174
|
+
:wrappers => true,
|
175
|
+
:env_shebang => true,
|
176
|
+
:build_args => options[:build_args],
|
177
|
+
:bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
|
178
|
+
:bundler_extension_cache_path => extension_cache_path(spec)
|
179
|
+
)
|
180
|
+
|
181
|
+
if spec.remote
|
182
|
+
s = begin
|
183
|
+
installer.spec
|
184
|
+
rescue Gem::Package::FormatError
|
127
185
|
Bundler.rm_rf(path)
|
128
186
|
raise
|
187
|
+
rescue Gem::Security::Exception => e
|
188
|
+
raise SecurityError,
|
189
|
+
"The gem #{File.basename(path, ".gem")} can't be installed because " \
|
190
|
+
"the security policy didn't allow it, with the message: #{e.message}"
|
129
191
|
end
|
130
|
-
end
|
131
192
|
|
132
|
-
|
133
|
-
|
134
|
-
message += " with native extensions" if spec.extensions.any?
|
135
|
-
Bundler.ui.confirm message
|
193
|
+
spec.__swap__(s)
|
194
|
+
end
|
136
195
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
bin_path = install_path.join("bin")
|
141
|
-
else
|
142
|
-
install_path = rubygems_dir
|
143
|
-
bin_path = Bundler.system_bindir
|
144
|
-
end
|
196
|
+
message = "Installing #{version_message(spec, options[:previous_spec])}"
|
197
|
+
message += " with native extensions" if spec.extensions.any?
|
198
|
+
Bundler.ui.confirm message
|
145
199
|
|
146
|
-
|
147
|
-
|
148
|
-
installed_spec = nil
|
149
|
-
Bundler.rubygems.preserve_paths do
|
150
|
-
installed_spec = Bundler::RubyGemsGemInstaller.at(
|
151
|
-
path,
|
152
|
-
:install_dir => install_path.to_s,
|
153
|
-
:bin_dir => bin_path.to_s,
|
154
|
-
:ignore_dependencies => true,
|
155
|
-
:wrappers => true,
|
156
|
-
:env_shebang => true,
|
157
|
-
:build_args => opts[:build_args],
|
158
|
-
:bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
|
159
|
-
:bundler_extension_cache_path => extension_cache_path(spec)
|
160
|
-
).install
|
161
|
-
end
|
162
|
-
spec.full_gem_path = installed_spec.full_gem_path
|
163
|
-
|
164
|
-
# SUDO HAX
|
165
|
-
if requires_sudo?
|
166
|
-
Bundler.rubygems.repository_subdirectories.each do |name|
|
167
|
-
src = File.join(install_path, name, "*")
|
168
|
-
dst = File.join(rubygems_dir, name)
|
169
|
-
if name == "extensions" && Dir.glob(src).any?
|
170
|
-
src = File.join(src, "*/*")
|
171
|
-
ext_src = Dir.glob(src).first
|
172
|
-
ext_src.gsub!(src[0..-6], "")
|
173
|
-
dst = File.dirname(File.join(dst, ext_src))
|
174
|
-
end
|
175
|
-
SharedHelpers.filesystem_access(dst) do |p|
|
176
|
-
Bundler.mkdir_p(p)
|
177
|
-
end
|
178
|
-
Bundler.sudo "cp -R #{src} #{dst}" if Dir[src].any?
|
179
|
-
end
|
200
|
+
installed_spec = installer.install
|
180
201
|
|
181
|
-
|
182
|
-
|
183
|
-
Bundler.mkdir_p(p)
|
184
|
-
end
|
185
|
-
Bundler.sudo "cp -R #{install_path}/bin/#{exe} #{Bundler.system_bindir}/"
|
186
|
-
end
|
187
|
-
end
|
188
|
-
installed_spec.loaded_from = loaded_from(spec)
|
189
|
-
end
|
190
|
-
spec.loaded_from = loaded_from(spec)
|
202
|
+
spec.full_gem_path = installed_spec.full_gem_path
|
203
|
+
spec.loaded_from = installed_spec.loaded_from
|
191
204
|
|
192
205
|
spec.post_install_message
|
193
|
-
ensure
|
194
|
-
Bundler.rm_rf(install_path) if requires_sudo?
|
195
206
|
end
|
196
207
|
|
197
208
|
def cache(spec, custom_path = nil)
|
198
|
-
|
199
|
-
|
200
|
-
else
|
201
|
-
cached_path = cached_gem(spec)
|
202
|
-
end
|
203
|
-
raise GemNotFound, "Missing gem file '#{spec.full_name}.gem'." unless cached_path
|
209
|
+
cached_path = Bundler.settings[:cache_all_platforms] ? fetch_gem_if_possible(spec) : cached_gem(spec)
|
210
|
+
raise GemNotFound, "Missing gem file '#{spec.file_name}'." unless cached_path
|
204
211
|
return if File.dirname(cached_path) == Bundler.app_cache.to_s
|
205
212
|
Bundler.ui.info " * #{File.basename(cached_path)}"
|
206
213
|
FileUtils.cp(cached_path, Bundler.app_cache(custom_path))
|
@@ -227,25 +234,16 @@ module Bundler
|
|
227
234
|
@remotes.unshift(uri) unless @remotes.include?(uri)
|
228
235
|
end
|
229
236
|
|
230
|
-
def
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
return false if other_remotes == @remotes
|
236
|
-
|
237
|
-
equivalent = allow_equivalent && equivalent_remotes?(other_remotes)
|
238
|
-
|
239
|
-
@remotes = []
|
240
|
-
other_remotes.reverse_each do |r|
|
241
|
-
add_remote r.to_s
|
237
|
+
def spec_names
|
238
|
+
if @allow_remote && dependency_api_available?
|
239
|
+
remote_specs.spec_names
|
240
|
+
else
|
241
|
+
[]
|
242
242
|
end
|
243
|
-
|
244
|
-
!equivalent
|
245
243
|
end
|
246
244
|
|
247
245
|
def unmet_deps
|
248
|
-
if @allow_remote &&
|
246
|
+
if @allow_remote && dependency_api_available?
|
249
247
|
remote_specs.unmet_dependency_names
|
250
248
|
else
|
251
249
|
[]
|
@@ -261,7 +259,7 @@ module Bundler
|
|
261
259
|
|
262
260
|
def double_check_for(unmet_dependency_names)
|
263
261
|
return unless @allow_remote
|
264
|
-
return unless
|
262
|
+
return unless dependency_api_available?
|
265
263
|
|
266
264
|
unmet_dependency_names = unmet_dependency_names.call
|
267
265
|
unless unmet_dependency_names.nil?
|
@@ -283,21 +281,32 @@ module Bundler
|
|
283
281
|
remote_specs.each do |spec|
|
284
282
|
case spec
|
285
283
|
when EndpointSpecification, Gem::Specification, StubSpecification, LazySpecification
|
286
|
-
names.concat(spec.runtime_dependencies)
|
284
|
+
names.concat(spec.runtime_dependencies.map(&:name))
|
287
285
|
when RemoteSpecification # from the full index
|
288
286
|
return nil
|
289
287
|
else
|
290
288
|
raise "unhandled spec type (#{spec.inspect})"
|
291
289
|
end
|
292
290
|
end
|
293
|
-
names.map!(&:name) if names
|
294
291
|
names
|
295
292
|
end
|
296
293
|
|
297
|
-
|
294
|
+
def dependency_api_available?
|
295
|
+
api_fetchers.any?
|
296
|
+
end
|
297
|
+
|
298
|
+
protected
|
299
|
+
|
300
|
+
def remote_names
|
301
|
+
remotes.map(&:to_s).join(", ")
|
302
|
+
end
|
298
303
|
|
299
304
|
def credless_remotes
|
300
|
-
|
305
|
+
if Bundler.settings[:allow_deployment_source_credential_changes]
|
306
|
+
remotes.map(&method(:remove_auth))
|
307
|
+
else
|
308
|
+
remotes.map(&method(:suppress_configured_credentials))
|
309
|
+
end
|
301
310
|
end
|
302
311
|
|
303
312
|
def remotes_for_spec(spec)
|
@@ -307,26 +316,29 @@ module Bundler
|
|
307
316
|
end
|
308
317
|
end
|
309
318
|
|
310
|
-
def loaded_from(spec)
|
311
|
-
"#{rubygems_dir}/specifications/#{spec.full_name}.gemspec"
|
312
|
-
end
|
313
|
-
|
314
319
|
def cached_gem(spec)
|
315
|
-
|
316
|
-
|
317
|
-
|
320
|
+
if spec.default_gem?
|
321
|
+
cached_built_in_gem(spec)
|
322
|
+
else
|
323
|
+
cached_path(spec)
|
318
324
|
end
|
319
|
-
cached_gem
|
320
325
|
end
|
321
326
|
|
322
327
|
def cached_path(spec)
|
323
|
-
|
328
|
+
global_cache_path = download_cache_path(spec)
|
329
|
+
@caches << global_cache_path if global_cache_path
|
330
|
+
|
331
|
+
possibilities = @caches.map {|p| package_path(p, spec) }
|
324
332
|
possibilities.find {|p| File.exist?(p) }
|
325
333
|
end
|
326
334
|
|
335
|
+
def package_path(cache_path, spec)
|
336
|
+
"#{cache_path}/#{spec.file_name}"
|
337
|
+
end
|
338
|
+
|
327
339
|
def normalize_uri(uri)
|
328
340
|
uri = uri.to_s
|
329
|
-
uri = "#{uri}/" unless
|
341
|
+
uri = "#{uri}/" unless %r{/$}.match?(uri)
|
330
342
|
require_relative "../vendored_uri"
|
331
343
|
uri = Bundler::URI(uri)
|
332
344
|
raise ArgumentError, "The source must be an absolute URI. For example:\n" \
|
@@ -354,7 +366,6 @@ module Bundler
|
|
354
366
|
def installed_specs
|
355
367
|
@installed_specs ||= Index.build do |idx|
|
356
368
|
Bundler.rubygems.all_specs.reverse_each do |spec|
|
357
|
-
next if spec.name == "bundler"
|
358
369
|
spec.source = self
|
359
370
|
if Bundler.rubygems.spec_missing_extensions?(spec, false)
|
360
371
|
Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
|
@@ -367,16 +378,12 @@ module Bundler
|
|
367
378
|
|
368
379
|
def cached_specs
|
369
380
|
@cached_specs ||= begin
|
370
|
-
idx = installed_specs.dup
|
381
|
+
idx = @allow_local ? installed_specs.dup : Index.new
|
371
382
|
|
372
383
|
Dir["#{cache_path}/*.gem"].each do |gemfile|
|
373
|
-
next if
|
384
|
+
next if /^bundler\-[\d\.]+?\.gem/.match?(gemfile)
|
374
385
|
s ||= Bundler.rubygems.spec_from_gem(gemfile)
|
375
386
|
s.source = self
|
376
|
-
if Bundler.rubygems.spec_missing_extensions?(s, false)
|
377
|
-
Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
|
378
|
-
next
|
379
|
-
end
|
380
387
|
idx << s
|
381
388
|
end
|
382
389
|
|
@@ -409,66 +416,56 @@ module Bundler
|
|
409
416
|
def fetch_names(fetchers, dependency_names, index, override_dupes)
|
410
417
|
fetchers.each do |f|
|
411
418
|
if dependency_names
|
412
|
-
Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug?
|
419
|
+
Bundler.ui.info "Fetching gem metadata from #{URICredentialsFilter.credential_filtered_uri(f.uri)}", Bundler.ui.debug?
|
413
420
|
index.use f.specs_with_retry(dependency_names, self), override_dupes
|
414
421
|
Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
|
415
422
|
else
|
416
|
-
Bundler.ui.info "Fetching source index from #{f.uri}"
|
423
|
+
Bundler.ui.info "Fetching source index from #{URICredentialsFilter.credential_filtered_uri(f.uri)}"
|
417
424
|
index.use f.specs_with_retry(nil, self), override_dupes
|
418
425
|
end
|
419
426
|
end
|
420
427
|
end
|
421
428
|
|
422
|
-
def
|
423
|
-
|
429
|
+
def fetch_gem_if_possible(spec, previous_spec = nil)
|
430
|
+
if spec.remote
|
431
|
+
fetch_gem(spec, previous_spec)
|
432
|
+
else
|
433
|
+
cached_gem(spec)
|
434
|
+
end
|
435
|
+
end
|
424
436
|
|
437
|
+
def fetch_gem(spec, previous_spec = nil)
|
425
438
|
spec.fetch_platform
|
426
439
|
|
427
|
-
|
428
|
-
gem_path =
|
440
|
+
cache_path = download_cache_path(spec) || default_cache_path_for(rubygems_dir)
|
441
|
+
gem_path = package_path(cache_path, spec)
|
442
|
+
return gem_path if File.exist?(gem_path)
|
429
443
|
|
430
|
-
SharedHelpers.filesystem_access(
|
444
|
+
SharedHelpers.filesystem_access(cache_path) do |p|
|
431
445
|
FileUtils.mkdir_p(p)
|
432
446
|
end
|
433
|
-
download_gem(spec,
|
434
|
-
|
435
|
-
if requires_sudo?
|
436
|
-
SharedHelpers.filesystem_access("#{rubygems_dir}/cache") do |p|
|
437
|
-
Bundler.mkdir_p(p)
|
438
|
-
end
|
439
|
-
Bundler.sudo "mv #{download_path}/cache/#{spec.full_name}.gem #{gem_path}"
|
440
|
-
end
|
447
|
+
download_gem(spec, cache_path, previous_spec)
|
441
448
|
|
442
449
|
gem_path
|
443
|
-
ensure
|
444
|
-
Bundler.rm_rf(download_path) if requires_sudo?
|
445
|
-
end
|
446
|
-
|
447
|
-
def builtin_gem?(spec)
|
448
|
-
# Ruby 2.1, where all included gems have this summary
|
449
|
-
return true if spec.summary =~ /is bundled with Ruby/
|
450
|
-
|
451
|
-
# Ruby 2.0, where gemspecs are stored in specifications/default/
|
452
|
-
spec.loaded_from && spec.loaded_from.include?("specifications/default/")
|
453
450
|
end
|
454
451
|
|
455
452
|
def installed?(spec)
|
456
|
-
installed_specs[spec].any?
|
453
|
+
installed_specs[spec].any? && !spec.deleted_gem?
|
457
454
|
end
|
458
455
|
|
459
|
-
def
|
460
|
-
Bundler.
|
456
|
+
def rubygems_dir
|
457
|
+
Bundler.bundle_path
|
461
458
|
end
|
462
459
|
|
463
|
-
def
|
464
|
-
|
460
|
+
def default_cache_path_for(dir)
|
461
|
+
"#{dir}/cache"
|
465
462
|
end
|
466
463
|
|
467
464
|
def cache_path
|
468
465
|
Bundler.app_cache
|
469
466
|
end
|
470
467
|
|
471
|
-
|
468
|
+
private
|
472
469
|
|
473
470
|
# Checks if the requested spec exists in the global cache. If it does,
|
474
471
|
# we copy it to the download path, and if it does not, we download it.
|
@@ -476,45 +473,16 @@ module Bundler
|
|
476
473
|
# @param [Specification] spec
|
477
474
|
# the spec we want to download or retrieve from the cache.
|
478
475
|
#
|
479
|
-
# @param [String]
|
476
|
+
# @param [String] download_cache_path
|
480
477
|
# the local directory the .gem will end up in.
|
481
478
|
#
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
if (cache_path = download_cache_path(spec)) && cache_path.file?
|
486
|
-
SharedHelpers.filesystem_access(local_path) do
|
487
|
-
FileUtils.cp(cache_path, local_path)
|
488
|
-
end
|
489
|
-
else
|
490
|
-
uri = spec.remote.uri
|
491
|
-
Bundler.ui.confirm("Fetching #{version_message(spec)}")
|
492
|
-
rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
|
493
|
-
if rubygems_local_path != local_path
|
494
|
-
FileUtils.mv(rubygems_local_path, local_path)
|
495
|
-
end
|
496
|
-
cache_globally(spec, local_path)
|
497
|
-
end
|
498
|
-
end
|
499
|
-
|
500
|
-
# Checks if the requested spec exists in the global cache. If it does
|
501
|
-
# not, we create the relevant global cache subdirectory if it does not
|
502
|
-
# exist and copy the spec from the local cache to the global cache.
|
503
|
-
#
|
504
|
-
# @param [Specification] spec
|
505
|
-
# the spec we want to copy to the global cache.
|
506
|
-
#
|
507
|
-
# @param [String] local_cache_path
|
508
|
-
# the local directory from which we want to copy the .gem.
|
479
|
+
# @param [Specification] previous_spec
|
480
|
+
# the spec previously locked
|
509
481
|
#
|
510
|
-
def
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
SharedHelpers.filesystem_access(cache_path.dirname, &:mkpath)
|
515
|
-
SharedHelpers.filesystem_access(cache_path) do
|
516
|
-
FileUtils.cp(local_cache_path, cache_path)
|
517
|
-
end
|
482
|
+
def download_gem(spec, download_cache_path, previous_spec = nil)
|
483
|
+
uri = spec.remote.uri
|
484
|
+
Bundler.ui.confirm("Fetching #{version_message(spec, previous_spec)}")
|
485
|
+
Bundler.rubygems.download_gem(spec, uri, download_cache_path)
|
518
486
|
end
|
519
487
|
|
520
488
|
# Returns the global cache path of the calling Rubygems::Source object.
|
@@ -533,7 +501,7 @@ module Bundler
|
|
533
501
|
return unless remote = spec.remote
|
534
502
|
return unless cache_slug = remote.cache_slug
|
535
503
|
|
536
|
-
Bundler.user_cache.join("gems", cache_slug
|
504
|
+
Bundler.user_cache.join("gems", cache_slug)
|
537
505
|
end
|
538
506
|
|
539
507
|
def extension_cache_slug(spec)
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Source
|
5
|
+
class RubygemsAggregate
|
6
|
+
attr_reader :source_map, :sources
|
7
|
+
|
8
|
+
def initialize(sources, source_map)
|
9
|
+
@sources = sources
|
10
|
+
@source_map = source_map
|
11
|
+
|
12
|
+
@index = build_index
|
13
|
+
end
|
14
|
+
|
15
|
+
def specs
|
16
|
+
@index
|
17
|
+
end
|
18
|
+
|
19
|
+
def identifier
|
20
|
+
to_s
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
"any of the sources"
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def build_index
|
30
|
+
Index.build do |idx|
|
31
|
+
dependency_names = source_map.pinned_spec_names
|
32
|
+
|
33
|
+
sources.all_sources.each do |source|
|
34
|
+
source.dependency_names = dependency_names - source_map.pinned_spec_names(source)
|
35
|
+
idx.add_source source.specs
|
36
|
+
dependency_names.concat(source.unmet_deps).uniq!
|
37
|
+
end
|
38
|
+
|
39
|
+
double_check_for_index(idx, dependency_names)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
|
44
|
+
# sources A and B. At this point, the API request will have found all the versions of Bar in source A,
|
45
|
+
# but will not have found any versions of Bar from source B, which is a problem if the requested version
|
46
|
+
# of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
|
47
|
+
# each spec we found, we add all possible versions from all sources to the index.
|
48
|
+
def double_check_for_index(idx, dependency_names)
|
49
|
+
pinned_names = source_map.pinned_spec_names
|
50
|
+
|
51
|
+
names = :names # do this so we only have to traverse to get dependency_names from the index once
|
52
|
+
unmet_dependency_names = lambda do
|
53
|
+
return names unless names == :names
|
54
|
+
new_names = sources.all_sources.map(&:dependency_names_to_double_check)
|
55
|
+
return names = nil if new_names.compact!
|
56
|
+
names = new_names.flatten(1).concat(dependency_names)
|
57
|
+
names.uniq!
|
58
|
+
names -= pinned_names
|
59
|
+
names
|
60
|
+
end
|
61
|
+
|
62
|
+
sources.all_sources.each do |source|
|
63
|
+
source.double_check_for(unmet_dependency_names)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|