bundler 2.2.29 → 2.5.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1129 -4
- data/README.md +4 -8
- data/bundler.gemspec +11 -11
- data/exe/bundle +5 -26
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +4 -4
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/checksum.rb +254 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +4 -4
- data/lib/bundler/cli/binstubs.rb +10 -6
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +3 -3
- data/lib/bundler/cli/common.rb +13 -3
- data/lib/bundler/cli/config.rb +18 -8
- data/lib/bundler/cli/console.rb +5 -4
- data/lib/bundler/cli/doctor.rb +12 -5
- data/lib/bundler/cli/exec.rb +1 -1
- data/lib/bundler/cli/fund.rb +1 -1
- data/lib/bundler/cli/gem.rb +141 -48
- data/lib/bundler/cli/info.rb +27 -17
- data/lib/bundler/cli/init.rb +6 -2
- data/lib/bundler/cli/install.rb +22 -39
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/lock.rb +36 -29
- data/lib/bundler/cli/open.rb +9 -9
- data/lib/bundler/cli/outdated.rb +19 -12
- data/lib/bundler/cli/platform.rb +8 -6
- data/lib/bundler/cli/plugin.rb +9 -15
- data/lib/bundler/cli/pristine.rb +38 -30
- data/lib/bundler/cli/show.rb +3 -3
- data/lib/bundler/cli/update.rb +12 -7
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +266 -285
- data/lib/bundler/compact_index_client/cache.rb +53 -67
- data/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +7 -3
- data/lib/bundler/compact_index_client/parser.rb +84 -0
- data/lib/bundler/compact_index_client/updater.rb +83 -76
- data/lib/bundler/compact_index_client.rb +59 -87
- data/lib/bundler/constants.rb +9 -2
- data/lib/bundler/current_ruby.rb +12 -16
- data/lib/bundler/definition.rb +509 -319
- data/lib/bundler/dependency.rb +33 -71
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +88 -69
- data/lib/bundler/endpoint_specification.rb +32 -15
- data/lib/bundler/env.rb +5 -7
- data/lib/bundler/environment_preserver.rb +8 -22
- data/lib/bundler/errors.rb +101 -13
- data/lib/bundler/feature_flag.rb +0 -2
- data/lib/bundler/fetcher/base.rb +11 -11
- data/lib/bundler/fetcher/compact_index.rb +32 -52
- data/lib/bundler/fetcher/dependency.rb +3 -7
- data/lib/bundler/fetcher/downloader.rb +17 -16
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +2 -29
- data/lib/bundler/fetcher.rb +87 -79
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +29 -40
- data/lib/bundler/gem_helper.rb +11 -23
- data/lib/bundler/gem_helpers.rb +30 -6
- data/lib/bundler/gem_version_promoter.rb +68 -109
- data/lib/bundler/graph.rb +9 -9
- data/lib/bundler/index.rb +71 -79
- data/lib/bundler/injector.rb +23 -11
- data/lib/bundler/inline.rb +11 -23
- data/lib/bundler/installer/gem_installer.rb +18 -11
- data/lib/bundler/installer/parallel_installer.rb +17 -65
- data/lib/bundler/installer/standalone.rb +56 -15
- data/lib/bundler/installer.rb +35 -61
- data/lib/bundler/lazy_specification.rb +92 -61
- data/lib/bundler/lockfile_generator.rb +12 -3
- data/lib/bundler/lockfile_parser.rb +137 -70
- data/lib/bundler/man/bundle-add.1 +19 -26
- data/lib/bundler/man/bundle-add.1.ronn +16 -4
- data/lib/bundler/man/bundle-binstubs.1 +4 -16
- data/lib/bundler/man/bundle-cache.1 +9 -24
- data/lib/bundler/man/bundle-cache.1.ronn +9 -2
- data/lib/bundler/man/bundle-check.1 +5 -12
- data/lib/bundler/man/bundle-check.1.ronn +3 -0
- data/lib/bundler/man/bundle-clean.1 +4 -11
- data/lib/bundler/man/bundle-clean.1.ronn +1 -1
- data/lib/bundler/man/bundle-config.1 +47 -224
- data/lib/bundler/man/bundle-config.1.ronn +40 -28
- data/lib/bundler/man/bundle-console.1 +35 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/lib/bundler/man/bundle-doctor.1 +4 -18
- data/lib/bundler/man/bundle-exec.1 +16 -77
- data/lib/bundler/man/bundle-exec.1.ronn +8 -9
- data/lib/bundler/man/bundle-gem.1 +45 -72
- data/lib/bundler/man/bundle-gem.1.ronn +32 -5
- data/lib/bundler/man/bundle-help.1 +9 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +5 -11
- data/lib/bundler/man/bundle-info.1.ronn +3 -3
- data/lib/bundler/man/bundle-init.1 +6 -11
- data/lib/bundler/man/bundle-init.1.ronn +2 -0
- data/lib/bundler/man/bundle-inject.1 +8 -18
- data/lib/bundler/man/bundle-inject.1.ronn +3 -1
- data/lib/bundler/man/bundle-install.1 +32 -155
- data/lib/bundler/man/bundle-install.1.ronn +11 -33
- data/lib/bundler/man/bundle-list.1 +4 -19
- data/lib/bundler/man/bundle-lock.1 +5 -29
- data/lib/bundler/man/bundle-open.1 +18 -18
- data/lib/bundler/man/bundle-open.1.ronn +9 -1
- data/lib/bundler/man/bundle-outdated.1 +17 -72
- data/lib/bundler/man/bundle-outdated.1.ronn +13 -18
- data/lib/bundler/man/bundle-platform.1 +16 -28
- data/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/lib/bundler/man/bundle-plugin.1 +58 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +63 -0
- data/lib/bundler/man/bundle-pristine.1 +5 -16
- data/lib/bundler/man/bundle-remove.1 +4 -14
- data/lib/bundler/man/bundle-show.1 +3 -10
- data/lib/bundler/man/bundle-update.1 +19 -138
- data/lib/bundler/man/bundle-update.1.ronn +2 -1
- data/lib/bundler/man/bundle-version.1 +22 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/lib/bundler/man/bundle-viz.1 +6 -15
- data/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/lib/bundler/man/bundle.1 +17 -51
- data/lib/bundler/man/bundle.1.ronn +12 -7
- data/lib/bundler/man/gemfile.5 +130 -346
- data/lib/bundler/man/gemfile.5.ronn +121 -86
- data/lib/bundler/man/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +17 -0
- data/lib/bundler/match_platform.rb +1 -2
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +8 -10
- data/lib/bundler/plugin/api/source.rb +9 -13
- data/lib/bundler/plugin/index.rb +13 -5
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/path.rb +18 -0
- data/lib/bundler/plugin/installer/rubygems.rb +0 -8
- data/lib/bundler/plugin/installer.rb +42 -19
- data/lib/bundler/plugin/source_list.rb +4 -4
- data/lib/bundler/plugin.rb +16 -7
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +11 -5
- data/lib/bundler/resolver/base.rb +111 -0
- data/lib/bundler/resolver/candidate.rb +82 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +81 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +53 -66
- data/lib/bundler/resolver.rb +419 -307
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +42 -7
- data/lib/bundler/ruby_version.rb +16 -22
- data/lib/bundler/rubygems_ext.rb +250 -64
- data/lib/bundler/rubygems_gem_installer.rb +90 -64
- data/lib/bundler/rubygems_integration.rb +81 -190
- data/lib/bundler/runtime.rb +8 -13
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +206 -0
- data/lib/bundler/settings.rb +139 -57
- data/lib/bundler/setup.rb +13 -1
- data/lib/bundler/shared_helpers.rb +67 -36
- data/lib/bundler/source/git/git_proxy.rb +285 -82
- data/lib/bundler/source/git.rb +81 -41
- data/lib/bundler/source/metadata.rb +17 -16
- data/lib/bundler/source/path/installer.rb +1 -22
- data/lib/bundler/source/path.rb +13 -25
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +164 -234
- data/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/lib/bundler/source.rb +7 -6
- data/lib/bundler/source_list.rb +40 -32
- data/lib/bundler/source_map.rb +15 -2
- data/lib/bundler/spec_set.rb +156 -46
- data/lib/bundler/stub_specification.rb +18 -5
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +7 -12
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -2
- data/lib/bundler/templates/newgem/README.md.tt +7 -11
- data/lib/bundler/templates/newgem/Rakefile.tt +28 -4
- data/lib/bundler/templates/newgem/bin/console.tt +0 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -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 +13 -3
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +13 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +25 -17
- data/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +38 -15
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/uri_credentials_filter.rb +2 -2
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +92 -78
- data/lib/bundler/vendor/fileutils/.document +1 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1340 -410
- data/lib/bundler/vendor/net-http-persistent/.document +1 -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 +4 -3
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +23 -11
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +57 -57
- data/lib/bundler/vendor/pub_grub/.document +1 -0
- 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 +61 -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/.document +1 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +12 -14
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +16 -6
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +21 -17
- data/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
- data/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +10 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +16 -20
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +20 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +27 -8
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +63 -7
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +48 -154
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -46
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +0 -45
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/util.rb +9 -8
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +155 -8
- data/lib/bundler/vendor/tsort/.document +1 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/lib/bundler/vendor/uri/.document +1 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +316 -207
- data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +33 -13
- data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
- data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -23
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +105 -47
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +3 -3
- data/lib/bundler/vendored_net_http.rb +23 -0
- data/lib/bundler/vendored_persistent.rb +0 -36
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_timeout.rb +12 -0
- data/lib/bundler/{vendored_tmpdir.rb → vendored_tsort.rb} +1 -1
- data/lib/bundler/vendored_uri.rb +18 -1
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/worker.rb +7 -9
- data/lib/bundler/yaml_serializer.rb +21 -12
- data/lib/bundler.rb +114 -121
- metadata +87 -41
- data/lib/bundler/dep_proxy.rb +0 -55
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -22
- data/lib/bundler/templates/gems.rb +0 -8
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -5
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
- 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 -164
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
- 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 -112
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
- 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 -11
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
- data/lib/bundler/version_ranges.rb +0 -122
data/lib/bundler/retry.rb
CHANGED
data/lib/bundler/ruby_dsl.rb
CHANGED
@@ -3,16 +3,51 @@
|
|
3
3
|
module Bundler
|
4
4
|
module RubyDsl
|
5
5
|
def ruby(*ruby_version)
|
6
|
-
options = ruby_version.last.is_a?(Hash)
|
6
|
+
options = ruby_version.pop if ruby_version.last.is_a?(Hash)
|
7
7
|
ruby_version.flatten!
|
8
|
-
raise GemfileError, "Please define :engine_version" if options[:engine] && options[:engine_version].nil?
|
9
|
-
raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
|
10
8
|
|
11
|
-
if options
|
12
|
-
|
13
|
-
|
9
|
+
if options
|
10
|
+
patchlevel = options[:patchlevel]
|
11
|
+
engine = options[:engine]
|
12
|
+
engine_version = options[:engine_version]
|
13
|
+
|
14
|
+
raise GemfileError, "Please define :engine_version" if engine && engine_version.nil?
|
15
|
+
raise GemfileError, "Please define :engine" if engine_version && engine.nil?
|
16
|
+
|
17
|
+
if options[:file]
|
18
|
+
raise GemfileError, "Do not pass version argument when using :file option" unless ruby_version.empty?
|
19
|
+
ruby_version << normalize_ruby_file(options[:file])
|
20
|
+
end
|
21
|
+
|
22
|
+
if engine == "ruby" && engine_version && ruby_version != Array(engine_version)
|
23
|
+
raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
@ruby_version = RubyVersion.new(ruby_version, patchlevel, engine, engine_version)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Support the various file formats found in .ruby-version files.
|
31
|
+
#
|
32
|
+
# 3.2.2
|
33
|
+
# ruby-3.2.2
|
34
|
+
#
|
35
|
+
# Also supports .tool-versions files for asdf. Lines not starting with "ruby" are ignored.
|
36
|
+
#
|
37
|
+
# ruby 2.5.1 # comment is ignored
|
38
|
+
# ruby 2.5.1# close comment and extra spaces doesn't confuse
|
39
|
+
#
|
40
|
+
# Intentionally does not support `3.2.1@gemset` since rvm recommends using .ruby-gemset instead
|
41
|
+
#
|
42
|
+
# Loads the file relative to the dirname of the Gemfile itself.
|
43
|
+
def normalize_ruby_file(filename)
|
44
|
+
file_content = Bundler.read_file(gemfile.dirname.join(filename))
|
45
|
+
# match "ruby-3.2.2" or "ruby 3.2.2" capturing version string up to the first space or comment
|
46
|
+
if /^ruby(-|\s+)([^\s#]+)/.match(file_content)
|
47
|
+
$2
|
48
|
+
else
|
49
|
+
file_content.strip
|
14
50
|
end
|
15
|
-
@ruby_version = RubyVersion.new(ruby_version, options[:patchlevel], options[:engine], options[:engine_version])
|
16
51
|
end
|
17
52
|
end
|
18
53
|
end
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -23,21 +23,21 @@ module Bundler
|
|
23
23
|
# specified must match the version.
|
24
24
|
|
25
25
|
@versions = Array(versions).map do |v|
|
26
|
-
op, v = Gem::Requirement.parse(v)
|
26
|
+
op, v = Gem::Requirement.parse(normalize_version(v))
|
27
27
|
op == "=" ? v.to_s : "#{op} #{v}"
|
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
|
53
53
|
|
54
54
|
# Returns a RubyVersion from the given string.
|
55
55
|
# @param [String] the version string to match.
|
@@ -103,28 +103,22 @@ module Bundler
|
|
103
103
|
|
104
104
|
def self.system
|
105
105
|
ruby_engine = RUBY_ENGINE.dup
|
106
|
-
ruby_version =
|
107
|
-
ruby_engine_version = RUBY_ENGINE_VERSION.dup
|
106
|
+
ruby_version = Gem.ruby_version.to_s
|
107
|
+
ruby_engine_version = RUBY_ENGINE == "ruby" ? ruby_version : RUBY_ENGINE_VERSION.dup
|
108
108
|
patchlevel = RUBY_PATCHLEVEL.to_s
|
109
109
|
|
110
|
-
@
|
110
|
+
@system ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
|
111
111
|
end
|
112
112
|
|
113
|
-
|
114
|
-
@gem_version_with_patch ||= begin
|
115
|
-
Gem::Version.create("#{@gem_version}.#{@patchlevel}")
|
116
|
-
rescue ArgumentError
|
117
|
-
@gem_version
|
118
|
-
end
|
119
|
-
end
|
113
|
+
private
|
120
114
|
|
121
|
-
|
122
|
-
|
123
|
-
|
115
|
+
# Ruby's official preview version format uses a `-`: Example: 3.3.0-preview2
|
116
|
+
# However, RubyGems recognizes preview version format with a `.`: Example: 3.3.0.preview2
|
117
|
+
# Returns version string after replacing `-` with `.`
|
118
|
+
def normalize_version(version)
|
119
|
+
version.tr("-", ".")
|
124
120
|
end
|
125
121
|
|
126
|
-
private
|
127
|
-
|
128
122
|
def matches?(requirements, version)
|
129
123
|
# Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head
|
130
124
|
return requirements == version if requirements.to_s == "-1" || version.to_s == "-1"
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -1,17 +1,77 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
#
|
8
|
-
#
|
3
|
+
require "rubygems" unless defined?(Gem)
|
4
|
+
|
5
|
+
# We can't let `Gem::Source` be autoloaded in the `Gem::Specification#source`
|
6
|
+
# redefinition below, so we need to load it upfront. The reason is that if
|
7
|
+
# Bundler monkeypatches are loaded before RubyGems activates an executable (for
|
8
|
+
# example, through `ruby -rbundler -S irb`), gem activation might end up calling
|
9
|
+
# the redefined `Gem::Specification#source` and triggering the `Gem::Source`
|
10
|
+
# autoload. That would result in requiring "rubygems/source" inside another
|
11
|
+
# require, which would trigger a monitor error and cause the `autoload` to
|
12
|
+
# eventually fail. A better solution is probably to completely avoid autoloading
|
13
|
+
# `Gem::Source` from the redefined `Gem::Specification#source`.
|
9
14
|
require "rubygems/source"
|
10
15
|
|
11
|
-
|
16
|
+
# Cherry-pick fixes to `Gem.ruby_version` to be useful for modern Bundler
|
17
|
+
# versions and ignore patchlevels
|
18
|
+
# (https://github.com/rubygems/rubygems/pull/5472,
|
19
|
+
# https://github.com/rubygems/rubygems/pull/5486). May be removed once RubyGems
|
20
|
+
# 3.3.12 support is dropped.
|
21
|
+
unless Gem.ruby_version.to_s == RUBY_VERSION || RUBY_PATCHLEVEL == -1
|
22
|
+
Gem.instance_variable_set(:@ruby_version, Gem::Version.new(RUBY_VERSION))
|
23
|
+
end
|
12
24
|
|
13
25
|
module Gem
|
26
|
+
# Can be removed once RubyGems 3.5.11 support is dropped
|
27
|
+
unless Gem.respond_to?(:freebsd_platform?)
|
28
|
+
def self.freebsd_platform?
|
29
|
+
RbConfig::CONFIG["host_os"].to_s.include?("bsd")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Can be removed once RubyGems 3.5.14 support is dropped
|
34
|
+
unless Gem.respond_to?(:open_file_with_flock)
|
35
|
+
def self.open_file_with_flock(path, &block)
|
36
|
+
flags = File.exist?(path) ? "r+" : "a+"
|
37
|
+
|
38
|
+
File.open(path, flags) do |io|
|
39
|
+
begin
|
40
|
+
io.flock(File::LOCK_EX)
|
41
|
+
rescue Errno::ENOSYS, Errno::ENOTSUP
|
42
|
+
end
|
43
|
+
yield io
|
44
|
+
rescue Errno::ENOLCK # NFS
|
45
|
+
if Thread.main != Thread.current
|
46
|
+
raise
|
47
|
+
else
|
48
|
+
File.open(path, flags, &block)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
require "rubygems/specification"
|
55
|
+
|
56
|
+
# Can be removed once RubyGems 3.5.14 support is dropped
|
57
|
+
VALIDATES_FOR_RESOLUTION = Specification.new.respond_to?(:validate_for_resolution).freeze
|
58
|
+
|
59
|
+
# Can be removed once RubyGems 3.3.15 support is dropped
|
60
|
+
FLATTENS_REQUIRED_PATHS = Specification.new.respond_to?(:flatten_require_paths).freeze
|
61
|
+
|
14
62
|
class Specification
|
63
|
+
# Can be removed once RubyGems 3.5.15 support is dropped
|
64
|
+
correct_array_attributes = @@default_value.select {|_k,v| v.is_a?(Array) }.keys
|
65
|
+
unless @@array_attributes == correct_array_attributes
|
66
|
+
@@array_attributes = correct_array_attributes # rubocop:disable Style/ClassVars
|
67
|
+
end
|
68
|
+
|
69
|
+
require_relative "match_metadata"
|
70
|
+
require_relative "match_platform"
|
71
|
+
|
72
|
+
include ::Bundler::MatchMetadata
|
73
|
+
include ::Bundler::MatchPlatform
|
74
|
+
|
15
75
|
attr_accessor :remote, :location, :relative_loaded_from
|
16
76
|
|
17
77
|
remove_method :source
|
@@ -24,12 +84,8 @@ module Gem
|
|
24
84
|
alias_method :rg_loaded_from, :loaded_from
|
25
85
|
|
26
86
|
def full_gem_path
|
27
|
-
|
28
|
-
|
29
|
-
# gems at that time, this method could be called inside another require,
|
30
|
-
# thus raising with that constant being undefined. Better to check a method
|
31
|
-
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
32
|
-
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
87
|
+
if source.respond_to?(:root)
|
88
|
+
File.expand_path(File.dirname(loaded_from), source.root)
|
33
89
|
else
|
34
90
|
rg_full_gem_path
|
35
91
|
end
|
@@ -49,7 +105,9 @@ module Gem
|
|
49
105
|
|
50
106
|
alias_method :rg_extension_dir, :extension_dir
|
51
107
|
def extension_dir
|
52
|
-
|
108
|
+
# following instance variable is already used in original method
|
109
|
+
# and that is the reason to prefix it with bundler_ and add rubocop exception
|
110
|
+
@bundler_extension_dir ||= if source.respond_to?(:extension_dir_name) # rubocop:disable Naming/MemoizedInstanceVariableName
|
53
111
|
unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
|
54
112
|
File.expand_path(File.join(extensions_dir, unique_extension_dir))
|
55
113
|
else
|
@@ -57,11 +115,28 @@ module Gem
|
|
57
115
|
end
|
58
116
|
end
|
59
117
|
|
60
|
-
remove_method :gem_dir
|
118
|
+
remove_method :gem_dir
|
61
119
|
def gem_dir
|
62
120
|
full_gem_path
|
63
121
|
end
|
64
122
|
|
123
|
+
unless const_defined?(:LATEST_RUBY_WITHOUT_PATCH_VERSIONS)
|
124
|
+
LATEST_RUBY_WITHOUT_PATCH_VERSIONS = Gem::Version.new("2.1")
|
125
|
+
|
126
|
+
alias_method :rg_required_ruby_version=, :required_ruby_version=
|
127
|
+
def required_ruby_version=(req)
|
128
|
+
self.rg_required_ruby_version = req
|
129
|
+
|
130
|
+
@required_ruby_version.requirements.map! do |op, v|
|
131
|
+
if v >= LATEST_RUBY_WITHOUT_PATCH_VERSIONS && v.release.segments.size == 4
|
132
|
+
[op == "~>" ? "=" : op, Gem::Version.new(v.segments.tap {|s| s.delete_at(3) }.join("."))]
|
133
|
+
else
|
134
|
+
[op, v]
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
65
140
|
def groups
|
66
141
|
@groups ||= []
|
67
142
|
end
|
@@ -85,6 +160,37 @@ module Gem
|
|
85
160
|
dependencies - development_dependencies
|
86
161
|
end
|
87
162
|
|
163
|
+
def deleted_gem?
|
164
|
+
!default_gem? && !File.directory?(full_gem_path)
|
165
|
+
end
|
166
|
+
|
167
|
+
unless VALIDATES_FOR_RESOLUTION
|
168
|
+
def validate_for_resolution
|
169
|
+
SpecificationPolicy.new(self).validate_for_resolution
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
unless FLATTENS_REQUIRED_PATHS
|
174
|
+
def flatten_require_paths
|
175
|
+
return unless raw_require_paths.first.is_a?(Array)
|
176
|
+
|
177
|
+
warn "#{name} #{version} includes a gemspec with `require_paths` set to an array of arrays. Newer versions of this gem might've already fixed this"
|
178
|
+
raw_require_paths.flatten!
|
179
|
+
end
|
180
|
+
|
181
|
+
class << self
|
182
|
+
module RequirePathFlattener
|
183
|
+
def from_yaml(input)
|
184
|
+
spec = super(input)
|
185
|
+
spec.flatten_require_paths
|
186
|
+
spec
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
prepend RequirePathFlattener
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
88
194
|
private
|
89
195
|
|
90
196
|
def dependencies_to_gemfile(dependencies, group = nil)
|
@@ -104,11 +210,43 @@ module Gem
|
|
104
210
|
end
|
105
211
|
end
|
106
212
|
|
213
|
+
unless VALIDATES_FOR_RESOLUTION
|
214
|
+
class SpecificationPolicy
|
215
|
+
def validate_for_resolution
|
216
|
+
validate_required!
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
module BetterPermissionError
|
222
|
+
def data
|
223
|
+
super
|
224
|
+
rescue Errno::EACCES
|
225
|
+
raise Bundler::PermissionError.new(loaded_from, :read)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
require "rubygems/stub_specification"
|
230
|
+
|
231
|
+
class StubSpecification
|
232
|
+
prepend BetterPermissionError
|
233
|
+
end
|
234
|
+
|
107
235
|
class Dependency
|
236
|
+
require_relative "force_platform"
|
237
|
+
|
238
|
+
include ::Bundler::ForcePlatform
|
239
|
+
|
108
240
|
attr_accessor :source, :groups
|
109
241
|
|
110
242
|
alias_method :eql?, :==
|
111
243
|
|
244
|
+
def force_ruby_platform
|
245
|
+
return @force_ruby_platform if defined?(@force_ruby_platform) && !@force_ruby_platform.nil?
|
246
|
+
|
247
|
+
@force_ruby_platform = default_force_ruby_platform
|
248
|
+
end
|
249
|
+
|
112
250
|
def encode_with(coder)
|
113
251
|
to_yaml_properties.each do |ivar|
|
114
252
|
coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
|
@@ -129,35 +267,7 @@ module Gem
|
|
129
267
|
end
|
130
268
|
end
|
131
269
|
|
132
|
-
#
|
133
|
-
unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
|
134
|
-
class Requirement
|
135
|
-
module OrderIndependentComparison
|
136
|
-
def ==(other)
|
137
|
-
if _requirements_sorted? && other._requirements_sorted?
|
138
|
-
super
|
139
|
-
else
|
140
|
-
_with_sorted_requirements == other._with_sorted_requirements
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
protected
|
145
|
-
|
146
|
-
def _requirements_sorted?
|
147
|
-
return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
|
148
|
-
strings = as_list
|
149
|
-
@_are_requirements_sorted = strings == strings.sort
|
150
|
-
end
|
151
|
-
|
152
|
-
def _with_sorted_requirements
|
153
|
-
@_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
prepend OrderIndependentComparison
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
270
|
+
# Requirements using lambda operator differentiate trailing zeros since rubygems 3.2.6
|
161
271
|
if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
|
162
272
|
class Requirement
|
163
273
|
module CorrectHashForLambdaOperator
|
@@ -177,11 +287,56 @@ module Gem
|
|
177
287
|
require "rubygems/platform"
|
178
288
|
|
179
289
|
class Platform
|
180
|
-
JAVA = Gem::Platform.new("java")
|
181
|
-
MSWIN = Gem::Platform.new("mswin32")
|
182
|
-
MSWIN64 = Gem::Platform.new("mswin64")
|
183
|
-
MINGW = Gem::Platform.new("x86-mingw32")
|
184
|
-
X64_MINGW = Gem::Platform.new("x64-mingw32")
|
290
|
+
JAVA = Gem::Platform.new("java")
|
291
|
+
MSWIN = Gem::Platform.new("mswin32")
|
292
|
+
MSWIN64 = Gem::Platform.new("mswin64")
|
293
|
+
MINGW = Gem::Platform.new("x86-mingw32")
|
294
|
+
X64_MINGW = [Gem::Platform.new("x64-mingw32"),
|
295
|
+
Gem::Platform.new("x64-mingw-ucrt")].freeze
|
296
|
+
WINDOWS = [MSWIN, MSWIN64, MINGW, X64_MINGW].flatten.freeze
|
297
|
+
X64_LINUX = Gem::Platform.new("x86_64-linux")
|
298
|
+
X64_LINUX_MUSL = Gem::Platform.new("x86_64-linux-musl")
|
299
|
+
|
300
|
+
if X64_LINUX === X64_LINUX_MUSL
|
301
|
+
remove_method :===
|
302
|
+
|
303
|
+
def ===(other)
|
304
|
+
return nil unless Gem::Platform === other
|
305
|
+
|
306
|
+
# universal-mingw32 matches x64-mingw-ucrt
|
307
|
+
return true if (@cpu == "universal" || other.cpu == "universal") &&
|
308
|
+
@os.start_with?("mingw") && other.os.start_with?("mingw")
|
309
|
+
|
310
|
+
# cpu
|
311
|
+
([nil,"universal"].include?(@cpu) || [nil, "universal"].include?(other.cpu) || @cpu == other.cpu ||
|
312
|
+
(@cpu == "arm" && other.cpu.start_with?("armv"))) &&
|
313
|
+
|
314
|
+
# os
|
315
|
+
@os == other.os &&
|
316
|
+
|
317
|
+
# version
|
318
|
+
(
|
319
|
+
(@os != "linux" && (@version.nil? || other.version.nil?)) ||
|
320
|
+
(@os == "linux" && (normalized_linux_version_ext == other.normalized_linux_version_ext || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) ||
|
321
|
+
@version == other.version
|
322
|
+
)
|
323
|
+
end
|
324
|
+
|
325
|
+
# This is a copy of RubyGems 3.3.23 or higher `normalized_linux_method`.
|
326
|
+
# Once only 3.3.23 is supported, we can use the method in RubyGems.
|
327
|
+
def normalized_linux_version_ext
|
328
|
+
return nil unless @version
|
329
|
+
|
330
|
+
without_gnu_nor_abi_modifiers = @version.sub(/\Agnu/, "").sub(/eabi(hf)?\Z/, "")
|
331
|
+
return nil if without_gnu_nor_abi_modifiers.empty?
|
332
|
+
|
333
|
+
without_gnu_nor_abi_modifiers
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
if RUBY_ENGINE == "truffleruby" && !defined?(REUSE_AS_BINARY_ON_TRUFFLERUBY)
|
338
|
+
REUSE_AS_BINARY_ON_TRUFFLERUBY = %w[libv8 libv8-node sorbet-static].freeze
|
339
|
+
end
|
185
340
|
end
|
186
341
|
|
187
342
|
Platform.singleton_class.module_eval do
|
@@ -193,38 +348,69 @@ module Gem
|
|
193
348
|
def match_gem?(platform, gem_name)
|
194
349
|
match_platforms?(platform, Gem.platforms)
|
195
350
|
end
|
351
|
+
end
|
352
|
+
|
353
|
+
match_platforms_defined = Gem::Platform.respond_to?(:match_platforms?, true)
|
354
|
+
|
355
|
+
if !match_platforms_defined || Gem::Platform.send(:match_platforms?, Gem::Platform::X64_LINUX_MUSL, [Gem::Platform::X64_LINUX])
|
196
356
|
|
197
357
|
private
|
198
358
|
|
359
|
+
remove_method :match_platforms? if match_platforms_defined
|
360
|
+
|
199
361
|
def match_platforms?(platform, platforms)
|
200
362
|
platforms.any? do |local_platform|
|
201
363
|
platform.nil? ||
|
202
364
|
local_platform == platform ||
|
203
|
-
(local_platform != Gem::Platform::RUBY &&
|
365
|
+
(local_platform != Gem::Platform::RUBY && platform =~ local_platform)
|
204
366
|
end
|
205
367
|
end
|
206
368
|
end
|
207
369
|
end
|
208
370
|
|
209
|
-
|
371
|
+
# On universal Rubies, resolve the "universal" arch to the real CPU arch, without changing the extension directory.
|
372
|
+
class BasicSpecification
|
373
|
+
if /^universal\.(?<arch>.*?)-/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
|
374
|
+
local_platform = Platform.local
|
375
|
+
if local_platform.cpu == "universal"
|
376
|
+
ORIGINAL_LOCAL_PLATFORM = local_platform.to_s.freeze
|
377
|
+
|
378
|
+
local_platform.cpu = if arch == "arm64e" # arm64e is only permitted for Apple system binaries
|
379
|
+
"arm64"
|
380
|
+
else
|
381
|
+
arch
|
382
|
+
end
|
210
383
|
|
211
|
-
|
212
|
-
|
213
|
-
|
384
|
+
def extensions_dir
|
385
|
+
@extensions_dir ||=
|
386
|
+
Gem.default_ext_dir_for(base_dir) || File.join(base_dir, "extensions", ORIGINAL_LOCAL_PLATFORM, Gem.extension_api_version)
|
387
|
+
end
|
388
|
+
end
|
214
389
|
end
|
390
|
+
end
|
215
391
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
392
|
+
require "rubygems/name_tuple"
|
393
|
+
|
394
|
+
class NameTuple
|
395
|
+
# Versions of RubyGems before about 3.5.0 don't to_s the platform.
|
396
|
+
unless Gem::NameTuple.new("a", Gem::Version.new("1"), Gem::Platform.new("x86_64-linux")).platform.is_a?(String)
|
397
|
+
alias_method :initialize_with_platform, :initialize
|
398
|
+
|
399
|
+
def initialize(name, version, platform=Gem::Platform::RUBY)
|
400
|
+
if Gem::Platform === platform
|
401
|
+
initialize_with_platform(name, version, platform.to_s)
|
402
|
+
else
|
403
|
+
initialize_with_platform(name, version, platform)
|
404
|
+
end
|
221
405
|
end
|
222
406
|
end
|
223
|
-
end
|
224
|
-
end
|
225
407
|
|
226
|
-
|
227
|
-
|
228
|
-
|
408
|
+
def lock_name
|
409
|
+
if platform == Gem::Platform::RUBY
|
410
|
+
"#{name} (#{version})"
|
411
|
+
else
|
412
|
+
"#{name} (#{version}-#{platform})"
|
413
|
+
end
|
414
|
+
end
|
229
415
|
end
|
230
416
|
end
|