bundler 1.11.1 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2125 -840
- data/LICENSE.md +18 -19
- data/README.md +33 -11
- data/bundler.gemspec +34 -21
- data/exe/bundle +36 -6
- data/exe/bundler +2 -18
- data/lib/bundler.rb +435 -160
- data/lib/bundler/build_metadata.rb +45 -0
- data/lib/bundler/capistrano.rb +9 -3
- data/lib/bundler/cli.rb +550 -130
- data/lib/bundler/cli/add.rb +47 -0
- data/lib/bundler/cli/binstubs.rb +26 -10
- data/lib/bundler/cli/cache.rb +25 -17
- data/lib/bundler/cli/check.rb +8 -7
- data/lib/bundler/cli/clean.rb +8 -8
- data/lib/bundler/cli/common.rb +69 -9
- data/lib/bundler/cli/config.rb +170 -76
- data/lib/bundler/cli/console.rb +6 -1
- data/lib/bundler/cli/doctor.rb +140 -0
- data/lib/bundler/cli/exec.rb +63 -21
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +158 -42
- data/lib/bundler/cli/info.rb +73 -0
- data/lib/bundler/cli/init.rb +22 -7
- data/lib/bundler/cli/inject.rb +38 -10
- data/lib/bundler/cli/install.rb +139 -104
- data/lib/bundler/cli/issue.rb +40 -0
- data/lib/bundler/cli/list.rb +60 -0
- data/lib/bundler/cli/lock.rb +27 -5
- data/lib/bundler/cli/open.rb +13 -5
- data/lib/bundler/cli/outdated.rb +251 -46
- data/lib/bundler/cli/platform.rb +6 -2
- data/lib/bundler/cli/plugin.rb +41 -0
- data/lib/bundler/cli/pristine.rb +52 -0
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +5 -4
- data/lib/bundler/cli/update.rb +67 -26
- data/lib/bundler/cli/viz.rb +11 -6
- data/lib/bundler/compact_index_client.rb +125 -0
- data/lib/bundler/compact_index_client/cache.rb +110 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +104 -0
- data/lib/bundler/constants.rb +2 -0
- data/lib/bundler/current_ruby.rb +51 -174
- data/lib/bundler/definition.rb +533 -216
- data/lib/bundler/dep_proxy.rb +18 -8
- data/lib/bundler/dependency.rb +39 -12
- data/lib/bundler/deployment.rb +7 -0
- data/lib/bundler/deprecate.rb +31 -2
- data/lib/bundler/dsl.rb +188 -91
- data/lib/bundler/endpoint_specification.rb +51 -10
- data/lib/bundler/env.rb +116 -48
- data/lib/bundler/environment_preserver.rb +82 -0
- data/lib/bundler/errors.rb +108 -31
- data/lib/bundler/feature_flag.rb +60 -0
- data/lib/bundler/fetcher.rb +81 -52
- data/lib/bundler/fetcher/base.rb +15 -3
- data/lib/bundler/fetcher/compact_index.rb +140 -0
- data/lib/bundler/fetcher/dependency.rb +36 -42
- data/lib/bundler/fetcher/downloader.rb +39 -12
- data/lib/bundler/fetcher/index.rb +34 -9
- data/lib/bundler/friendly_errors.rb +132 -88
- data/lib/bundler/gem_helper.rb +92 -50
- data/lib/bundler/gem_helpers.rb +90 -5
- data/lib/bundler/gem_tasks.rb +3 -1
- data/lib/bundler/gem_version_promoter.rb +190 -0
- data/lib/bundler/gemdeps.rb +29 -0
- data/lib/bundler/graph.rb +20 -41
- data/lib/bundler/index.rb +74 -57
- data/lib/bundler/injector.rb +242 -31
- data/lib/bundler/inline.rb +49 -23
- data/lib/bundler/installer.rb +190 -74
- data/lib/bundler/installer/gem_installer.rb +33 -20
- data/lib/bundler/installer/parallel_installer.rb +201 -97
- data/lib/bundler/installer/standalone.rb +10 -6
- data/lib/bundler/lazy_specification.rb +74 -10
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +126 -74
- data/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/lib/bundler/man/bundle-add.1 +66 -0
- data/lib/bundler/man/bundle-add.1.ronn +46 -0
- data/lib/bundler/man/bundle-binstubs.1 +42 -0
- data/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
- data/lib/bundler/man/bundle-cache.1 +55 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +22 -16
- data/lib/bundler/man/bundle-check.1 +31 -0
- data/lib/bundler/man/bundle-check.1.ronn +26 -0
- data/lib/bundler/man/bundle-clean.1 +24 -0
- data/lib/bundler/man/bundle-clean.1.ronn +18 -0
- data/lib/bundler/man/bundle-config.1 +488 -0
- data/lib/bundler/man/bundle-config.1.ronn +388 -0
- data/lib/bundler/man/bundle-doctor.1 +44 -0
- data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/lib/bundler/man/bundle-exec.1 +165 -0
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +20 -4
- data/lib/bundler/man/bundle-gem.1 +102 -0
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +37 -13
- data/lib/bundler/man/bundle-info.1 +20 -0
- data/lib/bundler/man/bundle-info.1.ronn +17 -0
- data/lib/bundler/man/bundle-init.1 +25 -0
- data/lib/bundler/man/bundle-init.1.ronn +29 -0
- data/lib/bundler/man/bundle-inject.1 +33 -0
- data/lib/bundler/man/bundle-inject.1.ronn +22 -0
- data/lib/bundler/man/bundle-install.1 +338 -0
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +82 -76
- data/lib/bundler/man/bundle-list.1 +50 -0
- data/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/lib/bundler/man/bundle-lock.1 +84 -0
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +47 -0
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/lib/bundler/man/bundle-open.1.ronn +19 -0
- data/lib/bundler/man/bundle-outdated.1 +155 -0
- data/lib/bundler/man/bundle-outdated.1.ronn +111 -0
- data/lib/bundler/man/bundle-platform.1 +61 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +1 -1
- data/lib/bundler/man/bundle-pristine.1 +34 -0
- data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/lib/bundler/man/bundle-remove.1 +31 -0
- data/lib/bundler/man/bundle-remove.1.ronn +23 -0
- data/lib/bundler/man/bundle-show.1 +23 -0
- data/lib/bundler/man/bundle-show.1.ronn +21 -0
- data/lib/bundler/man/bundle-update.1 +394 -0
- data/lib/bundler/man/bundle-update.1.ronn +350 -0
- data/lib/bundler/man/bundle-viz.1 +39 -0
- data/lib/bundler/man/bundle-viz.1.ronn +30 -0
- data/lib/bundler/man/bundle.1 +136 -0
- data/lib/bundler/man/bundle.1.ronn +111 -0
- data/lib/bundler/man/gemfile.5 +686 -0
- data/{man → lib/bundler/man}/gemfile.5.ronn +117 -95
- data/lib/bundler/man/index.txt +25 -0
- data/lib/bundler/match_platform.rb +15 -4
- data/lib/bundler/mirror.rb +223 -0
- data/lib/bundler/plugin.rb +330 -0
- data/lib/bundler/plugin/api.rb +81 -0
- data/lib/bundler/plugin/api/source.rb +304 -0
- data/lib/bundler/plugin/dsl.rb +53 -0
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +182 -0
- data/lib/bundler/plugin/installer.rb +109 -0
- data/lib/bundler/plugin/installer/git.rb +38 -0
- data/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/lib/bundler/plugin/source_list.rb +27 -0
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +2 -6
- data/lib/bundler/remote_specification.rb +42 -9
- data/lib/bundler/resolver.rb +312 -225
- data/lib/bundler/resolver/spec_group.rb +122 -0
- data/lib/bundler/retry.rb +11 -5
- data/lib/bundler/ruby_dsl.rb +9 -2
- data/lib/bundler/ruby_version.rb +84 -61
- data/lib/bundler/rubygems_ext.rb +92 -53
- data/lib/bundler/rubygems_gem_installer.rb +84 -0
- data/lib/bundler/rubygems_integration.rb +320 -395
- data/lib/bundler/runtime.rb +87 -75
- data/lib/bundler/settings.rb +297 -119
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/setup.rb +13 -12
- data/lib/bundler/shared_helpers.rb +234 -53
- data/lib/bundler/similarity_detector.rb +5 -3
- data/lib/bundler/source.rb +63 -4
- data/lib/bundler/source/gemspec.rb +18 -0
- data/lib/bundler/source/git.rb +97 -50
- data/lib/bundler/source/git/git_proxy.rb +138 -65
- data/lib/bundler/source/metadata.rb +67 -0
- data/lib/bundler/source/path.rb +83 -47
- data/lib/bundler/source/path/installer.rb +42 -11
- data/lib/bundler/source/rubygems.rb +231 -116
- data/lib/bundler/source/rubygems/remote.rb +30 -1
- data/lib/bundler/source_list.rb +103 -21
- data/lib/bundler/spec_set.rb +96 -51
- data/lib/bundler/stub_specification.rb +87 -4
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +14 -1
- data/lib/bundler/templates/Executable.bundler +114 -0
- data/lib/bundler/templates/Executable.standalone +6 -4
- data/lib/bundler/templates/Gemfile +4 -1
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +79 -44
- data/lib/bundler/templates/newgem/Gemfile.tt +18 -2
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +16 -10
- data/lib/bundler/templates/newgem/Rakefile.tt +22 -8
- data/lib/bundler/templates/newgem/bin/console.tt +2 -1
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/lib/bundler/templates/newgem/gitignore.tt +5 -1
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -6
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +6 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -28
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +4 -4
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -2
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- 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/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
- data/lib/bundler/ui.rb +5 -3
- data/lib/bundler/ui/rg_proxy.rb +3 -1
- data/lib/bundler/ui/shell.rb +54 -21
- data/lib/bundler/ui/silent.rb +26 -1
- data/lib/bundler/uri_credentials_filter.rb +43 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1764 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +113 -134
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +158 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +82 -8
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +4 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +6 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +555 -150
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +6 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +19 -12
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +310 -467
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/thor/lib/thor.rb +58 -25
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +50 -33
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +5 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +9 -19
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +79 -22
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +33 -20
- data/lib/bundler/vendor/thor/lib/thor/base.rb +110 -67
- data/lib/bundler/vendor/thor/lib/thor/command.rb +33 -24
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/lib/bundler/vendor/thor/lib/thor/error.rb +81 -3
- data/lib/bundler/vendor/thor/lib/thor/group.rb +16 -16
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +18 -18
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +60 -26
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +31 -13
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +42 -39
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +109 -39
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendored_fileutils.rb +4 -0
- data/lib/bundler/vendored_molinillo.rb +3 -1
- data/lib/bundler/vendored_persistent.rb +45 -9
- data/lib/bundler/vendored_thor.rb +8 -3
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +7 -4
- data/lib/bundler/version_ranges.rb +122 -0
- data/lib/bundler/vlad.rb +8 -2
- data/lib/bundler/worker.rb +38 -6
- data/lib/bundler/yaml_serializer.rb +89 -0
- metadata +164 -158
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -105
- data/.rubocop_todo.yml +0 -120
- data/.travis.yml +0 -97
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -32
- data/DEVELOPMENT.md +0 -118
- data/ISSUES.md +0 -96
- data/Rakefile +0 -309
- data/bin/rake +0 -14
- data/bin/rspec +0 -10
- data/bin/rubocop +0 -11
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -45
- data/lib/bundler/environment.rb +0 -41
- data/lib/bundler/gem_path_manipulation.rb +0 -8
- data/lib/bundler/gem_remote_fetcher.rb +0 -41
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -64
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/net/http/faster.rb +0 -26
- data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +0 -128
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -10
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -98
- data/man/bundle-config.ronn +0 -187
- data/man/bundle-update.ronn +0 -188
- data/man/bundle.ronn +0 -98
- data/man/index.txt +0 -8
@@ -1,124 +1,228 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../worker"
|
4
|
+
require_relative "gem_installer"
|
5
|
+
|
6
|
+
module Bundler
|
7
|
+
class ParallelInstaller
|
8
|
+
class SpecInstallation
|
9
|
+
attr_accessor :spec, :name, :post_install_message, :state, :error
|
10
|
+
def initialize(spec)
|
11
|
+
@spec = spec
|
12
|
+
@name = spec.name
|
13
|
+
@state = :none
|
14
|
+
@post_install_message = ""
|
15
|
+
@error = nil
|
16
|
+
end
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
|
18
|
+
def installed?
|
19
|
+
state == :installed
|
20
|
+
end
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
def enqueued?
|
23
|
+
state == :enqueued
|
24
|
+
end
|
21
25
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
+
def failed?
|
27
|
+
state == :failed
|
28
|
+
end
|
29
|
+
|
30
|
+
def installation_attempted?
|
31
|
+
installed? || failed?
|
32
|
+
end
|
33
|
+
|
34
|
+
# Only true when spec in neither installed nor already enqueued
|
35
|
+
def ready_to_enqueue?
|
36
|
+
!enqueued? && !installation_attempted?
|
37
|
+
end
|
38
|
+
|
39
|
+
def has_post_install_message?
|
40
|
+
!post_install_message.empty?
|
41
|
+
end
|
42
|
+
|
43
|
+
def ignorable_dependency?(dep)
|
44
|
+
dep.type == :development || dep.name == @name
|
45
|
+
end
|
26
46
|
|
27
|
-
|
28
|
-
|
47
|
+
# Checks installed dependencies against spec's dependencies to make
|
48
|
+
# sure needed dependencies have been installed.
|
49
|
+
def dependencies_installed?(all_specs)
|
50
|
+
installed_specs = all_specs.select(&:installed?).map(&:name)
|
51
|
+
dependencies.all? {|d| installed_specs.include? d.name }
|
52
|
+
end
|
53
|
+
|
54
|
+
# Represents only the non-development dependencies, the ones that are
|
55
|
+
# itself and are in the total list.
|
56
|
+
def dependencies
|
57
|
+
@dependencies ||= begin
|
58
|
+
all_dependencies.reject {|dep| ignorable_dependency? dep }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def missing_lockfile_dependencies(all_spec_names)
|
63
|
+
deps = all_dependencies.reject {|dep| ignorable_dependency? dep }
|
64
|
+
deps.reject {|dep| all_spec_names.include? dep.name }
|
65
|
+
end
|
66
|
+
|
67
|
+
# Represents all dependencies
|
68
|
+
def all_dependencies
|
69
|
+
@spec.dependencies
|
70
|
+
end
|
71
|
+
|
72
|
+
def to_s
|
73
|
+
"#<#{self.class} #{@spec.full_name} (#{state})>"
|
74
|
+
end
|
29
75
|
end
|
30
76
|
|
31
|
-
def
|
32
|
-
|
77
|
+
def self.call(*args)
|
78
|
+
new(*args).call
|
33
79
|
end
|
34
80
|
|
35
|
-
|
36
|
-
|
37
|
-
def
|
38
|
-
|
39
|
-
|
81
|
+
attr_reader :size
|
82
|
+
|
83
|
+
def initialize(installer, all_specs, size, standalone, force)
|
84
|
+
@installer = installer
|
85
|
+
@size = size
|
86
|
+
@standalone = standalone
|
87
|
+
@force = force
|
88
|
+
@specs = all_specs.map {|s| SpecInstallation.new(s) }
|
89
|
+
@spec_set = all_specs
|
90
|
+
@rake = @specs.find {|s| s.name == "rake" }
|
40
91
|
end
|
41
92
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
@
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
raise Bundler::LockfileError, "Your Gemfile.lock is corrupt. The following #{missing.size > 1 ? "gems are" : "gem is"} missing " \
|
50
|
-
"from the DEPENDENCIES section: '#{missing.map(&:name).join('\' \'')}'"
|
51
|
-
end
|
52
|
-
deps
|
93
|
+
def call
|
94
|
+
check_for_corrupt_lockfile
|
95
|
+
|
96
|
+
if @size > 1
|
97
|
+
install_with_worker
|
98
|
+
else
|
99
|
+
install_serially
|
53
100
|
end
|
101
|
+
|
102
|
+
handle_error if failed_specs.any?
|
103
|
+
@specs
|
104
|
+
ensure
|
105
|
+
worker_pool && worker_pool.stop
|
54
106
|
end
|
55
107
|
|
56
|
-
|
57
|
-
|
58
|
-
|
108
|
+
def check_for_corrupt_lockfile
|
109
|
+
missing_dependencies = @specs.map do |s|
|
110
|
+
[
|
111
|
+
s,
|
112
|
+
s.missing_lockfile_dependencies(@specs.map(&:name)),
|
113
|
+
]
|
114
|
+
end.reject {|a| a.last.empty? }
|
115
|
+
return if missing_dependencies.empty?
|
116
|
+
|
117
|
+
warning = []
|
118
|
+
warning << "Your lockfile was created by an old Bundler that left some things out."
|
119
|
+
if @size != 1
|
120
|
+
warning << "Because of the missing DEPENDENCIES, we can only install gems one at a time, instead of installing #{@size} at a time."
|
121
|
+
@size = 1
|
122
|
+
end
|
123
|
+
warning << "You can fix this by adding the missing gems to your Gemfile, running bundle install, and then removing the gems from your Gemfile."
|
124
|
+
warning << "The missing gems are:"
|
125
|
+
|
126
|
+
missing_dependencies.each do |spec, missing|
|
127
|
+
warning << "* #{missing.map(&:name).join(", ")} depended upon by #{spec.name}"
|
128
|
+
end
|
129
|
+
|
130
|
+
Bundler.ui.warn(warning.join("\n"))
|
59
131
|
end
|
60
|
-
end
|
61
132
|
|
62
|
-
|
63
|
-
new(*args).call
|
64
|
-
end
|
133
|
+
private
|
65
134
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
135
|
+
def failed_specs
|
136
|
+
@specs.select(&:failed?)
|
137
|
+
end
|
70
138
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
@force = force
|
76
|
-
@specs = all_specs.map {|s| SpecInstallation.new(s) }
|
77
|
-
end
|
139
|
+
def install_with_worker
|
140
|
+
enqueue_specs
|
141
|
+
process_specs until finished_installing?
|
142
|
+
end
|
78
143
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
144
|
+
def install_serially
|
145
|
+
until finished_installing?
|
146
|
+
raise "failed to find a spec to enqueue while installing serially" unless spec_install = @specs.find(&:ready_to_enqueue?)
|
147
|
+
spec_install.state = :enqueued
|
148
|
+
do_install(spec_install, 0)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
def worker_pool
|
153
|
+
@worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda {|spec_install, worker_num|
|
154
|
+
do_install(spec_install, worker_num)
|
155
|
+
}
|
156
|
+
end
|
85
157
|
|
86
|
-
|
87
|
-
|
88
|
-
|
158
|
+
def do_install(spec_install, worker_num)
|
159
|
+
Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL, spec_install)
|
160
|
+
gem_installer = Bundler::GemInstaller.new(
|
89
161
|
spec_install.spec, @installer, @standalone, worker_num, @force
|
90
|
-
)
|
91
|
-
|
162
|
+
)
|
163
|
+
success, message = gem_installer.install_from_spec
|
164
|
+
if success
|
165
|
+
spec_install.state = :installed
|
166
|
+
spec_install.post_install_message = message unless message.nil?
|
167
|
+
else
|
168
|
+
spec_install.error = "#{message}\n\n#{require_tree_for_spec(spec_install.spec)}"
|
169
|
+
spec_install.state = :failed
|
170
|
+
end
|
171
|
+
Plugin.hook(Plugin::Events::GEM_AFTER_INSTALL, spec_install)
|
92
172
|
spec_install
|
93
|
-
|
94
|
-
end
|
173
|
+
end
|
95
174
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
enqueue_specs
|
106
|
-
end
|
175
|
+
# Dequeue a spec and save its post-install message and then enqueue the
|
176
|
+
# remaining specs.
|
177
|
+
# Some specs might've had to wait til this spec was installed to be
|
178
|
+
# processed so the call to `enqueue_specs` is important after every
|
179
|
+
# dequeue.
|
180
|
+
def process_specs
|
181
|
+
worker_pool.deq
|
182
|
+
enqueue_specs
|
183
|
+
end
|
107
184
|
|
108
|
-
|
109
|
-
|
110
|
-
|
185
|
+
def finished_installing?
|
186
|
+
@specs.all? do |spec|
|
187
|
+
return true if spec.failed?
|
188
|
+
spec.installed?
|
189
|
+
end
|
190
|
+
end
|
111
191
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
192
|
+
def handle_error
|
193
|
+
errors = failed_specs.map(&:error)
|
194
|
+
if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) }
|
195
|
+
raise exception
|
196
|
+
end
|
197
|
+
raise Bundler::InstallError, errors.join("\n\n")
|
198
|
+
end
|
199
|
+
|
200
|
+
def require_tree_for_spec(spec)
|
201
|
+
tree = @spec_set.what_required(spec)
|
202
|
+
t = String.new("In #{File.basename(SharedHelpers.default_gemfile)}:\n")
|
203
|
+
tree.each_with_index do |s, depth|
|
204
|
+
t << " " * depth.succ << s.name
|
205
|
+
unless tree.last == s
|
206
|
+
t << %( was resolved to #{s.version}, which depends on)
|
207
|
+
end
|
208
|
+
t << %(\n)
|
209
|
+
end
|
210
|
+
t
|
211
|
+
end
|
212
|
+
|
213
|
+
# Keys in the remains hash represent uninstalled gems specs.
|
214
|
+
# We enqueue all gem specs that do not have any dependencies.
|
215
|
+
# Later we call this lambda again to install specs that depended on
|
216
|
+
# previously installed specifications. We continue until all specs
|
217
|
+
# are installed.
|
218
|
+
def enqueue_specs
|
219
|
+
@specs.select(&:ready_to_enqueue?).each do |spec|
|
220
|
+
next if @rake && !@rake.installed? && spec.name != @rake.name
|
221
|
+
|
222
|
+
if spec.dependencies_installed? @specs
|
223
|
+
spec.state = :enqueued
|
224
|
+
worker_pool.enq spec
|
225
|
+
end
|
122
226
|
end
|
123
227
|
end
|
124
228
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
class Standalone
|
3
5
|
def initialize(groups, definition)
|
@@ -10,17 +12,16 @@ module Bundler
|
|
10
12
|
end
|
11
13
|
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
|
12
14
|
file.puts "require 'rbconfig'"
|
13
|
-
file.puts "
|
14
|
-
file.puts "ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'"
|
15
|
+
file.puts "ruby_engine = RUBY_ENGINE"
|
15
16
|
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
|
16
17
|
file.puts "path = File.expand_path('..', __FILE__)"
|
17
18
|
paths.each do |path|
|
18
|
-
file.puts %($:.unshift "\#{path}/#{path}")
|
19
|
+
file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
+
private
|
24
25
|
|
25
26
|
def paths
|
26
27
|
@specs.map do |spec|
|
@@ -33,16 +34,19 @@ module Bundler
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def version_dir
|
36
|
-
"#{Bundler.
|
37
|
+
"#{Bundler::RubyVersion.system.engine}/#{RbConfig::CONFIG["ruby_version"]}"
|
37
38
|
end
|
38
39
|
|
39
40
|
def bundler_path
|
40
|
-
|
41
|
+
Bundler.root.join(Bundler.settings[:path], "bundler")
|
41
42
|
end
|
42
43
|
|
43
44
|
def gem_path(path, spec)
|
44
45
|
full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
|
45
46
|
Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
|
47
|
+
rescue TypeError
|
48
|
+
error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
|
49
|
+
raise Gem::InvalidSpecificationException.new(error_message)
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
@@ -1,9 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "match_platform"
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class LazySpecification
|
7
|
+
Identifier = Struct.new(:name, :version, :platform)
|
8
|
+
class Identifier
|
9
|
+
include Comparable
|
10
|
+
def <=>(other)
|
11
|
+
return unless other.is_a?(Identifier)
|
12
|
+
[name, version, platform_string] <=> [other.name, other.version, other.platform_string]
|
13
|
+
end
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
def platform_string
|
18
|
+
platform_string = platform.to_s
|
19
|
+
platform_string == Index::RUBY ? Index::NULL : platform_string
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
7
23
|
include MatchPlatform
|
8
24
|
|
9
25
|
attr_reader :name, :version, :dependencies, :platform
|
@@ -13,7 +29,7 @@ module Bundler
|
|
13
29
|
@name = name
|
14
30
|
@version = version
|
15
31
|
@dependencies = []
|
16
|
-
@platform = platform
|
32
|
+
@platform = platform || Gem::Platform::RUBY
|
17
33
|
@source = source
|
18
34
|
@specification = nil
|
19
35
|
end
|
@@ -30,15 +46,25 @@ module Bundler
|
|
30
46
|
identifier == other.identifier
|
31
47
|
end
|
32
48
|
|
49
|
+
def eql?(other)
|
50
|
+
identifier.eql?(other.identifier)
|
51
|
+
end
|
52
|
+
|
53
|
+
def hash
|
54
|
+
identifier.hash
|
55
|
+
end
|
56
|
+
|
33
57
|
def satisfies?(dependency)
|
34
58
|
@name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version))
|
35
59
|
end
|
36
60
|
|
37
61
|
def to_lock
|
62
|
+
out = String.new
|
63
|
+
|
38
64
|
if platform == Gem::Platform::RUBY || platform.nil?
|
39
|
-
out
|
65
|
+
out << " #{name} (#{version})\n"
|
40
66
|
else
|
41
|
-
out
|
67
|
+
out << " #{name} (#{version}-#{platform})\n"
|
42
68
|
end
|
43
69
|
|
44
70
|
dependencies.sort_by(&:to_s).uniq.each do |dep|
|
@@ -50,7 +76,23 @@ module Bundler
|
|
50
76
|
end
|
51
77
|
|
52
78
|
def __materialize__
|
53
|
-
@specification = source.
|
79
|
+
@specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
|
80
|
+
source.gemspec.tap {|s| s.source = source }
|
81
|
+
else
|
82
|
+
search_object = if source.is_a?(Source::Path)
|
83
|
+
Dependency.new(name, version)
|
84
|
+
else
|
85
|
+
ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
|
86
|
+
end
|
87
|
+
platform_object = Gem::Platform.new(platform)
|
88
|
+
candidates = source.specs.search(search_object)
|
89
|
+
same_platform_candidates = candidates.select do |spec|
|
90
|
+
MatchPlatform.platforms_match?(spec.platform, platform_object)
|
91
|
+
end
|
92
|
+
search = same_platform_candidates.last || candidates.last
|
93
|
+
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
94
|
+
search
|
95
|
+
end
|
54
96
|
end
|
55
97
|
|
56
98
|
def respond_to?(*args)
|
@@ -58,14 +100,23 @@ module Bundler
|
|
58
100
|
end
|
59
101
|
|
60
102
|
def to_s
|
61
|
-
@__to_s ||=
|
103
|
+
@__to_s ||= if platform == Gem::Platform::RUBY || platform.nil?
|
104
|
+
"#{name} (#{version})"
|
105
|
+
else
|
106
|
+
"#{name} (#{version}-#{platform})"
|
107
|
+
end
|
62
108
|
end
|
63
109
|
|
64
110
|
def identifier
|
65
|
-
@__identifier ||=
|
111
|
+
@__identifier ||= Identifier.new(name, version, platform)
|
112
|
+
end
|
113
|
+
|
114
|
+
def git_version
|
115
|
+
return unless source.is_a?(Bundler::Source::Git)
|
116
|
+
" #{source.revision[0..6]}"
|
66
117
|
end
|
67
118
|
|
68
|
-
|
119
|
+
private
|
69
120
|
|
70
121
|
def to_ary
|
71
122
|
nil
|
@@ -78,5 +129,18 @@ module Bundler
|
|
78
129
|
|
79
130
|
@specification.send(method, *args, &blk)
|
80
131
|
end
|
132
|
+
|
133
|
+
#
|
134
|
+
# For backwards compatibility with existing lockfiles, if the most specific
|
135
|
+
# locked platform is RUBY, we keep the previous behaviour of resolving the
|
136
|
+
# best platform variant at materiliazation time. For previous bundler
|
137
|
+
# versions (before 2.2.0) this was always the case (except when the lockfile
|
138
|
+
# only included non-ruby platforms), but we're also keeping this behaviour
|
139
|
+
# on newer bundlers unless users generate the lockfile from scratch or
|
140
|
+
# explicitly add a more specific platform.
|
141
|
+
#
|
142
|
+
def ruby_platform_materializes_to_ruby_platform?
|
143
|
+
!Bundler.most_specific_locked_platform?(Gem::Platform::RUBY)
|
144
|
+
end
|
81
145
|
end
|
82
146
|
end
|