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/man/gemfile.5
CHANGED
@@ -1,206 +1,143 @@
|
|
1
|
-
.\" generated with
|
2
|
-
.\"
|
3
|
-
.
|
4
|
-
.TH "GEMFILE" "5" "June 2021" "" ""
|
5
|
-
.
|
1
|
+
.\" generated with nRonn/v0.11.1
|
2
|
+
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
+
.TH "GEMFILE" "5" "June 2024" ""
|
6
4
|
.SH "NAME"
|
7
5
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
8
|
-
.
|
9
6
|
.SH "SYNOPSIS"
|
10
7
|
A \fBGemfile\fR describes the gem dependencies required to execute associated Ruby code\.
|
11
|
-
.
|
12
8
|
.P
|
13
9
|
Place the \fBGemfile\fR in the root of the directory containing the associated code\. For instance, in a Rails application, place the \fBGemfile\fR in the same directory as the \fBRakefile\fR\.
|
14
|
-
.
|
15
10
|
.SH "SYNTAX"
|
16
11
|
A \fBGemfile\fR is evaluated as Ruby code, in a context which makes available a number of methods used to describe the gem requirements\.
|
17
|
-
.
|
18
|
-
|
19
|
-
At the top of the \fBGemfile\fR, add a line for the \fBRubygems\fR source that contains the gems listed in the \fBGemfile\fR\.
|
20
|
-
.
|
12
|
+
.SH "GLOBAL SOURCE"
|
13
|
+
At the top of the \fBGemfile\fR, add a single line for the \fBRubyGems\fR source that contains the gems listed in the \fBGemfile\fR\.
|
21
14
|
.IP "" 4
|
22
|
-
.
|
23
15
|
.nf
|
24
|
-
|
25
16
|
source "https://rubygems\.org"
|
26
|
-
.
|
27
17
|
.fi
|
28
|
-
.
|
29
18
|
.IP "" 0
|
30
|
-
.
|
31
19
|
.P
|
32
|
-
|
33
|
-
.
|
20
|
+
You can add only one global source\. In Bundler 1\.13, adding multiple global sources was deprecated\. The \fBsource\fR \fBMUST\fR be a valid RubyGems repository\.
|
21
|
+
.P
|
22
|
+
To use more than one source of RubyGems, you should use \fI\fBsource\fR block\fR\.
|
23
|
+
.P
|
24
|
+
A source is checked for gems following the heuristics described in \fISOURCE PRIORITY\fR\.
|
34
25
|
.P
|
35
|
-
|
36
|
-
.
|
26
|
+
\fBNote about a behavior of the feature deprecated in Bundler 1\.13\fR: If a gem is found in more than one global source, Bundler will print a warning after installing the gem indicating which source was used, and listing the other sources where the gem is available\. A specific source can be selected for gems that need to use a non\-standard repository, suppressing this warning, by using the \fI\fB:source\fR option\fR or \fBsource\fR block\.
|
37
27
|
.SS "CREDENTIALS"
|
38
28
|
Some gem sources require a username and password\. Use bundle config(1) \fIbundle\-config\.1\.html\fR to set the username and password for any of the sources that need it\. The command must be run once on each computer that will install the Gemfile, but this keeps the credentials from being stored in plain text in version control\.
|
39
|
-
.
|
40
29
|
.IP "" 4
|
41
|
-
.
|
42
30
|
.nf
|
43
|
-
|
44
31
|
bundle config gems\.example\.com user:password
|
45
|
-
.
|
46
32
|
.fi
|
47
|
-
.
|
48
33
|
.IP "" 0
|
49
|
-
.
|
50
34
|
.P
|
51
35
|
For some sources, like a company Gemfury account, it may be easier to include the credentials in the Gemfile as part of the source URL\.
|
52
|
-
.
|
53
36
|
.IP "" 4
|
54
|
-
.
|
55
37
|
.nf
|
56
|
-
|
57
38
|
source "https://user:password@gems\.example\.com"
|
58
|
-
.
|
59
39
|
.fi
|
60
|
-
.
|
61
40
|
.IP "" 0
|
62
|
-
.
|
63
41
|
.P
|
64
42
|
Credentials in the source URL will take precedence over credentials set using \fBconfig\fR\.
|
65
|
-
.
|
66
43
|
.SH "RUBY"
|
67
44
|
If your application requires a specific Ruby version or engine, specify your requirements using the \fBruby\fR method, with the following arguments\. All parameters are \fBOPTIONAL\fR unless otherwise specified\.
|
68
|
-
.
|
69
45
|
.SS "VERSION (required)"
|
70
|
-
The version of Ruby that your application requires\. If your application requires an alternate Ruby engine, such as JRuby,
|
71
|
-
.
|
46
|
+
The version of Ruby that your application requires\. If your application requires an alternate Ruby engine, such as JRuby, TruffleRuby, etc\., this should be the Ruby version that the engine is compatible with\.
|
72
47
|
.IP "" 4
|
73
|
-
.
|
74
48
|
.nf
|
75
|
-
|
76
|
-
ruby "1\.9\.3"
|
77
|
-
.
|
49
|
+
ruby "3\.1\.2"
|
78
50
|
.fi
|
79
|
-
.
|
80
51
|
.IP "" 0
|
81
|
-
.
|
52
|
+
.P
|
53
|
+
If you wish to derive your Ruby version from a version file (ie \.ruby\-version), you can use the \fBfile\fR option instead\.
|
54
|
+
.IP "" 4
|
55
|
+
.nf
|
56
|
+
ruby file: "\.ruby\-version"
|
57
|
+
.fi
|
58
|
+
.IP "" 0
|
59
|
+
.P
|
60
|
+
The version file should conform to any of the following formats:
|
61
|
+
.IP "\(bu" 4
|
62
|
+
\fB3\.1\.2\fR (\.ruby\-version)
|
63
|
+
.IP "\(bu" 4
|
64
|
+
\fBruby 3\.1\.2\fR (\.tool\-versions, read: https://asdf\-vm\.com/manage/configuration\.html#tool\-versions)
|
65
|
+
.IP "" 0
|
82
66
|
.SS "ENGINE"
|
83
67
|
Each application \fImay\fR specify a Ruby engine\. If an engine is specified, an engine version \fImust\fR also be specified\.
|
84
|
-
.
|
85
68
|
.P
|
86
|
-
What exactly is an Engine?
|
87
|
-
.
|
69
|
+
What exactly is an Engine?
|
88
70
|
.IP "\(bu" 4
|
89
|
-
|
90
|
-
.
|
71
|
+
A Ruby engine is an implementation of the Ruby language\.
|
91
72
|
.IP "\(bu" 4
|
92
|
-
|
93
|
-
.
|
73
|
+
For background: the reference or original implementation of the Ruby programming language is called Matz's Ruby Interpreter \fIhttps://en\.wikipedia\.org/wiki/Ruby_MRI\fR, or MRI for short\. This is named after Ruby creator Yukihiro Matsumoto, also known as Matz\. MRI is also known as CRuby, because it is written in C\. MRI is the most widely used Ruby engine\.
|
74
|
+
.IP "\(bu" 4
|
75
|
+
Other implementations \fIhttps://www\.ruby\-lang\.org/en/about/\fR of Ruby exist\. Some of the more well\-known implementations include JRuby \fIhttps://www\.jruby\.org/\fR and TruffleRuby \fIhttps://www\.graalvm\.org/ruby/\fR\. Rubinius is an alternative implementation of Ruby written in Ruby\. JRuby is an implementation of Ruby on the JVM, short for Java Virtual Machine\. TruffleRuby is a Ruby implementation on the GraalVM, a language toolkit built on the JVM\.
|
94
76
|
.IP "" 0
|
95
|
-
.
|
96
77
|
.SS "ENGINE VERSION"
|
97
78
|
Each application \fImay\fR specify a Ruby engine version\. If an engine version is specified, an engine \fImust\fR also be specified\. If the engine is "ruby" the engine version specified \fImust\fR match the Ruby version\.
|
98
|
-
.
|
99
79
|
.IP "" 4
|
100
|
-
.
|
101
80
|
.nf
|
102
|
-
|
103
|
-
ruby "1\.8\.7", :engine => "jruby", :engine_version => "1\.6\.7"
|
104
|
-
.
|
81
|
+
ruby "2\.6\.8", engine: "jruby", engine_version: "9\.3\.8\.0"
|
105
82
|
.fi
|
106
|
-
.
|
107
83
|
.IP "" 0
|
108
|
-
.
|
109
84
|
.SS "PATCHLEVEL"
|
110
|
-
Each application \fImay\fR specify a Ruby patchlevel\.
|
111
|
-
.
|
85
|
+
Each application \fImay\fR specify a Ruby patchlevel\. Specifying the patchlevel has been meaningless since Ruby 2\.1\.0 was released as the patchlevel is now uniquely determined by a combination of major, minor, and teeny version numbers\.
|
86
|
+
.P
|
87
|
+
This option was implemented in Bundler 1\.4\.0 for Ruby 2\.0 or earlier\.
|
112
88
|
.IP "" 4
|
113
|
-
.
|
114
89
|
.nf
|
115
|
-
|
116
|
-
ruby "2\.0\.0", :patchlevel => "247"
|
117
|
-
.
|
90
|
+
ruby "3\.1\.2", patchlevel: "20"
|
118
91
|
.fi
|
119
|
-
.
|
120
92
|
.IP "" 0
|
121
|
-
.
|
122
93
|
.SH "GEMS"
|
123
94
|
Specify gem requirements using the \fBgem\fR method, with the following arguments\. All parameters are \fBOPTIONAL\fR unless otherwise specified\.
|
124
|
-
.
|
125
95
|
.SS "NAME (required)"
|
126
96
|
For each gem requirement, list a single \fIgem\fR line\.
|
127
|
-
.
|
128
97
|
.IP "" 4
|
129
|
-
.
|
130
98
|
.nf
|
131
|
-
|
132
99
|
gem "nokogiri"
|
133
|
-
.
|
134
100
|
.fi
|
135
|
-
.
|
136
101
|
.IP "" 0
|
137
|
-
.
|
138
102
|
.SS "VERSION"
|
139
103
|
Each \fIgem\fR \fBMAY\fR have one or more version specifiers\.
|
140
|
-
.
|
141
104
|
.IP "" 4
|
142
|
-
.
|
143
105
|
.nf
|
144
|
-
|
145
106
|
gem "nokogiri", ">= 1\.4\.2"
|
146
107
|
gem "RedCloth", ">= 4\.1\.0", "< 4\.2\.0"
|
147
|
-
.
|
148
108
|
.fi
|
149
|
-
.
|
150
109
|
.IP "" 0
|
151
|
-
.
|
152
110
|
.SS "REQUIRE AS"
|
153
111
|
Each \fIgem\fR \fBMAY\fR specify files that should be used when autorequiring via \fBBundler\.require\fR\. You may pass an array with multiple files or \fBtrue\fR if the file you want \fBrequired\fR has the same name as \fIgem\fR or \fBfalse\fR to prevent any file from being autorequired\.
|
154
|
-
.
|
155
112
|
.IP "" 4
|
156
|
-
.
|
157
113
|
.nf
|
158
|
-
|
159
|
-
gem "
|
160
|
-
gem "
|
161
|
-
gem "byebug", :require => true
|
162
|
-
.
|
114
|
+
gem "redis", require: ["redis/connection/hiredis", "redis"]
|
115
|
+
gem "webmock", require: false
|
116
|
+
gem "byebug", require: true
|
163
117
|
.fi
|
164
|
-
.
|
165
118
|
.IP "" 0
|
166
|
-
.
|
167
119
|
.P
|
168
120
|
The argument defaults to the name of the gem\. For example, these are identical:
|
169
|
-
.
|
170
121
|
.IP "" 4
|
171
|
-
.
|
172
122
|
.nf
|
173
|
-
|
174
123
|
gem "nokogiri"
|
175
|
-
gem "nokogiri", :
|
176
|
-
gem "nokogiri", :
|
177
|
-
.
|
124
|
+
gem "nokogiri", require: "nokogiri"
|
125
|
+
gem "nokogiri", require: true
|
178
126
|
.fi
|
179
|
-
.
|
180
127
|
.IP "" 0
|
181
|
-
.
|
182
128
|
.SS "GROUPS"
|
183
129
|
Each \fIgem\fR \fBMAY\fR specify membership in one or more groups\. Any \fIgem\fR that does not specify membership in any group is placed in the \fBdefault\fR group\.
|
184
|
-
.
|
185
130
|
.IP "" 4
|
186
|
-
.
|
187
131
|
.nf
|
188
|
-
|
189
|
-
gem "
|
190
|
-
gem "wirble", :groups => [:development, :test]
|
191
|
-
.
|
132
|
+
gem "rspec", group: :test
|
133
|
+
gem "wirble", groups: [:development, :test]
|
192
134
|
.fi
|
193
|
-
.
|
194
135
|
.IP "" 0
|
195
|
-
.
|
196
136
|
.P
|
197
137
|
The Bundler runtime allows its two main methods, \fBBundler\.setup\fR and \fBBundler\.require\fR, to limit their impact to particular groups\.
|
198
|
-
.
|
199
138
|
.IP "" 4
|
200
|
-
.
|
201
139
|
.nf
|
202
|
-
|
203
|
-
# setup adds gems to Ruby\'s load path
|
140
|
+
# setup adds gems to Ruby's load path
|
204
141
|
Bundler\.setup # defaults to all groups
|
205
142
|
require "bundler/setup" # same as Bundler\.setup
|
206
143
|
Bundler\.setup(:default) # only set up the _default_ group
|
@@ -212,401 +149,269 @@ Bundler\.require # defaults to the _default_ group
|
|
212
149
|
Bundler\.require(:default) # identical
|
213
150
|
Bundler\.require(:default, :test) # requires the _default_ and _test_ groups
|
214
151
|
Bundler\.require(:test) # requires the _test_ group
|
215
|
-
.
|
216
152
|
.fi
|
217
|
-
.
|
218
153
|
.IP "" 0
|
219
|
-
.
|
220
154
|
.P
|
221
155
|
The Bundler CLI allows you to specify a list of groups whose gems \fBbundle install\fR should not install with the \fBwithout\fR configuration\.
|
222
|
-
.
|
223
156
|
.P
|
224
157
|
To specify multiple groups to ignore, specify a list of groups separated by spaces\.
|
225
|
-
.
|
226
158
|
.IP "" 4
|
227
|
-
.
|
228
159
|
.nf
|
229
|
-
|
230
160
|
bundle config set \-\-local without test
|
231
161
|
bundle config set \-\-local without development test
|
232
|
-
.
|
233
162
|
.fi
|
234
|
-
.
|
235
163
|
.IP "" 0
|
236
|
-
.
|
237
164
|
.P
|
238
165
|
Also, calling \fBBundler\.setup\fR with no parameters, or calling \fBrequire "bundler/setup"\fR will setup all groups except for the ones you excluded via \fB\-\-without\fR (since they are not available)\.
|
239
|
-
.
|
240
166
|
.P
|
241
167
|
Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Understanding Bundler \fIhttps://bundler\.io/rationale\.html\fR\.
|
242
|
-
.
|
243
168
|
.SS "PLATFORMS"
|
244
169
|
If a gem should only be used in a particular platform or set of platforms, you can specify them\. Platforms are essentially identical to groups, except that you do not need to use the \fB\-\-without\fR install\-time flag to exclude groups of gems for other platforms\.
|
245
|
-
.
|
246
170
|
.P
|
247
171
|
There are a number of \fBGemfile\fR platforms:
|
248
|
-
.
|
249
172
|
.TP
|
250
173
|
\fBruby\fR
|
251
|
-
C Ruby (MRI), Rubinius or TruffleRuby, but
|
252
|
-
.
|
174
|
+
C Ruby (MRI), Rubinius, or TruffleRuby, but not Windows
|
253
175
|
.TP
|
254
176
|
\fBmri\fR
|
255
|
-
|
256
|
-
.
|
177
|
+
C Ruby (MRI) only, but not Windows
|
257
178
|
.TP
|
258
|
-
\
|
259
|
-
Windows 32
|
260
|
-
.
|
179
|
+
\fBwindows\fR
|
180
|
+
Windows C Ruby (MRI), including RubyInstaller 32\-bit and 64\-bit versions
|
181
|
+
.TP
|
182
|
+
\fBmswin\fR
|
183
|
+
Windows C Ruby (MRI), including RubyInstaller 32\-bit versions
|
261
184
|
.TP
|
262
|
-
\
|
263
|
-
Windows
|
264
|
-
.
|
185
|
+
\fBmswin64\fR
|
186
|
+
Windows C Ruby (MRI), including RubyInstaller 64\-bit versions
|
265
187
|
.TP
|
266
188
|
\fBrbx\fR
|
267
189
|
Rubinius
|
268
|
-
.
|
269
190
|
.TP
|
270
191
|
\fBjruby\fR
|
271
192
|
JRuby
|
272
|
-
.
|
273
193
|
.TP
|
274
194
|
\fBtruffleruby\fR
|
275
195
|
TruffleRuby
|
276
|
-
.
|
277
|
-
.TP
|
278
|
-
\fBmswin\fR
|
279
|
-
Windows
|
280
|
-
.
|
281
196
|
.P
|
282
|
-
|
283
|
-
.
|
197
|
+
On platforms \fBruby\fR, \fBmri\fR, \fBmswin\fR, \fBmswin64\fR, and \fBwindows\fR, you may additionally specify a version by appending the major and minor version numbers without a delimiter\. For example, to specify that a gem should only be used on platform \fBruby\fR version 3\.1, use:
|
198
|
+
.IP "" 4
|
199
|
+
.nf
|
200
|
+
ruby_31
|
201
|
+
.fi
|
202
|
+
.IP "" 0
|
284
203
|
.P
|
285
|
-
|
286
|
-
.
|
204
|
+
As with groups (above), you may specify one or more platforms:
|
287
205
|
.IP "" 4
|
288
|
-
.
|
289
206
|
.nf
|
290
|
-
|
291
|
-
|
292
|
-
|
207
|
+
gem "weakling", platforms: :jruby
|
208
|
+
gem "ruby\-debug", platforms: :mri_31
|
209
|
+
gem "nokogiri", platforms: [:windows_31, :jruby]
|
293
210
|
.fi
|
294
|
-
.
|
295
211
|
.IP "" 0
|
296
|
-
.
|
297
212
|
.P
|
298
|
-
|
299
|
-
.
|
300
|
-
.TP
|
301
|
-
\fBruby\fR
|
302
|
-
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
303
|
-
.
|
304
|
-
.TP
|
305
|
-
\fBmri\fR
|
306
|
-
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
307
|
-
.
|
308
|
-
.TP
|
309
|
-
\fBmingw\fR
|
310
|
-
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
311
|
-
.
|
312
|
-
.TP
|
313
|
-
\fBx64_mingw\fR
|
314
|
-
2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
315
|
-
.
|
213
|
+
All operations involving groups (\fBbundle install\fR \fIbundle\-install\.1\.html\fR, \fBBundler\.setup\fR, \fBBundler\.require\fR) behave exactly the same as if any groups not matching the current platform were explicitly excluded\.
|
316
214
|
.P
|
317
|
-
|
318
|
-
.
|
215
|
+
The following platform values are deprecated and should be replaced with \fBwindows\fR:
|
216
|
+
.IP "\(bu" 4
|
217
|
+
\fBmswin\fR, \fBmswin64\fR, \fBmingw32\fR, \fBx64_mingw\fR
|
218
|
+
.IP "" 0
|
219
|
+
.SS "FORCE_RUBY_PLATFORM"
|
220
|
+
If you always want the pure ruby variant of a gem to be chosen over platform specific variants, you can use the \fBforce_ruby_platform\fR option:
|
319
221
|
.IP "" 4
|
320
|
-
.
|
321
222
|
.nf
|
322
|
-
|
323
|
-
gem "weakling", :platforms => :jruby
|
324
|
-
gem "ruby\-debug", :platforms => :mri_18
|
325
|
-
gem "nokogiri", :platforms => [:mri_18, :jruby]
|
326
|
-
.
|
223
|
+
gem "ffi", force_ruby_platform: true
|
327
224
|
.fi
|
328
|
-
.
|
329
225
|
.IP "" 0
|
330
|
-
.
|
331
226
|
.P
|
332
|
-
|
333
|
-
.
|
227
|
+
This can be handy (assuming the pure ruby variant works fine) when:
|
228
|
+
.IP "\(bu" 4
|
229
|
+
You're having issues with the platform specific variant\.
|
230
|
+
.IP "\(bu" 4
|
231
|
+
The platform specific variant does not yet support a newer ruby (and thus has a \fBrequired_ruby_version\fR upper bound), but you still want your Gemfile{\.lock} files to resolve under that ruby\.
|
232
|
+
.IP "" 0
|
334
233
|
.SS "SOURCE"
|
335
|
-
You can select an alternate
|
336
|
-
.
|
234
|
+
You can select an alternate RubyGems repository for a gem using the ':source' option\.
|
337
235
|
.IP "" 4
|
338
|
-
.
|
339
236
|
.nf
|
340
|
-
|
341
|
-
gem "some_internal_gem", :source => "https://gems\.example\.com"
|
342
|
-
.
|
237
|
+
gem "some_internal_gem", source: "https://gems\.example\.com"
|
343
238
|
.fi
|
344
|
-
.
|
345
239
|
.IP "" 0
|
346
|
-
.
|
347
240
|
.P
|
348
|
-
This forces the gem to be loaded from this source and ignores
|
349
|
-
.
|
241
|
+
This forces the gem to be loaded from this source and ignores the global source declared at the top level of the file\. If the gem does not exist in this source, it will not be installed\.
|
350
242
|
.P
|
351
|
-
Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall back on
|
352
|
-
.
|
243
|
+
Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall back on the global source\.
|
353
244
|
.P
|
354
|
-
Selecting a specific source repository this way also suppresses the ambiguous gem warning described above in \fIGLOBAL
|
355
|
-
.
|
245
|
+
\fBNote about a behavior of the feature deprecated in Bundler 1\.13\fR: Selecting a specific source repository this way also suppresses the ambiguous gem warning described above in \fIGLOBAL SOURCE\fR\.
|
356
246
|
.P
|
357
247
|
Using the \fB:source\fR option for an individual gem will also make that source available as a possible global source for any other gems which do not specify explicit sources\. Thus, when adding gems with explicit sources, it is recommended that you also ensure all other gems in the Gemfile are using explicit sources\.
|
358
|
-
.
|
359
248
|
.SS "GIT"
|
360
249
|
If necessary, you can specify that a gem is located at a particular git repository using the \fB:git\fR parameter\. The repository can be accessed via several protocols:
|
361
|
-
.
|
362
250
|
.TP
|
363
251
|
\fBHTTP(S)\fR
|
364
|
-
gem "rails", :
|
365
|
-
.
|
252
|
+
gem "rails", git: "https://github\.com/rails/rails\.git"
|
366
253
|
.TP
|
367
254
|
\fBSSH\fR
|
368
|
-
gem "rails", :
|
369
|
-
.
|
255
|
+
gem "rails", git: "git@github\.com:rails/rails\.git"
|
370
256
|
.TP
|
371
257
|
\fBgit\fR
|
372
|
-
gem "rails", :
|
373
|
-
.
|
258
|
+
gem "rails", git: "git://github\.com/rails/rails\.git"
|
374
259
|
.P
|
375
260
|
If using SSH, the user that you use to run \fBbundle install\fR \fBMUST\fR have the appropriate keys available in their \fB$HOME/\.ssh\fR\.
|
376
|
-
.
|
377
261
|
.P
|
378
262
|
\fBNOTE\fR: \fBhttp://\fR and \fBgit://\fR URLs should be avoided if at all possible\. These protocols are unauthenticated, so a man\-in\-the\-middle attacker can deliver malicious code and compromise your system\. HTTPS and SSH are strongly preferred\.
|
379
|
-
.
|
380
263
|
.P
|
381
264
|
The \fBgroup\fR, \fBplatforms\fR, and \fBrequire\fR options are available and behave exactly the same as they would for a normal gem\.
|
382
|
-
.
|
383
265
|
.P
|
384
266
|
A git repository \fBSHOULD\fR have at least one file, at the root of the directory containing the gem, with the extension \fB\.gemspec\fR\. This file \fBMUST\fR contain a valid gem specification, as expected by the \fBgem build\fR command\.
|
385
|
-
.
|
386
267
|
.P
|
387
268
|
If a git repository does not have a \fB\.gemspec\fR, bundler will attempt to create one, but it will not contain any dependencies, executables, or C extension compilation instructions\. As a result, it may fail to properly integrate into your application\.
|
388
|
-
.
|
389
269
|
.P
|
390
270
|
If a git repository does have a \fB\.gemspec\fR for the gem you attached it to, a version specifier, if provided, means that the git repository is only valid if the \fB\.gemspec\fR specifies a version matching the version specifier\. If not, bundler will print a warning\.
|
391
|
-
.
|
392
271
|
.IP "" 4
|
393
|
-
.
|
394
272
|
.nf
|
395
|
-
|
396
|
-
gem "rails", "2\.3\.8", :git => "https://github\.com/rails/rails\.git"
|
273
|
+
gem "rails", "2\.3\.8", git: "https://github\.com/rails/rails\.git"
|
397
274
|
# bundle install will fail, because the \.gemspec in the rails
|
398
|
-
# repository
|
399
|
-
.
|
275
|
+
# repository's master branch specifies version 3\.0\.0
|
400
276
|
.fi
|
401
|
-
.
|
402
277
|
.IP "" 0
|
403
|
-
.
|
404
278
|
.P
|
405
279
|
If a git repository does \fBnot\fR have a \fB\.gemspec\fR for the gem you attached it to, a version specifier \fBMUST\fR be provided\. Bundler will use this version in the simple \fB\.gemspec\fR it creates\.
|
406
|
-
.
|
407
280
|
.P
|
408
281
|
Git repositories support a number of additional options\.
|
409
|
-
.
|
410
282
|
.TP
|
411
283
|
\fBbranch\fR, \fBtag\fR, and \fBref\fR
|
412
|
-
You \fBMUST\fR only specify at most one of these options\. The default is \
|
413
|
-
.
|
284
|
+
You \fBMUST\fR only specify at most one of these options\. The default is \fBbranch: "master"\fR\. For example:
|
414
285
|
.IP
|
415
|
-
gem "rails", :
|
416
|
-
.
|
286
|
+
gem "rails", git: "https://github\.com/rails/rails\.git", branch: "5\-0\-stable"
|
417
287
|
.IP
|
418
|
-
gem "rails", :
|
419
|
-
.
|
288
|
+
gem "rails", git: "https://github\.com/rails/rails\.git", tag: "v5\.0\.0"
|
420
289
|
.IP
|
421
|
-
gem "rails", :
|
422
|
-
.
|
290
|
+
gem "rails", git: "https://github\.com/rails/rails\.git", ref: "4aded"
|
423
291
|
.TP
|
424
292
|
\fBsubmodules\fR
|
425
|
-
For reference, a git submodule \fIhttps://git\-scm\.com/book/en/v2/Git\-Tools\-Submodules\fR lets you have another git repository within a subfolder of your repository\. Specify \
|
426
|
-
.
|
293
|
+
For reference, a git submodule \fIhttps://git\-scm\.com/book/en/v2/Git\-Tools\-Submodules\fR lets you have another git repository within a subfolder of your repository\. Specify \fBsubmodules: true\fR to cause bundler to expand any submodules included in the git repository
|
427
294
|
.P
|
428
295
|
If a git repository contains multiple \fB\.gemspecs\fR, each \fB\.gemspec\fR represents a gem located at the same place in the file system as the \fB\.gemspec\fR\.
|
429
|
-
.
|
430
296
|
.IP "" 4
|
431
|
-
.
|
432
297
|
.nf
|
433
|
-
|
434
298
|
|~rails [git root]
|
435
299
|
| |\-rails\.gemspec [rails gem located here]
|
436
300
|
|~actionpack
|
437
301
|
| |\-actionpack\.gemspec [actionpack gem located here]
|
438
302
|
|~activesupport
|
439
303
|
| |\-activesupport\.gemspec [activesupport gem located here]
|
440
|
-
|
441
|
-
.
|
304
|
+
|\|\.\|\.\|\.
|
442
305
|
.fi
|
443
|
-
.
|
444
306
|
.IP "" 0
|
445
|
-
.
|
446
307
|
.P
|
447
308
|
To install a gem located in a git repository, bundler changes to the directory containing the gemspec, runs \fBgem build name\.gemspec\fR and then installs the resulting gem\. The \fBgem build\fR command, which comes standard with Rubygems, evaluates the \fB\.gemspec\fR in the context of the directory in which it is located\.
|
448
|
-
.
|
449
309
|
.SS "GIT SOURCE"
|
450
|
-
A custom git source can be defined via the \fBgit_source\fR method\. Provide the source
|
451
|
-
.
|
310
|
+
A custom git source can be defined via the \fBgit_source\fR method\. Provide the source's name as an argument, and a block which receives a single argument and interpolates it into a string to return the full repo address:
|
452
311
|
.IP "" 4
|
453
|
-
.
|
454
312
|
.nf
|
455
|
-
|
456
313
|
git_source(:stash){ |repo_name| "https://stash\.corp\.acme\.pl/#{repo_name}\.git" }
|
457
|
-
gem
|
458
|
-
.
|
314
|
+
gem 'rails', stash: 'forks/rails'
|
459
315
|
.fi
|
460
|
-
.
|
461
316
|
.IP "" 0
|
462
|
-
.
|
463
317
|
.P
|
464
318
|
In addition, if you wish to choose a specific branch:
|
465
|
-
.
|
466
319
|
.IP "" 4
|
467
|
-
.
|
468
320
|
.nf
|
469
|
-
|
470
|
-
gem "rails", :stash => "forks/rails", :branch => "branch_name"
|
471
|
-
.
|
321
|
+
gem "rails", stash: "forks/rails", branch: "branch_name"
|
472
322
|
.fi
|
473
|
-
.
|
474
323
|
.IP "" 0
|
475
|
-
.
|
476
324
|
.SS "GITHUB"
|
477
325
|
\fBNOTE\fR: This shorthand should be avoided until Bundler 2\.0, since it currently expands to an insecure \fBgit://\fR URL\. This allows a man\-in\-the\-middle attacker to compromise your system\.
|
478
|
-
.
|
479
326
|
.P
|
480
327
|
If the git repository you want to use is hosted on GitHub and is public, you can use the :github shorthand to specify the github username and repository name (without the trailing "\.git"), separated by a slash\. If both the username and repository name are the same, you can omit one\.
|
481
|
-
.
|
482
328
|
.IP "" 4
|
483
|
-
.
|
484
329
|
.nf
|
485
|
-
|
486
|
-
gem "rails", :
|
487
|
-
gem "rails", :github => "rails"
|
488
|
-
.
|
330
|
+
gem "rails", github: "rails/rails"
|
331
|
+
gem "rails", github: "rails"
|
489
332
|
.fi
|
490
|
-
.
|
491
333
|
.IP "" 0
|
492
|
-
.
|
493
334
|
.P
|
494
335
|
Are both equivalent to
|
495
|
-
.
|
496
336
|
.IP "" 4
|
497
|
-
.
|
498
337
|
.nf
|
499
|
-
|
500
|
-
gem "rails", :git => "git://github\.com/rails/rails\.git"
|
501
|
-
.
|
338
|
+
gem "rails", git: "https://github\.com/rails/rails\.git"
|
502
339
|
.fi
|
503
|
-
.
|
504
340
|
.IP "" 0
|
505
|
-
.
|
506
341
|
.P
|
507
342
|
Since the \fBgithub\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
508
|
-
.
|
343
|
+
.P
|
344
|
+
You can also directly pass a pull request URL:
|
345
|
+
.IP "" 4
|
346
|
+
.nf
|
347
|
+
gem "rails", github: "https://github\.com/rails/rails/pull/43753"
|
348
|
+
.fi
|
349
|
+
.IP "" 0
|
350
|
+
.P
|
351
|
+
Which is equivalent to:
|
352
|
+
.IP "" 4
|
353
|
+
.nf
|
354
|
+
gem "rails", github: "rails/rails", branch: "refs/pull/43753/head"
|
355
|
+
.fi
|
356
|
+
.IP "" 0
|
509
357
|
.SS "GIST"
|
510
|
-
If the git repository you want to use is hosted as a
|
511
|
-
.
|
358
|
+
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use the :gist shorthand to specify the gist identifier (without the trailing "\.git")\.
|
512
359
|
.IP "" 4
|
513
|
-
.
|
514
360
|
.nf
|
515
|
-
|
516
|
-
gem "the_hatch", :gist => "4815162342"
|
517
|
-
.
|
361
|
+
gem "the_hatch", gist: "4815162342"
|
518
362
|
.fi
|
519
|
-
.
|
520
363
|
.IP "" 0
|
521
|
-
.
|
522
364
|
.P
|
523
365
|
Is equivalent to:
|
524
|
-
.
|
525
366
|
.IP "" 4
|
526
|
-
.
|
527
367
|
.nf
|
528
|
-
|
529
|
-
gem "the_hatch", :git => "https://gist\.github\.com/4815162342\.git"
|
530
|
-
.
|
368
|
+
gem "the_hatch", git: "https://gist\.github\.com/4815162342\.git"
|
531
369
|
.fi
|
532
|
-
.
|
533
370
|
.IP "" 0
|
534
|
-
.
|
535
371
|
.P
|
536
372
|
Since the \fBgist\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
537
|
-
.
|
538
373
|
.SS "BITBUCKET"
|
539
374
|
If the git repository you want to use is hosted on Bitbucket and is public, you can use the :bitbucket shorthand to specify the bitbucket username and repository name (without the trailing "\.git"), separated by a slash\. If both the username and repository name are the same, you can omit one\.
|
540
|
-
.
|
541
375
|
.IP "" 4
|
542
|
-
.
|
543
376
|
.nf
|
544
|
-
|
545
|
-
gem "rails", :
|
546
|
-
gem "rails", :bitbucket => "rails"
|
547
|
-
.
|
377
|
+
gem "rails", bitbucket: "rails/rails"
|
378
|
+
gem "rails", bitbucket: "rails"
|
548
379
|
.fi
|
549
|
-
.
|
550
380
|
.IP "" 0
|
551
|
-
.
|
552
381
|
.P
|
553
382
|
Are both equivalent to
|
554
|
-
.
|
555
383
|
.IP "" 4
|
556
|
-
.
|
557
384
|
.nf
|
558
|
-
|
559
|
-
gem "rails", :git => "https://rails@bitbucket\.org/rails/rails\.git"
|
560
|
-
.
|
385
|
+
gem "rails", git: "https://rails@bitbucket\.org/rails/rails\.git"
|
561
386
|
.fi
|
562
|
-
.
|
563
387
|
.IP "" 0
|
564
|
-
.
|
565
388
|
.P
|
566
389
|
Since the \fBbitbucket\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
567
|
-
.
|
568
390
|
.SS "PATH"
|
569
391
|
You can specify that a gem is located in a particular location on the file system\. Relative paths are resolved relative to the directory containing the \fBGemfile\fR\.
|
570
|
-
.
|
571
392
|
.P
|
572
393
|
Similar to the semantics of the \fB:git\fR option, the \fB:path\fR option requires that the directory in question either contains a \fB\.gemspec\fR for the gem, or that you specify an explicit version that bundler should use\.
|
573
|
-
.
|
574
394
|
.P
|
575
395
|
Unlike \fB:git\fR, bundler does not compile C extensions for gems specified as paths\.
|
576
|
-
.
|
577
396
|
.IP "" 4
|
578
|
-
.
|
579
397
|
.nf
|
580
|
-
|
581
|
-
gem "rails", :path => "vendor/rails"
|
582
|
-
.
|
398
|
+
gem "rails", path: "vendor/rails"
|
583
399
|
.fi
|
584
|
-
.
|
585
400
|
.IP "" 0
|
586
|
-
.
|
587
401
|
.P
|
588
|
-
If you would like to use multiple local gems directly from the filesystem, you can set a global \fBpath\fR option to the path containing the gem
|
589
|
-
.
|
402
|
+
If you would like to use multiple local gems directly from the filesystem, you can set a global \fBpath\fR option to the path containing the gem's files\. This will automatically load gemspec files from subdirectories\.
|
590
403
|
.IP "" 4
|
591
|
-
.
|
592
404
|
.nf
|
593
|
-
|
594
|
-
|
595
|
-
gem
|
596
|
-
gem \'public_ui\'
|
405
|
+
path 'components' do
|
406
|
+
gem 'admin_ui'
|
407
|
+
gem 'public_ui'
|
597
408
|
end
|
598
|
-
.
|
599
409
|
.fi
|
600
|
-
.
|
601
410
|
.IP "" 0
|
602
|
-
.
|
603
411
|
.SH "BLOCK FORM OF SOURCE, GIT, PATH, GROUP and PLATFORMS"
|
604
412
|
The \fB:source\fR, \fB:git\fR, \fB:path\fR, \fB:group\fR, and \fB:platforms\fR options may be applied to a group of gems by using block form\.
|
605
|
-
.
|
606
413
|
.IP "" 4
|
607
|
-
.
|
608
414
|
.nf
|
609
|
-
|
610
415
|
source "https://gems\.example\.com" do
|
611
416
|
gem "some_internal_gem"
|
612
417
|
gem "another_internal_gem"
|
@@ -622,65 +427,44 @@ platforms :ruby do
|
|
622
427
|
gem "sqlite3"
|
623
428
|
end
|
624
429
|
|
625
|
-
group :development, :
|
430
|
+
group :development, optional: true do
|
626
431
|
gem "wirble"
|
627
432
|
gem "faker"
|
628
433
|
end
|
629
|
-
.
|
630
434
|
.fi
|
631
|
-
.
|
632
435
|
.IP "" 0
|
633
|
-
.
|
634
436
|
.P
|
635
437
|
In the case of the group block form the :optional option can be given to prevent a group from being installed unless listed in the \fB\-\-with\fR option given to the \fBbundle install\fR command\.
|
636
|
-
.
|
637
438
|
.P
|
638
439
|
In the case of the \fBgit\fR block form, the \fB:ref\fR, \fB:branch\fR, \fB:tag\fR, and \fB:submodules\fR options may be passed to the \fBgit\fR method, and all gems in the block will inherit those options\.
|
639
|
-
.
|
640
440
|
.P
|
641
441
|
The presence of a \fBsource\fR block in a Gemfile also makes that source available as a possible global source for any other gems which do not specify explicit sources\. Thus, when defining source blocks, it is recommended that you also ensure all other gems in the Gemfile are using explicit sources, either via source blocks or \fB:source\fR directives on individual gems\.
|
642
|
-
.
|
643
442
|
.SH "INSTALL_IF"
|
644
443
|
The \fBinstall_if\fR method allows gems to be installed based on a proc or lambda\. This is especially useful for optional gems that can only be used if certain software is installed or some other conditions are met\.
|
645
|
-
.
|
646
444
|
.IP "" 4
|
647
|
-
.
|
648
445
|
.nf
|
649
|
-
|
650
446
|
install_if \-> { RUBY_PLATFORM =~ /darwin/ } do
|
651
447
|
gem "pasteboard"
|
652
448
|
end
|
653
|
-
.
|
654
449
|
.fi
|
655
|
-
.
|
656
450
|
.IP "" 0
|
657
|
-
.
|
658
451
|
.SH "GEMSPEC"
|
659
|
-
The \fB\.gemspec\fR \
|
660
|
-
.
|
452
|
+
The \fB\.gemspec\fR \fIhttps://guides\.rubygems\.org/specification\-reference/\fR file is where you provide metadata about your gem to Rubygems\. Some required Gemspec attributes include the name, description, and homepage of your gem\. This is also where you specify the dependencies your gem needs to run\.
|
661
453
|
.P
|
662
454
|
If you wish to use Bundler to help install dependencies for a gem while it is being developed, use the \fBgemspec\fR method to pull in the dependencies listed in the \fB\.gemspec\fR file\.
|
663
|
-
.
|
664
455
|
.P
|
665
|
-
The \fBgemspec\fR method adds any runtime dependencies as gem requirements in the default group\. It also adds development dependencies as gem requirements in the \fBdevelopment\fR group\. Finally, it adds a gem requirement on your project (\
|
666
|
-
.
|
456
|
+
The \fBgemspec\fR method adds any runtime dependencies as gem requirements in the default group\. It also adds development dependencies as gem requirements in the \fBdevelopment\fR group\. Finally, it adds a gem requirement on your project (\fBpath: '\.'\fR)\. In conjunction with \fBBundler\.setup\fR, this allows you to require project files in your test code as you would if the project were installed as a gem; you need not manipulate the load path manually or require project files via relative paths\.
|
667
457
|
.P
|
668
|
-
The \fBgemspec\fR method supports optional \fB:path\fR, \fB:glob\fR, \fB:name\fR, and \fB:development_group\fR options, which control where bundler looks for the \fB\.gemspec\fR, the glob it uses to look for the gemspec (defaults to:
|
669
|
-
.
|
458
|
+
The \fBgemspec\fR method supports optional \fB:path\fR, \fB:glob\fR, \fB:name\fR, and \fB:development_group\fR options, which control where bundler looks for the \fB\.gemspec\fR, the glob it uses to look for the gemspec (defaults to: \fB{,*,*/*}\.gemspec\fR), what named \fB\.gemspec\fR it uses (if more than one is present), and which group development dependencies are included in\.
|
670
459
|
.P
|
671
460
|
When a \fBgemspec\fR dependency encounters version conflicts during resolution, the local version under development will always be selected \-\- even if there are remote versions that better match other requirements for the \fBgemspec\fR gem\.
|
672
|
-
.
|
673
461
|
.SH "SOURCE PRIORITY"
|
674
462
|
When attempting to locate a gem to satisfy a gem requirement, bundler uses the following priority order:
|
675
|
-
.
|
676
463
|
.IP "1." 4
|
677
464
|
The source explicitly attached to the gem (using \fB:source\fR, \fB:path\fR, or \fB:git\fR)
|
678
|
-
.
|
679
465
|
.IP "2." 4
|
680
466
|
For implicit gems (dependencies of explicit gems), any source, git, or path repository declared on the parent\. This results in bundler prioritizing the ActiveSupport gem from the Rails git repository over ones from \fBrubygems\.org\fR
|
681
|
-
.
|
682
467
|
.IP "3." 4
|
683
|
-
|
684
|
-
.
|
468
|
+
If neither of the above conditions are met, the global source will be used\. If multiple global sources are specified, they will be prioritized from last to first, but this is deprecated since Bundler 1\.13, so Bundler prints a warning and will abort with an error in the future\.
|
685
469
|
.IP "" 0
|
686
470
|
|