bundler 1.17.3 → 2.4.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2786 -1256
- data/LICENSE.md +18 -19
- data/README.md +10 -14
- data/bundler.gemspec +13 -33
- data/exe/bundle +15 -8
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +4 -12
- data/lib/bundler/capistrano.rb +4 -4
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/binstubs.rb +12 -4
- data/lib/bundler/cli/cache.rb +24 -17
- data/lib/bundler/cli/check.rb +5 -3
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +41 -13
- data/lib/bundler/cli/config.rb +170 -86
- data/lib/bundler/cli/console.rb +3 -3
- data/lib/bundler/cli/doctor.rb +27 -10
- data/lib/bundler/cli/exec.rb +8 -25
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +261 -48
- data/lib/bundler/cli/info.rb +53 -9
- data/lib/bundler/cli/init.rb +7 -3
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +39 -67
- data/lib/bundler/cli/issue.rb +8 -7
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +11 -4
- data/lib/bundler/cli/open.rb +14 -9
- data/lib/bundler/cli/outdated.rb +153 -122
- data/lib/bundler/cli/platform.rb +8 -6
- data/lib/bundler/cli/plugin.rb +19 -2
- data/lib/bundler/cli/pristine.rb +6 -1
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +3 -3
- data/lib/bundler/cli/update.rb +49 -18
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +269 -165
- 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 +58 -57
- data/lib/bundler/compact_index_client.rb +28 -18
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +26 -11
- data/lib/bundler/definition.rb +432 -464
- data/lib/bundler/dependency.rb +29 -71
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +85 -117
- data/lib/bundler/endpoint_specification.rb +16 -14
- data/lib/bundler/env.rb +11 -16
- data/lib/bundler/environment_preserver.rb +32 -5
- data/lib/bundler/errors.rb +31 -14
- data/lib/bundler/feature_flag.rb +12 -33
- data/lib/bundler/fetcher/base.rb +7 -9
- data/lib/bundler/fetcher/compact_index.rb +47 -40
- data/lib/bundler/fetcher/dependency.rb +3 -7
- data/lib/bundler/fetcher/downloader.rb +17 -12
- data/lib/bundler/fetcher/index.rb +5 -32
- data/lib/bundler/fetcher.rb +51 -43
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +49 -54
- data/lib/bundler/gem_helper.rb +81 -46
- data/lib/bundler/gem_helpers.rb +44 -28
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +54 -99
- data/lib/bundler/graph.rb +5 -5
- data/lib/bundler/index.rb +16 -54
- data/lib/bundler/injector.rb +51 -17
- data/lib/bundler/inline.rb +28 -29
- data/lib/bundler/installer/gem_installer.rb +22 -23
- data/lib/bundler/installer/parallel_installer.rb +39 -52
- data/lib/bundler/installer/standalone.rb +62 -12
- data/lib/bundler/installer.rb +47 -98
- data/lib/bundler/lazy_specification.rb +88 -52
- data/lib/bundler/lockfile_generator.rb +4 -4
- data/lib/bundler/lockfile_parser.rb +41 -72
- data/{man → lib/bundler/man}/bundle-add.1 +29 -5
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +22 -4
- data/{man → lib/bundler/man}/bundle-binstubs.1 +6 -4
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
- data/lib/bundler/man/bundle-cache.1 +61 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +24 -17
- 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 +78 -63
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +96 -88
- 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 +6 -6
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +6 -6
- 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 +3 -3
- data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +3 -3
- data/{man → lib/bundler/man}/bundle-init.1 +6 -2
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +3 -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 +42 -37
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +42 -38
- 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 +22 -2
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +9 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +15 -18
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +13 -19
- 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 +8 -8
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +8 -7
- 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 +17 -12
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +14 -9
- data/{man → lib/bundler/man}/gemfile.5 +139 -92
- data/{man → lib/bundler/man}/gemfile.5.ronn +118 -96
- data/{man → lib/bundler/man}/index.txt +5 -1
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +1 -2
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +10 -12
- data/lib/bundler/plugin/api/source.rb +29 -15
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +32 -9
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +40 -24
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +103 -43
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +12 -9
- 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 +49 -73
- data/lib/bundler/resolver.rb +355 -301
- data/lib/bundler/retry.rb +4 -4
- data/lib/bundler/ruby_dsl.rb +7 -1
- data/lib/bundler/ruby_version.rb +12 -40
- data/lib/bundler/rubygems_ext.rb +237 -92
- data/lib/bundler/rubygems_gem_installer.rb +87 -21
- data/lib/bundler/rubygems_integration.rb +180 -516
- data/lib/bundler/runtime.rb +26 -41
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +164 -120
- data/lib/bundler/setup.rb +14 -12
- data/lib/bundler/shared_helpers.rb +62 -103
- data/lib/bundler/similarity_detector.rb +3 -3
- data/lib/bundler/source/git/git_proxy.rb +292 -128
- data/lib/bundler/source/git.rb +114 -64
- data/lib/bundler/source/metadata.rb +9 -9
- data/lib/bundler/source/path/installer.rb +11 -32
- data/lib/bundler/source/path.rb +29 -18
- data/lib/bundler/source/rubygems/remote.rb +3 -4
- data/lib/bundler/source/rubygems.rb +181 -208
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +31 -11
- data/lib/bundler/source_list.rb +108 -67
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +96 -72
- data/lib/bundler/stub_specification.rb +45 -37
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +22 -18
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -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 +13 -15
- 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 -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 +37 -41
- 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/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 -2
- data/lib/bundler/ui/shell.rb +39 -20
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/uri_credentials_filter.rb +10 -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 +1493 -425
- 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 +248 -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 +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +25 -14
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +20 -10
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +34 -15
- data/lib/bundler/vendor/thor/lib/thor/base.rb +63 -43
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- 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 +83 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- 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 +20 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +40 -6
- 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 +15 -14
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +88 -13
- 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 +16 -9
- 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 +1 -6
- data/lib/bundler/vendored_persistent.rb +2 -39
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +5 -20
- data/lib/bundler/vlad.rb +2 -2
- data/lib/bundler/worker.rb +26 -15
- data/lib/bundler/yaml_serializer.rb +3 -4
- data/lib/bundler.rb +285 -190
- metadata +157 -218
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- data/lib/bundler/dep_proxy.rb +0 -48
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- 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/gems.rb +0 -8
- 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/templates/newgem/travis.yml.tt +0 -7
- 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 -136
- 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/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 -76
- data/man/bundle-add.1.txt +0 -52
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -529
- 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 -396
- 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-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
- 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 -391
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -653
- /data/lib/bundler/{ssl_certs → man}/.document +0 -0
- /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-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- /data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- /data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- /data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
data/lib/bundler/retry.rb
CHANGED
@@ -32,13 +32,13 @@ module Bundler
|
|
32
32
|
end
|
33
33
|
alias_method :attempts, :attempt
|
34
34
|
|
35
|
-
|
35
|
+
private
|
36
36
|
|
37
37
|
def run(&block)
|
38
|
-
@failed
|
38
|
+
@failed = false
|
39
39
|
@current_run += 1
|
40
40
|
@result = block.call
|
41
|
-
rescue => e
|
41
|
+
rescue StandardError => e
|
42
42
|
fail_attempt(e)
|
43
43
|
end
|
44
44
|
|
@@ -49,7 +49,7 @@ module Bundler
|
|
49
49
|
raise e
|
50
50
|
end
|
51
51
|
return true unless name
|
52
|
-
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
|
53
53
|
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
|
54
54
|
end
|
55
55
|
|
data/lib/bundler/ruby_dsl.rb
CHANGED
@@ -5,11 +5,17 @@ module Bundler
|
|
5
5
|
def ruby(*ruby_version)
|
6
6
|
options = ruby_version.last.is_a?(Hash) ? ruby_version.pop : {}
|
7
7
|
ruby_version.flatten!
|
8
|
+
|
8
9
|
raise GemfileError, "Please define :engine_version" if options[:engine] && options[:engine_version].nil?
|
9
10
|
raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
|
10
11
|
|
12
|
+
if options[:file]
|
13
|
+
raise GemfileError, "Cannot specify version when using the file option" if ruby_version.any?
|
14
|
+
ruby_version << Bundler.read_file(options[:file]).strip
|
15
|
+
end
|
16
|
+
|
11
17
|
if options[:engine] == "ruby" && options[:engine_version] &&
|
12
|
-
|
18
|
+
ruby_version != Array(options[:engine_version])
|
13
19
|
raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
|
14
20
|
end
|
15
21
|
@ruby_version = RubyVersion.new(ruby_version, options[:patchlevel], options[:engine], options[:engine_version])
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -28,16 +28,16 @@ module Bundler
|
|
28
28
|
end
|
29
29
|
|
30
30
|
@gem_version = Gem::Requirement.create(@versions.first).requirements.first.last
|
31
|
-
@input_engine = engine
|
32
|
-
@engine = engine
|
31
|
+
@input_engine = engine&.to_s
|
32
|
+
@engine = engine&.to_s || "ruby"
|
33
33
|
@engine_versions = (engine_version && Array(engine_version)) || @versions
|
34
34
|
@engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
|
35
|
-
@patchlevel = patchlevel
|
35
|
+
@patchlevel = patchlevel || (@gem_version.prerelease? ? "-1" : nil)
|
36
36
|
end
|
37
37
|
|
38
38
|
def to_s(versions = self.versions)
|
39
39
|
output = String.new("ruby #{versions_string(versions)}")
|
40
|
-
output << "p#{patchlevel}" if patchlevel
|
40
|
+
output << "p#{patchlevel}" if patchlevel && patchlevel != "-1"
|
41
41
|
output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
|
42
42
|
|
43
43
|
output
|
@@ -46,10 +46,10 @@ module Bundler
|
|
46
46
|
# @private
|
47
47
|
PATTERN = /
|
48
48
|
ruby\s
|
49
|
-
(
|
49
|
+
(\d+\.\d+\.\d+(?:\.\S+)?) # ruby version
|
50
50
|
(?:p(-?\d+))? # optional patchlevel
|
51
51
|
(?:\s\((\S+)\s(.+)\))? # optional engine info
|
52
|
-
/xo
|
52
|
+
/xo.freeze
|
53
53
|
|
54
54
|
# Returns a RubyVersion from the given string.
|
55
55
|
# @param [String] the version string to match.
|
@@ -74,7 +74,7 @@ module Bundler
|
|
74
74
|
@host ||= [
|
75
75
|
RbConfig::CONFIG["host_cpu"],
|
76
76
|
RbConfig::CONFIG["host_vendor"],
|
77
|
-
RbConfig::CONFIG["host_os"]
|
77
|
+
RbConfig::CONFIG["host_os"],
|
78
78
|
].join("-")
|
79
79
|
end
|
80
80
|
|
@@ -102,43 +102,15 @@ module Bundler
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def self.system
|
105
|
-
ruby_engine =
|
106
|
-
|
107
|
-
|
108
|
-
# not defined in ruby 1.8.7
|
109
|
-
"ruby"
|
110
|
-
end
|
111
|
-
# :sob: mocking RUBY_VERSION breaks stuff on 1.8.7
|
112
|
-
ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
|
113
|
-
ruby_engine_version = case ruby_engine
|
114
|
-
when "ruby"
|
115
|
-
ruby_version
|
116
|
-
when "rbx"
|
117
|
-
Rubinius::VERSION.dup
|
118
|
-
when "jruby"
|
119
|
-
JRUBY_VERSION.dup
|
120
|
-
else
|
121
|
-
RUBY_ENGINE_VERSION.dup
|
122
|
-
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
|
123
108
|
patchlevel = RUBY_PATCHLEVEL.to_s
|
124
109
|
|
125
|
-
@
|
126
|
-
end
|
127
|
-
|
128
|
-
def to_gem_version_with_patchlevel
|
129
|
-
@gem_version_with_patch ||= begin
|
130
|
-
Gem::Version.create("#{@gem_version}.#{@patchlevel}")
|
131
|
-
rescue ArgumentError
|
132
|
-
@gem_version
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
def exact?
|
137
|
-
return @exact if defined?(@exact)
|
138
|
-
@exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
|
110
|
+
@system ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
|
139
111
|
end
|
140
112
|
|
141
|
-
|
113
|
+
private
|
142
114
|
|
143
115
|
def matches?(requirements, version)
|
144
116
|
# Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -2,53 +2,51 @@
|
|
2
2
|
|
3
3
|
require "pathname"
|
4
4
|
|
5
|
-
if defined?(Gem::QuickLoader)
|
6
|
-
# Gem Prelude makes me a sad panda :'(
|
7
|
-
Gem::QuickLoader.load_full_rubygems_library
|
8
|
-
end
|
9
|
-
|
10
|
-
require "rubygems"
|
11
5
|
require "rubygems/specification"
|
12
6
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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))
|
20
29
|
end
|
21
30
|
|
22
|
-
require "bundler/match_platform"
|
23
|
-
|
24
31
|
module Gem
|
25
|
-
@loaded_stacks = Hash.new {|h, k| h[k] = [] }
|
26
|
-
|
27
32
|
class Specification
|
33
|
+
include ::Bundler::MatchMetadata
|
34
|
+
include ::Bundler::MatchPlatform
|
35
|
+
|
28
36
|
attr_accessor :remote, :location, :relative_loaded_from
|
29
37
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
(defined?(@source) && @source) || Gem::Source::Installed.new
|
35
|
-
end
|
36
|
-
else
|
37
|
-
attr_accessor :source
|
38
|
+
remove_method :source
|
39
|
+
attr_writer :source
|
40
|
+
def source
|
41
|
+
(defined?(@source) && @source) || Gem::Source::Installed.new
|
38
42
|
end
|
39
43
|
|
40
44
|
alias_method :rg_full_gem_path, :full_gem_path
|
41
45
|
alias_method :rg_loaded_from, :loaded_from
|
42
46
|
|
43
|
-
attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=)
|
44
|
-
|
45
47
|
def full_gem_path
|
46
|
-
|
47
|
-
|
48
|
-
# gems at that time, this method could be called inside another require,
|
49
|
-
# thus raising with that constant being undefined. Better to check a method
|
50
|
-
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
51
|
-
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" }
|
52
50
|
else
|
53
51
|
rg_full_gem_path
|
54
52
|
end
|
@@ -63,36 +61,43 @@ module Gem
|
|
63
61
|
end
|
64
62
|
|
65
63
|
def load_paths
|
66
|
-
|
67
|
-
|
68
|
-
require_paths.map do |require_path|
|
69
|
-
if require_path.include?(full_gem_path)
|
70
|
-
require_path
|
71
|
-
else
|
72
|
-
File.join(full_gem_path, require_path)
|
73
|
-
end
|
74
|
-
end
|
64
|
+
full_require_paths
|
75
65
|
end
|
76
66
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
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
|
85
76
|
end
|
86
77
|
end
|
87
78
|
|
88
|
-
|
89
|
-
methods = instance_methods(false)
|
90
|
-
gem_dir = methods.first.is_a?(String) ? "gem_dir" : :gem_dir
|
91
|
-
remove_method :gem_dir if methods.include?(gem_dir)
|
79
|
+
remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
|
92
80
|
def gem_dir
|
93
81
|
full_gem_path
|
94
82
|
end
|
95
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
|
+
|
96
101
|
def groups
|
97
102
|
@groups ||= []
|
98
103
|
end
|
@@ -112,11 +117,26 @@ module Gem
|
|
112
117
|
gemfile
|
113
118
|
end
|
114
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
|
+
|
115
131
|
def nondevelopment_dependencies
|
116
132
|
dependencies - development_dependencies
|
117
133
|
end
|
118
134
|
|
119
|
-
|
135
|
+
def deleted_gem?
|
136
|
+
!default_gem? && !File.directory?(full_gem_path)
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
120
140
|
|
121
141
|
def dependencies_to_gemfile(dependencies, group = nil)
|
122
142
|
gemfile = String.new
|
@@ -136,10 +156,18 @@ module Gem
|
|
136
156
|
end
|
137
157
|
|
138
158
|
class Dependency
|
139
|
-
|
159
|
+
include ::Bundler::ForcePlatform
|
160
|
+
|
161
|
+
attr_accessor :source, :groups
|
140
162
|
|
141
163
|
alias_method :eql?, :==
|
142
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
|
+
|
143
171
|
def encode_with(coder)
|
144
172
|
to_yaml_properties.each do |ivar|
|
145
173
|
coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
|
@@ -147,7 +175,7 @@ module Gem
|
|
147
175
|
end
|
148
176
|
|
149
177
|
def to_yaml_properties
|
150
|
-
instance_variables.reject {|p| ["@source", "@groups"
|
178
|
+
instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
|
151
179
|
end
|
152
180
|
|
153
181
|
def to_lock
|
@@ -158,53 +186,170 @@ module Gem
|
|
158
186
|
end
|
159
187
|
out
|
160
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
|
161
206
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
207
|
+
def _requirements_sorted?
|
208
|
+
return @_requirements_sorted if defined?(@_requirements_sorted)
|
209
|
+
strings = as_list
|
210
|
+
@_requirements_sorted = strings == strings.sort
|
211
|
+
end
|
167
212
|
|
168
|
-
|
169
|
-
|
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
|
170
220
|
end
|
171
221
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
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
|
187
236
|
end
|
188
237
|
|
238
|
+
require "rubygems/platform"
|
239
|
+
|
189
240
|
class Platform
|
190
|
-
JAVA = Gem::Platform.new("java")
|
191
|
-
MSWIN = Gem::Platform.new("mswin32")
|
192
|
-
MSWIN64 = Gem::Platform.new("mswin64")
|
193
|
-
MINGW = Gem::Platform.new("x86-mingw32")
|
194
|
-
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
|
195
275
|
|
196
|
-
|
197
|
-
|
198
|
-
|
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
|
199
286
|
end
|
200
287
|
|
201
|
-
|
202
|
-
|
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
|
203
291
|
end
|
204
|
-
end
|
205
292
|
|
206
|
-
|
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.
|
207
323
|
class Specification
|
208
|
-
|
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
|
209
354
|
end
|
210
355
|
end
|