bundler 2.2.29 → 2.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -15,23 +15,28 @@ directory as the `Rakefile`.
|
|
15
15
|
A `Gemfile` is evaluated as Ruby code, in a context which makes available
|
16
16
|
a number of methods used to describe the gem requirements.
|
17
17
|
|
18
|
-
## GLOBAL
|
18
|
+
## GLOBAL SOURCE
|
19
19
|
|
20
|
-
At the top of the `Gemfile`, add a line for the `
|
21
|
-
the gems listed in the `Gemfile`.
|
20
|
+
At the top of the `Gemfile`, add a single line for the `RubyGems` source that
|
21
|
+
contains the gems listed in the `Gemfile`.
|
22
22
|
|
23
23
|
source "https://rubygems.org"
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
You can add only one global source. In Bundler 1.13, adding multiple global
|
26
|
+
sources was deprecated. The `source` `MUST` be a valid RubyGems repository.
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
To use more than one source of RubyGems, you should use [`source` block
|
29
|
+
](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
|
30
|
+
|
31
|
+
A source is checked for gems following the heuristics described in
|
32
|
+
[SOURCE PRIORITY][].
|
33
|
+
|
34
|
+
**Note about a behavior of the feature deprecated in Bundler 1.13**:
|
35
|
+
If a gem is found in more than one global source, Bundler
|
30
36
|
will print a warning after installing the gem indicating which source was used,
|
31
37
|
and listing the other sources where the gem is available. A specific source can
|
32
38
|
be selected for gems that need to use a non-standard repository, suppressing
|
33
|
-
this warning, by using the [`:source` option](#SOURCE) or
|
34
|
-
[`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
|
39
|
+
this warning, by using the [`:source` option](#SOURCE) or `source` block.
|
35
40
|
|
36
41
|
### CREDENTIALS
|
37
42
|
|
@@ -59,10 +64,20 @@ All parameters are `OPTIONAL` unless otherwise specified.
|
|
59
64
|
### VERSION (required)
|
60
65
|
|
61
66
|
The version of Ruby that your application requires. If your application
|
62
|
-
requires an alternate Ruby engine, such as JRuby,
|
67
|
+
requires an alternate Ruby engine, such as JRuby, TruffleRuby, etc., this
|
63
68
|
should be the Ruby version that the engine is compatible with.
|
64
69
|
|
65
|
-
ruby "1.
|
70
|
+
ruby "3.1.2"
|
71
|
+
|
72
|
+
If you wish to derive your Ruby version from a version file (ie .ruby-version),
|
73
|
+
you can use the `file` option instead.
|
74
|
+
|
75
|
+
ruby file: ".ruby-version"
|
76
|
+
|
77
|
+
The version file should conform to any of the following formats:
|
78
|
+
|
79
|
+
- `3.1.2` (.ruby-version)
|
80
|
+
- `ruby 3.1.2` (.tool-versions, read: https://asdf-vm.com/manage/configuration.html#tool-versions)
|
66
81
|
|
67
82
|
### ENGINE
|
68
83
|
|
@@ -81,9 +96,10 @@ What exactly is an Engine?
|
|
81
96
|
|
82
97
|
- [Other implementations](https://www.ruby-lang.org/en/about/) of Ruby exist.
|
83
98
|
Some of the more well-known implementations include
|
84
|
-
[
|
99
|
+
[JRuby](https://www.jruby.org/) and [TruffleRuby](https://www.graalvm.org/ruby/).
|
85
100
|
Rubinius is an alternative implementation of Ruby written in Ruby.
|
86
101
|
JRuby is an implementation of Ruby on the JVM, short for Java Virtual Machine.
|
102
|
+
TruffleRuby is a Ruby implementation on the GraalVM, a language toolkit built on the JVM.
|
87
103
|
|
88
104
|
### ENGINE VERSION
|
89
105
|
|
@@ -91,13 +107,17 @@ Each application _may_ specify a Ruby engine version. If an engine version is
|
|
91
107
|
specified, an engine _must_ also be specified. If the engine is "ruby" the
|
92
108
|
engine version specified _must_ match the Ruby version.
|
93
109
|
|
94
|
-
ruby "
|
110
|
+
ruby "2.6.8", engine: "jruby", engine_version: "9.3.8.0"
|
95
111
|
|
96
112
|
### PATCHLEVEL
|
97
113
|
|
98
|
-
Each application _may_ specify a Ruby patchlevel.
|
114
|
+
Each application _may_ specify a Ruby patchlevel. Specifying the patchlevel has
|
115
|
+
been meaningless since Ruby 2.1.0 was released as the patchlevel is now
|
116
|
+
uniquely determined by a combination of major, minor, and teeny version numbers.
|
117
|
+
|
118
|
+
This option was implemented in Bundler 1.4.0 for Ruby 2.0 or earlier.
|
99
119
|
|
100
|
-
ruby "
|
120
|
+
ruby "3.1.2", patchlevel: "20"
|
101
121
|
|
102
122
|
## GEMS
|
103
123
|
|
@@ -124,23 +144,23 @@ Each _gem_ `MAY` specify files that should be used when autorequiring via
|
|
124
144
|
you want `required` has the same name as _gem_ or `false` to
|
125
145
|
prevent any file from being autorequired.
|
126
146
|
|
127
|
-
gem "redis", :
|
128
|
-
gem "webmock", :
|
129
|
-
gem "byebug", :
|
147
|
+
gem "redis", require: ["redis/connection/hiredis", "redis"]
|
148
|
+
gem "webmock", require: false
|
149
|
+
gem "byebug", require: true
|
130
150
|
|
131
151
|
The argument defaults to the name of the gem. For example, these are identical:
|
132
152
|
|
133
153
|
gem "nokogiri"
|
134
|
-
gem "nokogiri", :
|
135
|
-
gem "nokogiri", :
|
154
|
+
gem "nokogiri", require: "nokogiri"
|
155
|
+
gem "nokogiri", require: true
|
136
156
|
|
137
157
|
### GROUPS
|
138
158
|
|
139
159
|
Each _gem_ `MAY` specify membership in one or more groups. Any _gem_ that does
|
140
160
|
not specify membership in any group is placed in the `default` group.
|
141
161
|
|
142
|
-
gem "rspec", :
|
143
|
-
gem "wirble", :
|
162
|
+
gem "rspec", group: :test
|
163
|
+
gem "wirble", groups: [:development, :test]
|
144
164
|
|
145
165
|
The Bundler runtime allows its two main methods, `Bundler.setup` and
|
146
166
|
`Bundler.require`, to limit their impact to particular groups.
|
@@ -185,70 +205,75 @@ platforms.
|
|
185
205
|
There are a number of `Gemfile` platforms:
|
186
206
|
|
187
207
|
* `ruby`:
|
188
|
-
C Ruby (MRI), Rubinius or TruffleRuby, but
|
208
|
+
C Ruby (MRI), Rubinius, or TruffleRuby, but not Windows
|
189
209
|
* `mri`:
|
190
|
-
|
191
|
-
* `
|
192
|
-
Windows 32
|
193
|
-
* `
|
194
|
-
Windows
|
210
|
+
C Ruby (MRI) only, but not Windows
|
211
|
+
* `windows`:
|
212
|
+
Windows C Ruby (MRI), including RubyInstaller 32-bit and 64-bit versions
|
213
|
+
* `mswin`:
|
214
|
+
Windows C Ruby (MRI), including RubyInstaller 32-bit versions
|
215
|
+
* `mswin64`:
|
216
|
+
Windows C Ruby (MRI), including RubyInstaller 64-bit versions
|
195
217
|
* `rbx`:
|
196
218
|
Rubinius
|
197
219
|
* `jruby`:
|
198
220
|
JRuby
|
199
221
|
* `truffleruby`:
|
200
222
|
TruffleRuby
|
201
|
-
* `mswin`:
|
202
|
-
Windows
|
203
|
-
|
204
|
-
You can restrict further by platform and version for all platforms *except* for
|
205
|
-
`rbx`, `jruby`, `truffleruby` and `mswin`.
|
206
223
|
|
207
|
-
|
208
|
-
|
209
|
-
|
224
|
+
On platforms `ruby`, `mri`, `mswin`, `mswin64`, and `windows`, you may
|
225
|
+
additionally specify a version by appending the major and minor version numbers
|
226
|
+
without a delimiter. For example, to specify that a gem should only be used on
|
227
|
+
platform `ruby` version 3.1, use:
|
210
228
|
|
211
|
-
|
229
|
+
ruby_31
|
212
230
|
|
213
|
-
|
214
|
-
|
215
|
-
* `ruby`:
|
216
|
-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
217
|
-
* `mri`:
|
218
|
-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
219
|
-
* `mingw`:
|
220
|
-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
221
|
-
* `x64_mingw`:
|
222
|
-
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
231
|
+
As with groups (above), you may specify one or more platforms:
|
223
232
|
|
224
|
-
|
225
|
-
|
226
|
-
gem "
|
227
|
-
gem "ruby-debug", :platforms => :mri_18
|
228
|
-
gem "nokogiri", :platforms => [:mri_18, :jruby]
|
233
|
+
gem "weakling", platforms: :jruby
|
234
|
+
gem "ruby-debug", platforms: :mri_31
|
235
|
+
gem "nokogiri", platforms: [:windows_31, :jruby]
|
229
236
|
|
230
237
|
All operations involving groups ([`bundle install`](bundle-install.1.html), `Bundler.setup`,
|
231
238
|
`Bundler.require`) behave exactly the same as if any groups not
|
232
239
|
matching the current platform were explicitly excluded.
|
233
240
|
|
241
|
+
The following platform values are deprecated and should be replaced with `windows`:
|
242
|
+
|
243
|
+
* `mswin`, `mswin64`, `mingw32`, `x64_mingw`
|
244
|
+
|
245
|
+
### FORCE_RUBY_PLATFORM
|
246
|
+
|
247
|
+
If you always want the pure ruby variant of a gem to be chosen over platform
|
248
|
+
specific variants, you can use the `force_ruby_platform` option:
|
249
|
+
|
250
|
+
gem "ffi", force_ruby_platform: true
|
251
|
+
|
252
|
+
This can be handy (assuming the pure ruby variant works fine) when:
|
253
|
+
|
254
|
+
* You're having issues with the platform specific variant.
|
255
|
+
* The platform specific variant does not yet support a newer ruby (and thus has
|
256
|
+
a `required_ruby_version` upper bound), but you still want your Gemfile{.lock}
|
257
|
+
files to resolve under that ruby.
|
258
|
+
|
234
259
|
### SOURCE
|
235
260
|
|
236
|
-
You can select an alternate
|
261
|
+
You can select an alternate RubyGems repository for a gem using the ':source'
|
237
262
|
option.
|
238
263
|
|
239
|
-
gem "some_internal_gem", :
|
264
|
+
gem "some_internal_gem", source: "https://gems.example.com"
|
240
265
|
|
241
|
-
This forces the gem to be loaded from this source and ignores
|
266
|
+
This forces the gem to be loaded from this source and ignores the global source
|
242
267
|
declared at the top level of the file. If the gem does not exist in this source,
|
243
268
|
it will not be installed.
|
244
269
|
|
245
270
|
Bundler will search for child dependencies of this gem by first looking in the
|
246
271
|
source selected for the parent, but if they are not found there, it will fall
|
247
|
-
back on
|
272
|
+
back on the global source.
|
248
273
|
|
274
|
+
**Note about a behavior of the feature deprecated in Bundler 1.13**:
|
249
275
|
Selecting a specific source repository this way also suppresses the ambiguous
|
250
|
-
gem warning described above in
|
251
|
-
[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
|
276
|
+
gem warning described above in [GLOBAL SOURCE](#GLOBAL-SOURCE).
|
252
277
|
|
253
278
|
Using the `:source` option for an individual gem will also make that source
|
254
279
|
available as a possible global source for any other gems which do not specify
|
@@ -263,11 +288,11 @@ git repository using the `:git` parameter. The repository can be accessed via
|
|
263
288
|
several protocols:
|
264
289
|
|
265
290
|
* `HTTP(S)`:
|
266
|
-
gem "rails", :
|
291
|
+
gem "rails", git: "https://github.com/rails/rails.git"
|
267
292
|
* `SSH`:
|
268
|
-
gem "rails", :
|
293
|
+
gem "rails", git: "git@github.com:rails/rails.git"
|
269
294
|
* `git`:
|
270
|
-
gem "rails", :
|
295
|
+
gem "rails", git: "git://github.com/rails/rails.git"
|
271
296
|
|
272
297
|
If using SSH, the user that you use to run `bundle install` `MUST` have the
|
273
298
|
appropriate keys available in their `$HOME/.ssh`.
|
@@ -295,7 +320,7 @@ to, a version specifier, if provided, means that the git repository is
|
|
295
320
|
only valid if the `.gemspec` specifies a version matching the version
|
296
321
|
specifier. If not, bundler will print a warning.
|
297
322
|
|
298
|
-
gem "rails", "2.3.8", :
|
323
|
+
gem "rails", "2.3.8", git: "https://github.com/rails/rails.git"
|
299
324
|
# bundle install will fail, because the .gemspec in the rails
|
300
325
|
# repository's master branch specifies version 3.0.0
|
301
326
|
|
@@ -307,18 +332,18 @@ Git repositories support a number of additional options.
|
|
307
332
|
|
308
333
|
* `branch`, `tag`, and `ref`:
|
309
334
|
You `MUST` only specify at most one of these options. The default
|
310
|
-
is
|
335
|
+
is `branch: "master"`. For example:
|
311
336
|
|
312
|
-
gem "rails", :
|
337
|
+
gem "rails", git: "https://github.com/rails/rails.git", branch: "5-0-stable"
|
313
338
|
|
314
|
-
gem "rails", :
|
339
|
+
gem "rails", git: "https://github.com/rails/rails.git", tag: "v5.0.0"
|
315
340
|
|
316
|
-
gem "rails", :
|
341
|
+
gem "rails", git: "https://github.com/rails/rails.git", ref: "4aded"
|
317
342
|
|
318
343
|
* `submodules`:
|
319
344
|
For reference, a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
|
320
345
|
lets you have another git repository within a subfolder of your repository.
|
321
|
-
Specify
|
346
|
+
Specify `submodules: true` to cause bundler to expand any
|
322
347
|
submodules included in the git repository
|
323
348
|
|
324
349
|
If a git repository contains multiple `.gemspecs`, each `.gemspec`
|
@@ -346,11 +371,11 @@ as an argument, and a block which receives a single argument and interpolates it
|
|
346
371
|
string to return the full repo address:
|
347
372
|
|
348
373
|
git_source(:stash){ |repo_name| "https://stash.corp.acme.pl/#{repo_name}.git" }
|
349
|
-
gem 'rails', :
|
374
|
+
gem 'rails', stash: 'forks/rails'
|
350
375
|
|
351
376
|
In addition, if you wish to choose a specific branch:
|
352
377
|
|
353
|
-
gem "rails", :
|
378
|
+
gem "rails", stash: "forks/rails", branch: "branch_name"
|
354
379
|
|
355
380
|
### GITHUB
|
356
381
|
|
@@ -363,25 +388,33 @@ If the git repository you want to use is hosted on GitHub and is public, you can
|
|
363
388
|
trailing ".git"), separated by a slash. If both the username and repository name are the
|
364
389
|
same, you can omit one.
|
365
390
|
|
366
|
-
gem "rails", :
|
367
|
-
gem "rails", :
|
391
|
+
gem "rails", github: "rails/rails"
|
392
|
+
gem "rails", github: "rails"
|
368
393
|
|
369
394
|
Are both equivalent to
|
370
395
|
|
371
|
-
gem "rails", :
|
396
|
+
gem "rails", git: "https://github.com/rails/rails.git"
|
372
397
|
|
373
398
|
Since the `github` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
374
399
|
|
400
|
+
You can also directly pass a pull request URL:
|
401
|
+
|
402
|
+
gem "rails", github: "https://github.com/rails/rails/pull/43753"
|
403
|
+
|
404
|
+
Which is equivalent to:
|
405
|
+
|
406
|
+
gem "rails", github: "rails/rails", branch: "refs/pull/43753/head"
|
407
|
+
|
375
408
|
### GIST
|
376
409
|
|
377
|
-
If the git repository you want to use is hosted as a
|
410
|
+
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use
|
378
411
|
the :gist shorthand to specify the gist identifier (without the trailing ".git").
|
379
412
|
|
380
|
-
gem "the_hatch", :
|
413
|
+
gem "the_hatch", gist: "4815162342"
|
381
414
|
|
382
415
|
Is equivalent to:
|
383
416
|
|
384
|
-
gem "the_hatch", :
|
417
|
+
gem "the_hatch", git: "https://gist.github.com/4815162342.git"
|
385
418
|
|
386
419
|
Since the `gist` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
387
420
|
|
@@ -392,12 +425,12 @@ If the git repository you want to use is hosted on Bitbucket and is public, you
|
|
392
425
|
trailing ".git"), separated by a slash. If both the username and repository name are the
|
393
426
|
same, you can omit one.
|
394
427
|
|
395
|
-
gem "rails", :
|
396
|
-
gem "rails", :
|
428
|
+
gem "rails", bitbucket: "rails/rails"
|
429
|
+
gem "rails", bitbucket: "rails"
|
397
430
|
|
398
431
|
Are both equivalent to
|
399
432
|
|
400
|
-
gem "rails", :
|
433
|
+
gem "rails", git: "https://rails@bitbucket.org/rails/rails.git"
|
401
434
|
|
402
435
|
Since the `bitbucket` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
403
436
|
|
@@ -415,7 +448,7 @@ version that bundler should use.
|
|
415
448
|
Unlike `:git`, bundler does not compile C extensions for
|
416
449
|
gems specified as paths.
|
417
450
|
|
418
|
-
gem "rails", :
|
451
|
+
gem "rails", path: "vendor/rails"
|
419
452
|
|
420
453
|
If you would like to use multiple local gems directly from the filesystem, you can set a global `path` option to the path containing the gem's files. This will automatically load gemspec files from subdirectories.
|
421
454
|
|
@@ -444,7 +477,7 @@ applied to a group of gems by using block form.
|
|
444
477
|
gem "sqlite3"
|
445
478
|
end
|
446
479
|
|
447
|
-
group :development, :
|
480
|
+
group :development, optional: true do
|
448
481
|
gem "wirble"
|
449
482
|
gem "faker"
|
450
483
|
end
|
@@ -476,7 +509,7 @@ software is installed or some other conditions are met.
|
|
476
509
|
|
477
510
|
## GEMSPEC
|
478
511
|
|
479
|
-
The [`.gemspec`](
|
512
|
+
The [`.gemspec`](https://guides.rubygems.org/specification-reference/) file is where
|
480
513
|
you provide metadata about your gem to Rubygems. Some required Gemspec
|
481
514
|
attributes include the name, description, and homepage of your gem. This is
|
482
515
|
also where you specify the dependencies your gem needs to run.
|
@@ -487,15 +520,15 @@ the `.gemspec` file.
|
|
487
520
|
|
488
521
|
The `gemspec` method adds any runtime dependencies as gem requirements in the
|
489
522
|
default group. It also adds development dependencies as gem requirements in the
|
490
|
-
`development` group. Finally, it adds a gem requirement on your project (
|
491
|
-
|
523
|
+
`development` group. Finally, it adds a gem requirement on your project (`path:
|
524
|
+
'.'`). In conjunction with `Bundler.setup`, this allows you to require project
|
492
525
|
files in your test code as you would if the project were installed as a gem; you
|
493
526
|
need not manipulate the load path manually or require project files via relative
|
494
527
|
paths.
|
495
528
|
|
496
529
|
The `gemspec` method supports optional `:path`, `:glob`, `:name`, and `:development_group`
|
497
530
|
options, which control where bundler looks for the `.gemspec`, the glob it uses to look
|
498
|
-
for the gemspec (defaults to:
|
531
|
+
for the gemspec (defaults to: `{,*,*/*}.gemspec`), what named `.gemspec` it uses
|
499
532
|
(if more than one is present), and which group development dependencies are included in.
|
500
533
|
|
501
534
|
When a `gemspec` dependency encounters version conflicts during resolution, the
|
@@ -513,5 +546,7 @@ bundler uses the following priority order:
|
|
513
546
|
repository declared on the parent. This results in bundler prioritizing the
|
514
547
|
ActiveSupport gem from the Rails git repository over ones from
|
515
548
|
`rubygems.org`
|
516
|
-
3.
|
517
|
-
|
549
|
+
3. If neither of the above conditions are met, the global source will be used.
|
550
|
+
If multiple global sources are specified, they will be prioritized from
|
551
|
+
last to first, but this is deprecated since Bundler 1.13, so Bundler prints
|
552
|
+
a warning and will abort with an error in the future.
|
data/lib/bundler/man/index.txt
CHANGED
@@ -6,9 +6,11 @@ bundle-cache(1) bundle-cache.1
|
|
6
6
|
bundle-check(1) bundle-check.1
|
7
7
|
bundle-clean(1) bundle-clean.1
|
8
8
|
bundle-config(1) bundle-config.1
|
9
|
+
bundle-console(1) bundle-console.1
|
9
10
|
bundle-doctor(1) bundle-doctor.1
|
10
11
|
bundle-exec(1) bundle-exec.1
|
11
12
|
bundle-gem(1) bundle-gem.1
|
13
|
+
bundle-help(1) bundle-help.1
|
12
14
|
bundle-info(1) bundle-info.1
|
13
15
|
bundle-init(1) bundle-init.1
|
14
16
|
bundle-inject(1) bundle-inject.1
|
@@ -18,8 +20,10 @@ bundle-lock(1) bundle-lock.1
|
|
18
20
|
bundle-open(1) bundle-open.1
|
19
21
|
bundle-outdated(1) bundle-outdated.1
|
20
22
|
bundle-platform(1) bundle-platform.1
|
23
|
+
bundle-plugin(1) bundle-plugin.1
|
21
24
|
bundle-pristine(1) bundle-pristine.1
|
22
25
|
bundle-remove(1) bundle-remove.1
|
23
26
|
bundle-show(1) bundle-show.1
|
24
27
|
bundle-update(1) bundle-update.1
|
28
|
+
bundle-version(1) bundle-version.1
|
25
29
|
bundle-viz(1) bundle-viz.1
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
module MatchMetadata
|
5
|
+
def matches_current_metadata?
|
6
|
+
matches_current_ruby? && matches_current_rubygems?
|
7
|
+
end
|
8
|
+
|
9
|
+
def matches_current_ruby?
|
10
|
+
@required_ruby_version.satisfied_by?(Gem.ruby_version)
|
11
|
+
end
|
12
|
+
|
13
|
+
def matches_current_rubygems?
|
14
|
+
@required_rubygems_version.satisfied_by?(Gem.rubygems_version)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -12,10 +12,9 @@ module Bundler
|
|
12
12
|
|
13
13
|
def self.platforms_match?(gemspec_platform, local_platform)
|
14
14
|
return true if gemspec_platform.nil?
|
15
|
-
return true if Gem::Platform::RUBY
|
15
|
+
return true if gemspec_platform == Gem::Platform::RUBY
|
16
16
|
return true if local_platform == gemspec_platform
|
17
17
|
gemspec_platform = Gem::Platform.new(gemspec_platform)
|
18
|
-
return true if GemHelpers.generic(gemspec_platform) === local_platform
|
19
18
|
return true if gemspec_platform === local_platform
|
20
19
|
|
21
20
|
false
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
module FetchMetadata
|
5
|
+
# A fallback is included because the original version of the specification
|
6
|
+
# API didn't include that field, so some marshalled specs in the index have it
|
7
|
+
# set to +nil+.
|
8
|
+
def matches_current_ruby?
|
9
|
+
@required_ruby_version ||= _remote_specification.required_ruby_version || Gem::Requirement.default
|
10
|
+
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def matches_current_rubygems?
|
15
|
+
# A fallback is included because the original version of the specification
|
16
|
+
# API didn't include that field, so some marshalled specs in the index have it
|
17
|
+
# set to +nil+.
|
18
|
+
@required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
|
19
|
+
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module MatchRemoteMetadata
|
25
|
+
include MatchMetadata
|
26
|
+
|
27
|
+
prepend FetchMetadata
|
28
|
+
end
|
29
|
+
end
|
data/lib/bundler/mirror.rb
CHANGED
@@ -47,7 +47,7 @@ module Bundler
|
|
47
47
|
|
48
48
|
def fetch_valid_mirror_for(uri)
|
49
49
|
downcased = uri.to_s.downcase
|
50
|
-
mirror = @mirrors[downcased] || @mirrors[
|
50
|
+
mirror = @mirrors[downcased] || @mirrors[Gem::URI(downcased).host] || Mirror.new(uri)
|
51
51
|
mirror.validate!(@prober)
|
52
52
|
mirror = Mirror.new(uri) unless mirror.valid?
|
53
53
|
mirror
|
@@ -74,7 +74,7 @@ module Bundler
|
|
74
74
|
@uri = if uri.nil?
|
75
75
|
nil
|
76
76
|
else
|
77
|
-
|
77
|
+
Gem::URI(uri.to_s)
|
78
78
|
end
|
79
79
|
@valid = nil
|
80
80
|
end
|
@@ -126,7 +126,7 @@ module Bundler
|
|
126
126
|
if uri == "all"
|
127
127
|
@all = true
|
128
128
|
else
|
129
|
-
@uri =
|
129
|
+
@uri = Gem::URI(uri).absolute? ? Settings.normalize_uri(uri) : uri
|
130
130
|
end
|
131
131
|
@value = value
|
132
132
|
end
|
@@ -148,13 +148,11 @@ module Bundler
|
|
148
148
|
class TCPSocketProbe
|
149
149
|
def replies?(mirror)
|
150
150
|
MirrorSockets.new(mirror).any? do |socket, address, timeout|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
false
|
157
|
-
end
|
151
|
+
socket.connect_nonblock(address)
|
152
|
+
rescue Errno::EINPROGRESS
|
153
|
+
wait_for_writtable_socket(socket, address, timeout)
|
154
|
+
rescue RuntimeError # Connection failed somehow, again
|
155
|
+
false
|
158
156
|
end
|
159
157
|
end
|
160
158
|
|
@@ -39,7 +39,7 @@ module Bundler
|
|
39
39
|
# is present to be compatible with `Definition` and is used by
|
40
40
|
# rubygems source.
|
41
41
|
module Source
|
42
|
-
attr_reader :uri, :options, :name
|
42
|
+
attr_reader :uri, :options, :name, :checksum_store
|
43
43
|
attr_accessor :dependency_names
|
44
44
|
|
45
45
|
def initialize(opts)
|
@@ -48,6 +48,7 @@ module Bundler
|
|
48
48
|
@uri = opts["uri"]
|
49
49
|
@type = opts["type"]
|
50
50
|
@name = opts["name"] || "#{@type} at #{@uri}"
|
51
|
+
@checksum_store = Checksum::Store.new
|
51
52
|
end
|
52
53
|
|
53
54
|
# This is used by the default `spec` method to constructs the
|
@@ -95,7 +96,7 @@ module Bundler
|
|
95
96
|
#
|
96
97
|
# Note: Do not override if you don't know what you are doing.
|
97
98
|
def post_install(spec, disable_exts = false)
|
98
|
-
opts = { :
|
99
|
+
opts = { env_shebang: false, disable_extensions: disable_exts }
|
99
100
|
installer = Bundler::Source::Path::Installer.new(spec, opts)
|
100
101
|
installer.post_install
|
101
102
|
end
|
@@ -106,7 +107,7 @@ module Bundler
|
|
106
107
|
def install_path
|
107
108
|
@install_path ||=
|
108
109
|
begin
|
109
|
-
base_name = File.basename(
|
110
|
+
base_name = File.basename(Gem::URI.parse(uri).normalize.path)
|
110
111
|
|
111
112
|
gem_install_dir.join("#{base_name}-#{uri_hash[0..11]}")
|
112
113
|
end
|
@@ -175,7 +176,7 @@ module Bundler
|
|
175
176
|
#
|
176
177
|
# This is used by `app_cache_path`
|
177
178
|
def app_cache_dirname
|
178
|
-
base_name = File.basename(
|
179
|
+
base_name = File.basename(Gem::URI.parse(uri).normalize.path)
|
179
180
|
"#{base_name}-#{uri_hash}"
|
180
181
|
end
|
181
182
|
|
@@ -258,7 +259,7 @@ module Bundler
|
|
258
259
|
@dependencies |= Array(names)
|
259
260
|
end
|
260
261
|
|
261
|
-
#
|
262
|
+
# NOTE: Do not override if you don't know what you are doing.
|
262
263
|
def can_lock?(spec)
|
263
264
|
spec.source == self
|
264
265
|
end
|
@@ -283,8 +284,9 @@ module Bundler
|
|
283
284
|
def to_s
|
284
285
|
"plugin source for #{@type} with uri #{@uri}"
|
285
286
|
end
|
287
|
+
alias_method :identifier, :to_s
|
286
288
|
|
287
|
-
#
|
289
|
+
# NOTE: Do not override if you don't know what you are doing.
|
288
290
|
def include?(other)
|
289
291
|
other == self
|
290
292
|
end
|
@@ -293,7 +295,7 @@ module Bundler
|
|
293
295
|
SharedHelpers.digest(:SHA1).hexdigest(uri)
|
294
296
|
end
|
295
297
|
|
296
|
-
#
|
298
|
+
# NOTE: Do not override if you don't know what you are doing.
|
297
299
|
def gem_install_dir
|
298
300
|
Bundler.install_path
|
299
301
|
end
|
@@ -307,12 +309,6 @@ module Bundler
|
|
307
309
|
Bundler.root
|
308
310
|
end
|
309
311
|
|
310
|
-
# @private
|
311
|
-
# Returns true
|
312
|
-
def bundler_plugin_api_source?
|
313
|
-
true
|
314
|
-
end
|
315
|
-
|
316
312
|
# @private
|
317
313
|
# This API on source might not be stable, and for now we expect plugins
|
318
314
|
# to download all specs in `#specs`, so we implement the method for
|
data/lib/bundler/plugin/index.rb
CHANGED
@@ -136,6 +136,14 @@ module Bundler
|
|
136
136
|
@hooks[event] || []
|
137
137
|
end
|
138
138
|
|
139
|
+
# This plugin is installed inside the .bundle/plugin directory,
|
140
|
+
# and thus is managed solely by Bundler
|
141
|
+
def installed_in_plugin_root?(name)
|
142
|
+
return false unless (path = installed?(name))
|
143
|
+
|
144
|
+
path.start_with?("#{Plugin.root}/")
|
145
|
+
end
|
146
|
+
|
139
147
|
private
|
140
148
|
|
141
149
|
# Reads the index file from the directory and initializes the instance
|
@@ -146,7 +154,7 @@ module Bundler
|
|
146
154
|
# @param [Boolean] is the index file global index
|
147
155
|
def load_index(index_file, global = false)
|
148
156
|
SharedHelpers.filesystem_access(index_file, :read) do |index_f|
|
149
|
-
valid_file = index_f
|
157
|
+
valid_file = index_f&.exist? && !index_f.size.zero?
|
150
158
|
break unless valid_file
|
151
159
|
|
152
160
|
data = index_f.read
|
@@ -167,11 +175,11 @@ module Bundler
|
|
167
175
|
# to be only String key value pairs)
|
168
176
|
def save_index
|
169
177
|
index = {
|
170
|
-
"commands"
|
171
|
-
"hooks"
|
172
|
-
"load_paths"
|
178
|
+
"commands" => @commands,
|
179
|
+
"hooks" => @hooks,
|
180
|
+
"load_paths" => @load_paths,
|
173
181
|
"plugin_paths" => @plugin_paths,
|
174
|
-
"sources"
|
182
|
+
"sources" => @sources,
|
175
183
|
}
|
176
184
|
|
177
185
|
require_relative "../yaml_serializer"
|