summaryrefslogtreecommitdiff
path: root/lib/bundler/man/gemfile.5.ronn
diff options
context:
space:
mode:
authorTakuya Noguchi <takninnovationresearch@gmail.com>2022-07-17 13:07:09 +0000
committergit <svn-admin@ruby-lang.org>2022-07-20 19:45:08 +0900
commitcbaf58d45564c17135595b549d4a0369f0e5a008 (patch)
tree10dcb0e2528d75c54946bd50c9cb374ddafc7433 /lib/bundler/man/gemfile.5.ronn
parent472740de4184c214dfaaf6189fe3bb1b17a15ecc (diff)
[rubygems/rubygems] Bundler: update primary source in man 5 gemfile
Specifying multiple primary sources in top-level was deprecated in Bundler 1.13. As Bundler CLI uses primary source instead of global, "global source" is replaced with "primary source". Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com> https://github.com/rubygems/rubygems/commit/1dd1753f6e
Diffstat (limited to 'lib/bundler/man/gemfile.5.ronn')
-rw-r--r--lib/bundler/man/gemfile.5.ronn39
1 files changed, 23 insertions, 16 deletions
diff --git a/lib/bundler/man/gemfile.5.ronn b/lib/bundler/man/gemfile.5.ronn
index e23e1d49df..c2f9141c65 100644
--- a/lib/bundler/man/gemfile.5.ronn
+++ b/lib/bundler/man/gemfile.5.ronn
@@ -15,23 +15,28 @@ directory as the `Rakefile`.
A `Gemfile` is evaluated as Ruby code, in a context which makes available
a number of methods used to describe the gem requirements.
-## GLOBAL SOURCES
+## GLOBAL SOURCE
-At the top of the `Gemfile`, add a line for the `Rubygems` source that contains
-the gems listed in the `Gemfile`.
+At the top of the `Gemfile`, add a single line for the `RubyGems` source that
+contains the gems listed in the `Gemfile`.
source "https://rubygems.org"
-It is possible, but not recommended as of Bundler 1.7, to add multiple global
-`source` lines. Each of these `source`s `MUST` be a valid Rubygems repository.
+You can add only one global source. In Bundler 1.13, adding multiple global
+sources was deprecated. The `source` `MUST` be a valid RubyGems repository.
-Sources are checked for gems following the heuristics described in
-[SOURCE PRIORITY][]. If a gem is found in more than one global source, Bundler
+To use more than one source of RubyGems, you should use [`source` block
+](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
+
+A source is checked for gems following the heuristics described in
+[SOURCE PRIORITY][].
+
+**Note about a behavior of the feature deprecated in Bundler 1.13**:
+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 [`:source` option](#SOURCE) or a
-[`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
+this warning, by using the [`:source` option](#SOURCE) or `source` block.
### CREDENTIALS
@@ -247,22 +252,22 @@ This can be handy (assuming the pure ruby variant works fine) when:
### SOURCE
-You can select an alternate Rubygems repository for a gem using the ':source'
+You can select an alternate RubyGems repository for a gem using the ':source'
option.
gem "some_internal_gem", source: "https://gems.example.com"
-This forces the gem to be loaded from this source and ignores any global sources
+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.
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 global sources using the ordering described in [SOURCE PRIORITY][].
+back on the global source.
+**Note about a behavior of the feature deprecated in Bundler 1.13**:
Selecting a specific source repository this way also suppresses the ambiguous
-gem warning described above in
-[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
+gem warning described above in [GLOBAL SOURCE](#GLOBAL-SOURCE).
Using the `:source` option for an individual gem will also make that source
available as a possible global source for any other gems which do not specify
@@ -535,5 +540,7 @@ bundler uses the following priority order:
repository declared on the parent. This results in bundler prioritizing the
ActiveSupport gem from the Rails git repository over ones from
`rubygems.org`
- 3. The sources specified via global `source` lines, searching each source in
- your `Gemfile` from last added to first added.
+ 3. 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.