bundler 1.15.2 → 2.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2861 -1117
- data/LICENSE.md +18 -19
- data/README.md +22 -17
- data/bundler.gemspec +23 -27
- data/exe/bundle +27 -12
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +45 -0
- data/lib/bundler/capistrano.rb +7 -2
- data/lib/bundler/cli/add.rb +33 -12
- data/lib/bundler/cli/binstubs.rb +25 -9
- data/lib/bundler/cli/cache.rb +25 -17
- data/lib/bundler/cli/check.rb +8 -8
- data/lib/bundler/cli/clean.rb +6 -7
- data/lib/bundler/cli/common.rb +52 -15
- data/lib/bundler/cli/config.rb +171 -86
- data/lib/bundler/cli/console.rb +5 -4
- data/lib/bundler/cli/doctor.rb +72 -8
- data/lib/bundler/cli/exec.rb +13 -29
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +266 -48
- data/lib/bundler/cli/info.rb +52 -9
- data/lib/bundler/cli/init.rb +22 -6
- data/lib/bundler/cli/inject.rb +2 -1
- data/lib/bundler/cli/install.rb +74 -99
- data/lib/bundler/cli/issue.rb +9 -8
- data/lib/bundler/cli/list.rb +66 -0
- data/lib/bundler/cli/lock.rb +11 -5
- data/lib/bundler/cli/open.rb +14 -9
- data/lib/bundler/cli/outdated.rb +165 -123
- data/lib/bundler/cli/platform.rb +3 -2
- data/lib/bundler/cli/plugin.rb +20 -2
- data/lib/bundler/cli/pristine.rb +25 -6
- data/lib/bundler/cli/remove.rb +17 -0
- data/lib/bundler/cli/show.rb +3 -4
- data/lib/bundler/cli/update.rb +71 -12
- data/lib/bundler/cli/viz.rb +2 -1
- data/lib/bundler/cli.rb +394 -152
- data/lib/bundler/compact_index_client/cache.rb +8 -26
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +62 -51
- data/lib/bundler/compact_index_client.rb +29 -18
- data/lib/bundler/constants.rb +2 -1
- data/lib/bundler/current_ruby.rb +36 -13
- data/lib/bundler/definition.rb +417 -434
- data/lib/bundler/dependency.rb +34 -76
- data/lib/bundler/deployment.rb +2 -2
- data/lib/bundler/deprecate.rb +15 -3
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +135 -116
- data/lib/bundler/endpoint_specification.rb +26 -15
- data/lib/bundler/env.rb +95 -39
- data/lib/bundler/environment_preserver.rb +56 -8
- data/lib/bundler/errors.rb +32 -14
- data/lib/bundler/feature_flag.rb +29 -7
- data/lib/bundler/fetcher/base.rb +8 -9
- data/lib/bundler/fetcher/compact_index.rb +47 -49
- data/lib/bundler/fetcher/dependency.rb +5 -8
- data/lib/bundler/fetcher/downloader.rb +26 -17
- data/lib/bundler/fetcher/index.rb +5 -30
- data/lib/bundler/fetcher.rb +51 -46
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +53 -53
- data/lib/bundler/gem_helper.rb +95 -50
- data/lib/bundler/gem_helpers.rb +45 -28
- data/lib/bundler/gem_tasks.rb +2 -1
- data/lib/bundler/gem_version_promoter.rb +60 -90
- data/lib/bundler/graph.rb +6 -5
- data/lib/bundler/index.rb +23 -61
- data/lib/bundler/injector.rb +228 -32
- data/lib/bundler/inline.rb +29 -32
- data/lib/bundler/installer/gem_installer.rb +24 -16
- data/lib/bundler/installer/parallel_installer.rb +94 -71
- data/lib/bundler/installer/standalone.rb +63 -12
- data/lib/bundler/installer.rb +128 -94
- data/lib/bundler/lazy_specification.rb +89 -52
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +40 -66
- data/lib/bundler/man/bundle-add.1 +82 -0
- data/lib/bundler/man/bundle-add.1.ronn +58 -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 +61 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +26 -14
- data/{man → lib/bundler/man}/bundle-check.1 +4 -4
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +3 -3
- 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 +175 -57
- data/lib/bundler/man/bundle-config.1.ronn +408 -0
- data/lib/bundler/man/bundle-console.1 +53 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/lib/bundler/man/bundle-doctor.1 +44 -0
- data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +11 -8
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +16 -9
- 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/lib/bundler/man/bundle-init.1 +29 -0
- data/lib/bundler/man/bundle-init.1.ronn +31 -0
- data/{man → lib/bundler/man}/bundle-inject.1 +7 -4
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +5 -3
- data/{man → lib/bundler/man}/bundle-install.1 +63 -55
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +81 -68
- data/lib/bundler/man/bundle-list.1 +50 -0
- data/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +22 -2
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +9 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +8 -11
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +7 -12
- 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/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/{man → lib/bundler/man}/bundle-show.1 +3 -3
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +3 -2
- data/{man → lib/bundler/man}/bundle-update.1 +17 -13
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +27 -22
- 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 +10 -7
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +8 -6
- data/{man → lib/bundler/man}/bundle.1 +44 -31
- data/lib/bundler/man/bundle.1.ronn +116 -0
- data/{man → lib/bundler/man}/gemfile.5 +153 -83
- data/{man → lib/bundler/man}/gemfile.5.ronn +156 -93
- data/lib/bundler/man/index.txt +29 -0
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +2 -2
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +16 -15
- data/lib/bundler/plugin/api/source.rb +35 -14
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +38 -10
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +35 -18
- data/lib/bundler/plugin/source_list.rb +11 -8
- data/lib/bundler/plugin.rb +115 -47
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/remote_specification.rb +12 -8
- data/lib/bundler/resolver/base.rb +107 -0
- data/lib/bundler/resolver/candidate.rb +94 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +72 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +82 -0
- data/lib/bundler/resolver.rb +327 -324
- data/lib/bundler/retry.rb +5 -4
- data/lib/bundler/ruby_dsl.rb +2 -1
- data/lib/bundler/ruby_version.rb +11 -38
- data/lib/bundler/rubygems_ext.rb +236 -90
- data/lib/bundler/rubygems_gem_installer.rb +104 -8
- data/lib/bundler/rubygems_integration.rb +204 -501
- data/lib/bundler/runtime.rb +35 -48
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/settings.rb +309 -142
- data/lib/bundler/setup.rb +15 -12
- data/lib/bundler/shared_helpers.rb +147 -83
- data/lib/bundler/similarity_detector.rb +4 -3
- data/lib/bundler/source/gemspec.rb +1 -0
- data/lib/bundler/source/git/git_proxy.rb +281 -125
- data/lib/bundler/source/git.rb +102 -73
- data/lib/bundler/source/metadata.rb +62 -0
- data/lib/bundler/source/path/installer.rb +13 -32
- data/lib/bundler/source/path.rb +36 -25
- data/lib/bundler/source/rubygems/remote.rb +9 -4
- data/lib/bundler/source/rubygems.rb +273 -226
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +65 -9
- data/lib/bundler/source_list.rb +138 -33
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +101 -72
- data/lib/bundler/stub_specification.rb +45 -36
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +13 -3
- data/lib/bundler/templates/Executable.bundler +109 -0
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +1 -2
- 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 +22 -2
- data/lib/bundler/templates/newgem/README.md.tt +14 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +43 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/lib/bundler/templates/newgem/gitignore.tt +3 -1
- 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 +5 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +39 -35
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- 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 +1 -1
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/rg_proxy.rb +2 -1
- data/lib/bundler/ui/shell.rb +49 -17
- data/lib/bundler/ui/silent.rb +22 -5
- data/lib/bundler/ui.rb +4 -3
- data/lib/bundler/uri_credentials_filter.rb +11 -4
- data/lib/bundler/uri_normalizer.rb +23 -0
- 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 +174 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +128 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +2706 -0
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +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/net-http-persistent/lib/net/http/persistent.rb +302 -462
- data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +60 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +243 -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_file.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +4 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +9 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +64 -16
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +27 -11
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +38 -16
- data/lib/bundler/vendor/thor/lib/thor/base.rb +84 -41
- data/lib/bundler/vendor/thor/lib/thor/command.rb +30 -21
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +18 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +83 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- 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/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +22 -9
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +45 -10
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +17 -14
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +97 -21
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +39 -15
- 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 +729 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1587 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +539 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +119 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendored_fileutils.rb +4 -0
- data/lib/bundler/vendored_persistent.rb +6 -8
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +2 -1
- data/lib/bundler/vendored_thor.rb +3 -2
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +8 -19
- data/lib/bundler/vlad.rb +6 -1
- data/lib/bundler/worker.rb +26 -14
- data/lib/bundler/yaml_serializer.rb +6 -7
- data/lib/bundler.rb +336 -199
- metadata +174 -236
- data/.codeclimate.yml +0 -25
- data/.gitignore +0 -18
- data/.rspec +0 -3
- data/.rubocop.yml +0 -131
- data/.rubocop_todo.yml +0 -418
- data/.travis.yml +0 -122
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -17
- data/Rakefile +0 -338
- data/bin/rake +0 -19
- data/bin/rspec +0 -15
- data/bin/rubocop +0 -17
- data/bin/with_rubygems +0 -39
- data/doc/README.md +0 -30
- data/doc/TROUBLESHOOTING.md +0 -64
- data/doc/contributing/BUG_TRIAGE.md +0 -36
- data/doc/contributing/COMMUNITY.md +0 -13
- data/doc/contributing/GETTING_HELP.md +0 -11
- data/doc/contributing/HOW_YOU_CAN_HELP.md +0 -27
- data/doc/contributing/ISSUES.md +0 -51
- data/doc/contributing/README.md +0 -38
- data/doc/development/NEW_FEATURES.md +0 -10
- data/doc/development/PULL_REQUESTS.md +0 -40
- data/doc/development/README.md +0 -19
- data/doc/development/RELEASING.md +0 -9
- data/doc/development/SETUP.md +0 -27
- data/doc/documentation/README.md +0 -29
- data/doc/documentation/VISION.md +0 -26
- data/doc/documentation/WRITING.md +0 -54
- data/exe/bundle_ruby +0 -59
- data/lib/bundler/cli/package.rb +0 -46
- data/lib/bundler/dep_proxy.rb +0 -46
- data/lib/bundler/gem_remote_fetcher.rb +0 -42
- data/lib/bundler/gemdeps.rb +0 -28
- data/lib/bundler/psyched_yaml.rb +0 -27
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -65
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/templates/newgem/.travis.yml.tt +0 -5
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -3
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -50
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -80
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -35
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -65
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -60
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -125
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -45
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -35
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -125
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -222
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -75
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -100
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -65
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -494
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -45
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -54
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -10
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/lib/bundler/version_ranges.rb +0 -75
- data/man/bundle-add.1 +0 -43
- data/man/bundle-add.1.txt +0 -40
- data/man/bundle-add.ronn +0 -29
- data/man/bundle-binstubs.1 +0 -30
- data/man/bundle-binstubs.1.txt +0 -33
- data/man/bundle-binstubs.ronn +0 -29
- data/man/bundle-check.1.txt +0 -32
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -418
- data/man/bundle-config.ronn +0 -318
- data/man/bundle-exec.1.txt +0 -171
- data/man/bundle-gem.1 +0 -80
- data/man/bundle-gem.1.txt +0 -90
- data/man/bundle-gem.ronn +0 -77
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1 +0 -20
- data/man/bundle-init.1.txt +0 -24
- data/man/bundle-init.ronn +0 -18
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -385
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -127
- data/man/bundle-package.1 +0 -52
- data/man/bundle-package.1.txt +0 -74
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1 +0 -16
- data/man/bundle-pristine.1.txt +0 -21
- data/man/bundle-pristine.ronn +0 -13
- data/man/bundle-show.1.txt +0 -25
- data/man/bundle-update.1.txt +0 -388
- data/man/bundle-viz.1.txt +0 -37
- data/man/bundle.1.txt +0 -110
- data/man/bundle.ronn +0 -105
- data/man/gemfile.5.txt +0 -600
- data/man/index.txt +0 -15
- data/task/release.rake +0 -116
- /data/lib/bundler/{ssl_certs → man}/.document +0 -0
- /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
data/lib/bundler/retry.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
# General purpose class for retrying code that may fail
|
4
5
|
class Retry
|
@@ -31,13 +32,13 @@ module Bundler
|
|
31
32
|
end
|
32
33
|
alias_method :attempts, :attempt
|
33
34
|
|
34
|
-
|
35
|
+
private
|
35
36
|
|
36
37
|
def run(&block)
|
37
|
-
@failed
|
38
|
+
@failed = false
|
38
39
|
@current_run += 1
|
39
40
|
@result = block.call
|
40
|
-
rescue => e
|
41
|
+
rescue StandardError => e
|
41
42
|
fail_attempt(e)
|
42
43
|
end
|
43
44
|
|
@@ -48,7 +49,7 @@ module Bundler
|
|
48
49
|
raise e
|
49
50
|
end
|
50
51
|
return true unless name
|
51
|
-
Bundler.ui.info "" unless Bundler.ui.debug? # Add new line
|
52
|
+
Bundler.ui.info "" unless Bundler.ui.debug? # Add new line in case dots preceded this
|
52
53
|
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
|
53
54
|
end
|
54
55
|
|
data/lib/bundler/ruby_dsl.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
module RubyDsl
|
4
5
|
def ruby(*ruby_version)
|
@@ -8,7 +9,7 @@ module Bundler
|
|
8
9
|
raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
|
9
10
|
|
10
11
|
if options[:engine] == "ruby" && options[:engine_version] &&
|
11
|
-
|
12
|
+
ruby_version != Array(options[:engine_version])
|
12
13
|
raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
|
13
14
|
end
|
14
15
|
@ruby_version = RubyVersion.new(ruby_version, options[:patchlevel], options[:engine], options[:engine_version])
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
class RubyVersion
|
4
5
|
attr_reader :versions,
|
@@ -31,12 +32,12 @@ module Bundler
|
|
31
32
|
@engine = engine && engine.to_s || "ruby"
|
32
33
|
@engine_versions = (engine_version && Array(engine_version)) || @versions
|
33
34
|
@engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
|
34
|
-
@patchlevel = patchlevel
|
35
|
+
@patchlevel = patchlevel || (@gem_version.prerelease? ? "-1" : nil)
|
35
36
|
end
|
36
37
|
|
37
38
|
def to_s(versions = self.versions)
|
38
39
|
output = String.new("ruby #{versions_string(versions)}")
|
39
|
-
output << "p#{patchlevel}" if patchlevel
|
40
|
+
output << "p#{patchlevel}" if patchlevel && patchlevel != "-1"
|
40
41
|
output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
|
41
42
|
|
42
43
|
output
|
@@ -45,10 +46,10 @@ module Bundler
|
|
45
46
|
# @private
|
46
47
|
PATTERN = /
|
47
48
|
ruby\s
|
48
|
-
(
|
49
|
+
(\d+\.\d+\.\d+(?:\.\S+)?) # ruby version
|
49
50
|
(?:p(-?\d+))? # optional patchlevel
|
50
51
|
(?:\s\((\S+)\s(.+)\))? # optional engine info
|
51
|
-
/xo
|
52
|
+
/xo.freeze
|
52
53
|
|
53
54
|
# Returns a RubyVersion from the given string.
|
54
55
|
# @param [String] the version string to match.
|
@@ -73,7 +74,7 @@ module Bundler
|
|
73
74
|
@host ||= [
|
74
75
|
RbConfig::CONFIG["host_cpu"],
|
75
76
|
RbConfig::CONFIG["host_vendor"],
|
76
|
-
RbConfig::CONFIG["host_os"]
|
77
|
+
RbConfig::CONFIG["host_os"],
|
77
78
|
].join("-")
|
78
79
|
end
|
79
80
|
|
@@ -101,43 +102,15 @@ module Bundler
|
|
101
102
|
end
|
102
103
|
|
103
104
|
def self.system
|
104
|
-
ruby_engine =
|
105
|
-
|
106
|
-
|
107
|
-
# not defined in ruby 1.8.7
|
108
|
-
"ruby"
|
109
|
-
end
|
110
|
-
# :sob: mocking RUBY_VERSION breaks stuff on 1.8.7
|
111
|
-
ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
|
112
|
-
ruby_engine_version = case ruby_engine
|
113
|
-
when "ruby"
|
114
|
-
ruby_version
|
115
|
-
when "rbx"
|
116
|
-
Rubinius::VERSION.dup
|
117
|
-
when "jruby"
|
118
|
-
JRUBY_VERSION.dup
|
119
|
-
else
|
120
|
-
raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized"
|
121
|
-
end
|
105
|
+
ruby_engine = RUBY_ENGINE.dup
|
106
|
+
ruby_version = Gem.ruby_version.to_s
|
107
|
+
ruby_engine_version = RUBY_ENGINE == "ruby" ? ruby_version : RUBY_ENGINE_VERSION.dup
|
122
108
|
patchlevel = RUBY_PATCHLEVEL.to_s
|
123
109
|
|
124
|
-
@
|
125
|
-
end
|
126
|
-
|
127
|
-
def to_gem_version_with_patchlevel
|
128
|
-
@gem_version_with_patch ||= begin
|
129
|
-
Gem::Version.create("#{@gem_version}.#{@patchlevel}")
|
130
|
-
rescue ArgumentError
|
131
|
-
@gem_version
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
def exact?
|
136
|
-
return @exact if defined?(@exact)
|
137
|
-
@exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
|
110
|
+
@system ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
|
138
111
|
end
|
139
112
|
|
140
|
-
|
113
|
+
private
|
141
114
|
|
142
115
|
def matches?(requirements, version)
|
143
116
|
# Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -1,53 +1,52 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require "pathname"
|
3
2
|
|
4
|
-
|
5
|
-
# Gem Prelude makes me a sad panda :'(
|
6
|
-
Gem::QuickLoader.load_full_rubygems_library
|
7
|
-
end
|
3
|
+
require "pathname"
|
8
4
|
|
9
|
-
require "rubygems"
|
10
5
|
require "rubygems/specification"
|
11
6
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
# We can't let `Gem::Source` be autoloaded in the `Gem::Specification#source`
|
8
|
+
# redefinition below, so we need to load it upfront. The reason is that if
|
9
|
+
# Bundler monkeypatches are loaded before RubyGems activates an executable (for
|
10
|
+
# example, through `ruby -rbundler -S irb`), gem activation might end up calling
|
11
|
+
# the redefined `Gem::Specification#source` and triggering the `Gem::Source`
|
12
|
+
# autoload. That would result in requiring "rubygems/source" inside another
|
13
|
+
# require, which would trigger a monitor error and cause the `autoload` to
|
14
|
+
# eventually fail. A better solution is probably to completely avoid autoloading
|
15
|
+
# `Gem::Source` from the redefined `Gem::Specification#source`.
|
16
|
+
require "rubygems/source"
|
17
|
+
|
18
|
+
require_relative "match_metadata"
|
19
|
+
require_relative "force_platform"
|
20
|
+
require_relative "match_platform"
|
21
|
+
|
22
|
+
# Cherry-pick fixes to `Gem.ruby_version` to be useful for modern Bundler
|
23
|
+
# versions and ignore patchlevels
|
24
|
+
# (https://github.com/rubygems/rubygems/pull/5472,
|
25
|
+
# https://github.com/rubygems/rubygems/pull/5486). May be removed once RubyGems
|
26
|
+
# 3.3.12 support is dropped.
|
27
|
+
unless Gem.ruby_version.to_s == RUBY_VERSION || RUBY_PATCHLEVEL == -1
|
28
|
+
Gem.instance_variable_set(:@ruby_version, Gem::Version.new(RUBY_VERSION))
|
19
29
|
end
|
20
30
|
|
21
|
-
require "bundler/match_platform"
|
22
|
-
|
23
31
|
module Gem
|
24
|
-
@loaded_stacks = Hash.new {|h, k| h[k] = [] }
|
25
|
-
|
26
32
|
class Specification
|
33
|
+
include ::Bundler::MatchMetadata
|
34
|
+
include ::Bundler::MatchPlatform
|
35
|
+
|
27
36
|
attr_accessor :remote, :location, :relative_loaded_from
|
28
37
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
(defined?(@source) && @source) || Gem::Source::Installed.new
|
34
|
-
end
|
35
|
-
else
|
36
|
-
attr_accessor :source
|
38
|
+
remove_method :source
|
39
|
+
attr_writer :source
|
40
|
+
def source
|
41
|
+
(defined?(@source) && @source) || Gem::Source::Installed.new
|
37
42
|
end
|
38
43
|
|
39
44
|
alias_method :rg_full_gem_path, :full_gem_path
|
40
45
|
alias_method :rg_loaded_from, :loaded_from
|
41
46
|
|
42
|
-
attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=)
|
43
|
-
|
44
47
|
def full_gem_path
|
45
|
-
|
46
|
-
|
47
|
-
# gems at that time, this method could be called inside another require,
|
48
|
-
# thus raising with that constant being undefined. Better to check a method
|
49
|
-
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
50
|
-
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.untaint
|
48
|
+
if source.respond_to?(:root)
|
49
|
+
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap {|x| x.untaint if RUBY_VERSION < "2.7" }
|
51
50
|
else
|
52
51
|
rg_full_gem_path
|
53
52
|
end
|
@@ -62,36 +61,43 @@ module Gem
|
|
62
61
|
end
|
63
62
|
|
64
63
|
def load_paths
|
65
|
-
|
66
|
-
|
67
|
-
require_paths.map do |require_path|
|
68
|
-
if require_path.include?(full_gem_path)
|
69
|
-
require_path
|
70
|
-
else
|
71
|
-
File.join(full_gem_path, require_path)
|
72
|
-
end
|
73
|
-
end
|
64
|
+
full_require_paths
|
74
65
|
end
|
75
66
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
67
|
+
alias_method :rg_extension_dir, :extension_dir
|
68
|
+
def extension_dir
|
69
|
+
# following instance variable is already used in original method
|
70
|
+
# and that is the reason to prefix it with bundler_ and add rubocop exception
|
71
|
+
@bundler_extension_dir ||= if source.respond_to?(:extension_dir_name) # rubocop:disable Naming/MemoizedInstanceVariableName
|
72
|
+
unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
|
73
|
+
File.expand_path(File.join(extensions_dir, unique_extension_dir))
|
74
|
+
else
|
75
|
+
rg_extension_dir
|
84
76
|
end
|
85
77
|
end
|
86
78
|
|
87
|
-
|
88
|
-
methods = instance_methods(false)
|
89
|
-
gem_dir = methods.first.is_a?(String) ? "gem_dir" : :gem_dir
|
90
|
-
remove_method :gem_dir if methods.include?(gem_dir)
|
79
|
+
remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
|
91
80
|
def gem_dir
|
92
81
|
full_gem_path
|
93
82
|
end
|
94
83
|
|
84
|
+
unless const_defined?(:LATEST_RUBY_WITHOUT_PATCH_VERSIONS)
|
85
|
+
LATEST_RUBY_WITHOUT_PATCH_VERSIONS = Gem::Version.new("2.1")
|
86
|
+
|
87
|
+
alias_method :rg_required_ruby_version=, :required_ruby_version=
|
88
|
+
def required_ruby_version=(req)
|
89
|
+
self.rg_required_ruby_version = req
|
90
|
+
|
91
|
+
@required_ruby_version.requirements.map! do |op, v|
|
92
|
+
if v >= LATEST_RUBY_WITHOUT_PATCH_VERSIONS && v.release.segments.size == 4
|
93
|
+
[op == "~>" ? "=" : op, Gem::Version.new(v.segments.tap {|s| s.delete_at(3) }.join("."))]
|
94
|
+
else
|
95
|
+
[op, v]
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
95
101
|
def groups
|
96
102
|
@groups ||= []
|
97
103
|
end
|
@@ -111,11 +117,26 @@ module Gem
|
|
111
117
|
gemfile
|
112
118
|
end
|
113
119
|
|
120
|
+
# Backfill missing YAML require when not defined. Fixed since 3.1.0.pre1.
|
121
|
+
module YamlBackfiller
|
122
|
+
def to_yaml(opts = {})
|
123
|
+
Gem.load_yaml unless defined?(::YAML)
|
124
|
+
|
125
|
+
super(opts)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
prepend YamlBackfiller
|
130
|
+
|
114
131
|
def nondevelopment_dependencies
|
115
132
|
dependencies - development_dependencies
|
116
133
|
end
|
117
134
|
|
118
|
-
|
135
|
+
def deleted_gem?
|
136
|
+
!default_gem? && !File.directory?(full_gem_path)
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
119
140
|
|
120
141
|
def dependencies_to_gemfile(dependencies, group = nil)
|
121
142
|
gemfile = String.new
|
@@ -135,10 +156,18 @@ module Gem
|
|
135
156
|
end
|
136
157
|
|
137
158
|
class Dependency
|
159
|
+
include ::Bundler::ForcePlatform
|
160
|
+
|
138
161
|
attr_accessor :source, :groups
|
139
162
|
|
140
163
|
alias_method :eql?, :==
|
141
164
|
|
165
|
+
def force_ruby_platform
|
166
|
+
return @force_ruby_platform if defined?(@force_ruby_platform) && !@force_ruby_platform.nil?
|
167
|
+
|
168
|
+
@force_ruby_platform = default_force_ruby_platform
|
169
|
+
end
|
170
|
+
|
142
171
|
def encode_with(coder)
|
143
172
|
to_yaml_properties.each do |ivar|
|
144
173
|
coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
|
@@ -157,53 +186,170 @@ module Gem
|
|
157
186
|
end
|
158
187
|
out
|
159
188
|
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# comparison is done order independently since rubygems 3.2.0.rc.2
|
192
|
+
unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
|
193
|
+
class Requirement
|
194
|
+
module OrderIndependentComparison
|
195
|
+
def ==(other)
|
196
|
+
return unless Gem::Requirement === other
|
197
|
+
|
198
|
+
if _requirements_sorted? && other._requirements_sorted?
|
199
|
+
super
|
200
|
+
else
|
201
|
+
_with_sorted_requirements == other._with_sorted_requirements
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
protected
|
160
206
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
207
|
+
def _requirements_sorted?
|
208
|
+
return @_requirements_sorted if defined?(@_requirements_sorted)
|
209
|
+
strings = as_list
|
210
|
+
@_requirements_sorted = strings == strings.sort
|
211
|
+
end
|
166
212
|
|
167
|
-
|
168
|
-
|
213
|
+
def _with_sorted_requirements
|
214
|
+
@_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
prepend OrderIndependentComparison
|
219
|
+
end
|
169
220
|
end
|
170
221
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
end unless allocate.respond_to?(:exact?)
|
222
|
+
if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
|
223
|
+
class Requirement
|
224
|
+
module CorrectHashForLambdaOperator
|
225
|
+
def hash
|
226
|
+
if requirements.any? {|r| r.first == "~>" }
|
227
|
+
requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
|
228
|
+
else
|
229
|
+
super
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
prepend CorrectHashForLambdaOperator
|
235
|
+
end
|
186
236
|
end
|
187
237
|
|
238
|
+
require "rubygems/platform"
|
239
|
+
|
188
240
|
class Platform
|
189
|
-
JAVA = Gem::Platform.new("java")
|
190
|
-
MSWIN = Gem::Platform.new("mswin32")
|
191
|
-
MSWIN64 = Gem::Platform.new("mswin64")
|
192
|
-
MINGW = Gem::Platform.new("x86-mingw32")
|
193
|
-
X64_MINGW = Gem::Platform.new("x64-mingw32")
|
241
|
+
JAVA = Gem::Platform.new("java")
|
242
|
+
MSWIN = Gem::Platform.new("mswin32")
|
243
|
+
MSWIN64 = Gem::Platform.new("mswin64")
|
244
|
+
MINGW = Gem::Platform.new("x86-mingw32")
|
245
|
+
X64_MINGW = [Gem::Platform.new("x64-mingw32"),
|
246
|
+
Gem::Platform.new("x64-mingw-ucrt")].freeze
|
247
|
+
WINDOWS = [MSWIN, MSWIN64, MINGW, X64_MINGW].flatten.freeze
|
248
|
+
X64_LINUX = Gem::Platform.new("x86_64-linux")
|
249
|
+
X64_LINUX_MUSL = Gem::Platform.new("x86_64-linux-musl")
|
250
|
+
|
251
|
+
if X64_LINUX === X64_LINUX_MUSL
|
252
|
+
remove_method :===
|
253
|
+
|
254
|
+
def ===(other)
|
255
|
+
return nil unless Gem::Platform === other
|
256
|
+
|
257
|
+
# universal-mingw32 matches x64-mingw-ucrt
|
258
|
+
return true if (@cpu == "universal" || other.cpu == "universal") &&
|
259
|
+
@os.start_with?("mingw") && other.os.start_with?("mingw")
|
260
|
+
|
261
|
+
# cpu
|
262
|
+
([nil,"universal"].include?(@cpu) || [nil, "universal"].include?(other.cpu) || @cpu == other.cpu ||
|
263
|
+
(@cpu == "arm" && other.cpu.start_with?("arm"))) &&
|
264
|
+
|
265
|
+
# os
|
266
|
+
@os == other.os &&
|
267
|
+
|
268
|
+
# version
|
269
|
+
(
|
270
|
+
(@os != "linux" && (@version.nil? || other.version.nil?)) ||
|
271
|
+
(@os == "linux" && (normalized_linux_version_ext == other.normalized_linux_version_ext || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) ||
|
272
|
+
@version == other.version
|
273
|
+
)
|
274
|
+
end
|
194
275
|
|
195
|
-
|
196
|
-
|
197
|
-
|
276
|
+
# This is a copy of RubyGems 3.3.23 or higher `normalized_linux_method`.
|
277
|
+
# Once only 3.3.23 is supported, we can use the method in RubyGems.
|
278
|
+
def normalized_linux_version_ext
|
279
|
+
return nil unless @version
|
280
|
+
|
281
|
+
without_gnu_nor_abi_modifiers = @version.sub(/\Agnu/, "").sub(/eabi(hf)?\Z/, "")
|
282
|
+
return nil if without_gnu_nor_abi_modifiers.empty?
|
283
|
+
|
284
|
+
without_gnu_nor_abi_modifiers
|
285
|
+
end
|
198
286
|
end
|
199
287
|
|
200
|
-
|
201
|
-
|
288
|
+
if RUBY_ENGINE == "truffleruby" && !defined?(REUSE_AS_BINARY_ON_TRUFFLERUBY)
|
289
|
+
REUSE_AS_BINARY_ON_TRUFFLERUBY = %w[libv8 libv8-node sorbet-static].freeze
|
290
|
+
end
|
202
291
|
end
|
203
|
-
end
|
204
292
|
|
205
|
-
|
293
|
+
Platform.singleton_class.module_eval do
|
294
|
+
unless Platform.singleton_methods.include?(:match_spec?)
|
295
|
+
def match_spec?(spec)
|
296
|
+
match_gem?(spec.platform, spec.name)
|
297
|
+
end
|
298
|
+
|
299
|
+
def match_gem?(platform, gem_name)
|
300
|
+
match_platforms?(platform, Gem.platforms)
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
match_platforms_defined = Gem::Platform.respond_to?(:match_platforms?, true)
|
305
|
+
|
306
|
+
if !match_platforms_defined || Gem::Platform.send(:match_platforms?, Gem::Platform::X64_LINUX_MUSL, [Gem::Platform::X64_LINUX])
|
307
|
+
|
308
|
+
private
|
309
|
+
|
310
|
+
remove_method :match_platforms? if match_platforms_defined
|
311
|
+
|
312
|
+
def match_platforms?(platform, platforms)
|
313
|
+
platforms.any? do |local_platform|
|
314
|
+
platform.nil? ||
|
315
|
+
local_platform == platform ||
|
316
|
+
(local_platform != Gem::Platform::RUBY && platform =~ local_platform)
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
# On universal Rubies, resolve the "universal" arch to the real CPU arch, without changing the extension directory.
|
206
323
|
class Specification
|
207
|
-
|
324
|
+
if /^universal\.(?<arch>.*?)-/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
|
325
|
+
local_platform = Platform.local
|
326
|
+
if local_platform.cpu == "universal"
|
327
|
+
ORIGINAL_LOCAL_PLATFORM = local_platform.to_s.freeze
|
328
|
+
|
329
|
+
local_platform.cpu = if arch == "arm64e" # arm64e is only permitted for Apple system binaries
|
330
|
+
"arm64"
|
331
|
+
else
|
332
|
+
arch
|
333
|
+
end
|
334
|
+
|
335
|
+
def extensions_dir
|
336
|
+
Gem.default_ext_dir_for(base_dir) ||
|
337
|
+
File.join(base_dir, "extensions", ORIGINAL_LOCAL_PLATFORM,
|
338
|
+
Gem.extension_api_version)
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
require "rubygems/util"
|
345
|
+
|
346
|
+
Util.singleton_class.module_eval do
|
347
|
+
if Util.singleton_methods.include?(:glob_files_in_dir) # since 3.0.0.beta.2
|
348
|
+
remove_method :glob_files_in_dir
|
349
|
+
end
|
350
|
+
|
351
|
+
def glob_files_in_dir(glob, base_path)
|
352
|
+
Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) }
|
353
|
+
end
|
208
354
|
end
|
209
355
|
end
|
@@ -1,23 +1,119 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "rubygems/installer"
|
3
4
|
|
4
5
|
module Bundler
|
5
6
|
class RubyGemsGemInstaller < Gem::Installer
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
def check_executable_overwrite(filename)
|
8
|
+
# Bundler needs to install gems regardless of binstub overwriting
|
9
|
+
end
|
10
|
+
|
11
|
+
def install
|
12
|
+
pre_install_checks
|
13
|
+
|
14
|
+
run_pre_install_hooks
|
15
|
+
|
16
|
+
spec.loaded_from = spec_file
|
17
|
+
|
18
|
+
# Completely remove any previous gem files
|
19
|
+
strict_rm_rf gem_dir
|
20
|
+
strict_rm_rf spec.extension_dir
|
21
|
+
|
22
|
+
SharedHelpers.filesystem_access(gem_dir, :create) do
|
23
|
+
FileUtils.mkdir_p gem_dir, :mode => 0o755
|
9
24
|
end
|
25
|
+
|
26
|
+
extract_files
|
27
|
+
|
28
|
+
build_extensions if spec.extensions.any?
|
29
|
+
write_build_info_file
|
30
|
+
run_post_build_hooks
|
31
|
+
|
32
|
+
generate_bin
|
33
|
+
generate_plugins
|
34
|
+
|
35
|
+
write_spec
|
36
|
+
|
37
|
+
SharedHelpers.filesystem_access("#{gem_home}/cache", :write) do
|
38
|
+
write_cache_file
|
39
|
+
end
|
40
|
+
|
41
|
+
say spec.post_install_message unless spec.post_install_message.nil?
|
42
|
+
|
43
|
+
run_post_install_hooks
|
44
|
+
|
45
|
+
spec
|
10
46
|
end
|
11
47
|
|
12
|
-
def
|
13
|
-
|
48
|
+
def generate_plugins
|
49
|
+
return unless Gem::Installer.instance_methods(false).include?(:generate_plugins)
|
50
|
+
|
51
|
+
latest = Gem::Specification.stubs_for(spec.name).first
|
52
|
+
return if latest && latest.version > spec.version
|
53
|
+
|
54
|
+
ensure_writable_dir @plugins_dir
|
55
|
+
|
56
|
+
if spec.plugins.empty?
|
57
|
+
remove_plugins_for(spec, @plugins_dir)
|
58
|
+
else
|
59
|
+
regenerate_plugins_for(spec, @plugins_dir)
|
60
|
+
end
|
14
61
|
end
|
15
62
|
|
16
63
|
def pre_install_checks
|
17
64
|
super && validate_bundler_checksum(options[:bundler_expected_checksum])
|
18
65
|
end
|
19
66
|
|
20
|
-
|
67
|
+
def build_extensions
|
68
|
+
extension_cache_path = options[:bundler_extension_cache_path]
|
69
|
+
extension_dir = spec.extension_dir
|
70
|
+
unless extension_cache_path && extension_dir
|
71
|
+
prepare_extension_build(extension_dir)
|
72
|
+
return super
|
73
|
+
end
|
74
|
+
|
75
|
+
build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
|
76
|
+
if build_complete && !options[:force]
|
77
|
+
SharedHelpers.filesystem_access(File.dirname(extension_dir)) do |p|
|
78
|
+
FileUtils.mkpath p
|
79
|
+
end
|
80
|
+
SharedHelpers.filesystem_access(extension_cache_path) do
|
81
|
+
FileUtils.cp_r extension_cache_path, extension_dir
|
82
|
+
end
|
83
|
+
else
|
84
|
+
prepare_extension_build(extension_dir)
|
85
|
+
super
|
86
|
+
SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
|
87
|
+
SharedHelpers.filesystem_access(extension_cache_path) do
|
88
|
+
FileUtils.cp_r extension_dir, extension_cache_path
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def spec
|
94
|
+
if Bundler.rubygems.provides?("< 3.3.12") # RubyGems implementation rescues and re-raises errors before 3.3.12 and we don't want that
|
95
|
+
@package.spec
|
96
|
+
else
|
97
|
+
super
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def prepare_extension_build(extension_dir)
|
104
|
+
SharedHelpers.filesystem_access(extension_dir, :create) do
|
105
|
+
FileUtils.mkdir_p extension_dir
|
106
|
+
end
|
107
|
+
require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
|
108
|
+
end
|
109
|
+
|
110
|
+
def strict_rm_rf(dir)
|
111
|
+
Bundler.rm_rf dir
|
112
|
+
rescue StandardError => e
|
113
|
+
raise unless File.exist?(dir)
|
114
|
+
|
115
|
+
raise DirectoryRemovalError.new(e, "Could not delete previous installation of `#{dir}`")
|
116
|
+
end
|
21
117
|
|
22
118
|
def validate_bundler_checksum(checksum)
|
23
119
|
return true if Bundler.settings[:disable_checksum_validation]
|
@@ -25,7 +121,7 @@ module Bundler
|
|
25
121
|
return true unless source = @package.instance_variable_get(:@gem)
|
26
122
|
return true unless source.respond_to?(:with_read_io)
|
27
123
|
digest = source.with_read_io do |io|
|
28
|
-
digest =
|
124
|
+
digest = SharedHelpers.digest(:SHA256).new
|
29
125
|
digest << io.read(16_384) until io.eof?
|
30
126
|
io.rewind
|
31
127
|
send(checksum_type(checksum), digest)
|
@@ -43,7 +139,7 @@ module Bundler
|
|
43
139
|
|
44
140
|
If you wish to continue installing the downloaded gem, and are certain it does not pose a \
|
45
141
|
security issue despite the mismatching checksum, do the following:
|
46
|
-
1. run `bundle config disable_checksum_validation true` to turn off checksum verification
|
142
|
+
1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
|
47
143
|
2. run `bundle install`
|
48
144
|
|
49
145
|
(More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
|