bundler 2.2.11 → 2.3.26
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 +721 -5
- data/README.md +1 -1
- data/bundler.gemspec +8 -11
- data/exe/bundle +7 -8
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/common.rb +17 -3
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/doctor.rb +24 -5
- data/lib/bundler/cli/exec.rb +1 -6
- data/lib/bundler/cli/gem.rb +130 -26
- data/lib/bundler/cli/info.rb +27 -6
- data/lib/bundler/cli/init.rb +5 -1
- data/lib/bundler/cli/install.rb +23 -54
- data/lib/bundler/cli/issue.rb +4 -3
- data/lib/bundler/cli/list.rb +7 -1
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +22 -14
- data/lib/bundler/cli/platform.rb +2 -2
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +17 -8
- data/lib/bundler/cli.rb +51 -63
- data/lib/bundler/compact_index_client/cache.rb +0 -9
- data/lib/bundler/compact_index_client/updater.rb +26 -14
- data/lib/bundler/compact_index_client.rb +2 -8
- data/lib/bundler/current_ruby.rb +17 -6
- data/lib/bundler/definition.rb +260 -362
- data/lib/bundler/dependency.rb +23 -71
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +72 -76
- data/lib/bundler/endpoint_specification.rb +19 -13
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/environment_preserver.rb +4 -1
- data/lib/bundler/errors.rb +29 -3
- data/lib/bundler/feature_flag.rb +0 -5
- data/lib/bundler/fetcher/base.rb +6 -8
- data/lib/bundler/fetcher/compact_index.rb +10 -15
- data/lib/bundler/fetcher/downloader.rb +9 -6
- data/lib/bundler/fetcher/index.rb +0 -27
- data/lib/bundler/fetcher.rb +22 -23
- data/lib/bundler/friendly_errors.rb +26 -36
- data/lib/bundler/gem_helper.rb +21 -16
- data/lib/bundler/gem_helpers.rb +9 -2
- data/lib/bundler/gem_version_promoter.rb +14 -25
- data/lib/bundler/index.rb +11 -46
- data/lib/bundler/injector.rb +18 -4
- data/lib/bundler/inline.rb +4 -13
- data/lib/bundler/installer/gem_installer.rb +16 -21
- data/lib/bundler/installer/parallel_installer.rb +36 -15
- data/lib/bundler/installer/standalone.rb +42 -10
- data/lib/bundler/installer.rb +25 -41
- data/lib/bundler/lazy_specification.rb +52 -30
- data/lib/bundler/lockfile_generator.rb +2 -2
- data/lib/bundler/lockfile_parser.rb +18 -43
- data/lib/bundler/man/bundle-add.1 +21 -5
- data/lib/bundler/man/bundle-add.1.ronn +16 -4
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +7 -1
- data/lib/bundler/man/bundle-cache.1.ronn +7 -0
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +2 -2
- data/lib/bundler/man/bundle-clean.1.ronn +1 -1
- data/lib/bundler/man/bundle-config.1 +49 -22
- data/lib/bundler/man/bundle-config.1.ronn +49 -30
- data/lib/bundler/man/bundle-console.1 +53 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +2 -2
- data/lib/bundler/man/bundle-exec.1.ronn +1 -1
- data/lib/bundler/man/bundle-gem.1 +14 -1
- data/lib/bundler/man/bundle-gem.1.ronn +16 -0
- data/lib/bundler/man/bundle-help.1 +13 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +5 -2
- data/lib/bundler/man/bundle-inject.1.ronn +3 -1
- data/lib/bundler/man/bundle-install.1 +6 -2
- data/lib/bundler/man/bundle-install.1.ronn +8 -2
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +3 -10
- data/lib/bundler/man/bundle-outdated.1.ronn +1 -10
- data/lib/bundler/man/bundle-platform.1 +16 -6
- data/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/lib/bundler/man/bundle-plugin.1 +81 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +5 -5
- data/lib/bundler/man/bundle-update.1.ronn +5 -4
- data/lib/bundler/man/bundle-version.1 +35 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/lib/bundler/man/bundle-viz.1 +4 -1
- data/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/lib/bundler/man/bundle.1 +15 -10
- data/lib/bundler/man/bundle.1.ronn +12 -7
- data/lib/bundler/man/gemfile.5 +117 -80
- data/lib/bundler/man/gemfile.5.ronn +105 -84
- data/lib/bundler/man/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +0 -1
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/plugin/api/source.rb +24 -8
- data/lib/bundler/plugin/index.rb +4 -1
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +0 -4
- data/lib/bundler/plugin/installer.rb +10 -10
- data/lib/bundler/plugin/source_list.rb +4 -0
- data/lib/bundler/plugin.rb +30 -8
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +10 -4
- data/lib/bundler/resolver/base.rb +50 -0
- data/lib/bundler/resolver/spec_group.rb +31 -73
- data/lib/bundler/resolver.rb +193 -292
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +5 -18
- data/lib/bundler/rubygems_ext.rb +160 -26
- data/lib/bundler/rubygems_gem_installer.rb +86 -9
- data/lib/bundler/rubygems_integration.rb +46 -93
- data/lib/bundler/runtime.rb +18 -12
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +98 -22
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +15 -31
- data/lib/bundler/source/git/git_proxy.rb +8 -6
- data/lib/bundler/source/git.rb +29 -13
- data/lib/bundler/source/metadata.rb +3 -7
- data/lib/bundler/source/path/installer.rb +1 -1
- data/lib/bundler/source/path.rb +3 -1
- data/lib/bundler/source/rubygems.rb +199 -182
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +24 -4
- data/lib/bundler/source_list.rb +104 -60
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +58 -52
- data/lib/bundler/stub_specification.rb +13 -3
- data/lib/bundler/templates/Executable +2 -4
- data/lib/bundler/templates/Executable.bundler +8 -8
- data/lib/bundler/templates/Executable.standalone +2 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
- data/lib/bundler/templates/newgem/README.md.tt +8 -12
- data/lib/bundler/templates/newgem/Rakefile.tt +15 -2
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +16 -7
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +5 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +19 -17
- 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/shell.rb +1 -1
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +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 +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +32 -26
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +22 -4
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
- data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +19 -4
- data/lib/bundler.rb +46 -39
- metadata +39 -12
- 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/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
|
@@ -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,10 @@ 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"
|
|
66
71
|
|
|
67
72
|
### ENGINE
|
|
68
73
|
|
|
@@ -81,9 +86,10 @@ What exactly is an Engine?
|
|
|
81
86
|
|
|
82
87
|
- [Other implementations](https://www.ruby-lang.org/en/about/) of Ruby exist.
|
|
83
88
|
Some of the more well-known implementations include
|
|
84
|
-
[
|
|
89
|
+
[JRuby](http://jruby.org/) and [TruffleRuby](https://www.graalvm.org/ruby/).
|
|
85
90
|
Rubinius is an alternative implementation of Ruby written in Ruby.
|
|
86
91
|
JRuby is an implementation of Ruby on the JVM, short for Java Virtual Machine.
|
|
92
|
+
TruffleRuby is a Ruby implementation on the GraalVM, a language toolkit built on the JVM.
|
|
87
93
|
|
|
88
94
|
### ENGINE VERSION
|
|
89
95
|
|
|
@@ -91,13 +97,17 @@ Each application _may_ specify a Ruby engine version. If an engine version is
|
|
|
91
97
|
specified, an engine _must_ also be specified. If the engine is "ruby" the
|
|
92
98
|
engine version specified _must_ match the Ruby version.
|
|
93
99
|
|
|
94
|
-
ruby "
|
|
100
|
+
ruby "2.6.8", engine: "jruby", engine_version: "9.3.8.0"
|
|
95
101
|
|
|
96
102
|
### PATCHLEVEL
|
|
97
103
|
|
|
98
|
-
Each application _may_ specify a Ruby patchlevel.
|
|
104
|
+
Each application _may_ specify a Ruby patchlevel. Specifying the patchlevel has
|
|
105
|
+
been meaningless since Ruby 2.1.0 was released as the patchlevel is now
|
|
106
|
+
uniquely determined by a combination of major, minor, and teeny version numbers.
|
|
107
|
+
|
|
108
|
+
This option was implemented in Bundler 1.4.0 for Ruby 2.0 or earlier.
|
|
99
109
|
|
|
100
|
-
ruby "
|
|
110
|
+
ruby "3.1.2", patchlevel: "20"
|
|
101
111
|
|
|
102
112
|
## GEMS
|
|
103
113
|
|
|
@@ -124,23 +134,23 @@ Each _gem_ `MAY` specify files that should be used when autorequiring via
|
|
|
124
134
|
you want `required` has the same name as _gem_ or `false` to
|
|
125
135
|
prevent any file from being autorequired.
|
|
126
136
|
|
|
127
|
-
gem "redis", :
|
|
128
|
-
gem "webmock", :
|
|
129
|
-
gem "byebug", :
|
|
137
|
+
gem "redis", require: ["redis/connection/hiredis", "redis"]
|
|
138
|
+
gem "webmock", require: false
|
|
139
|
+
gem "byebug", require: true
|
|
130
140
|
|
|
131
141
|
The argument defaults to the name of the gem. For example, these are identical:
|
|
132
142
|
|
|
133
143
|
gem "nokogiri"
|
|
134
|
-
gem "nokogiri", :
|
|
135
|
-
gem "nokogiri", :
|
|
144
|
+
gem "nokogiri", require: "nokogiri"
|
|
145
|
+
gem "nokogiri", require: true
|
|
136
146
|
|
|
137
147
|
### GROUPS
|
|
138
148
|
|
|
139
149
|
Each _gem_ `MAY` specify membership in one or more groups. Any _gem_ that does
|
|
140
150
|
not specify membership in any group is placed in the `default` group.
|
|
141
151
|
|
|
142
|
-
gem "rspec", :
|
|
143
|
-
gem "wirble", :
|
|
152
|
+
gem "rspec", group: :test
|
|
153
|
+
gem "wirble", groups: [:development, :test]
|
|
144
154
|
|
|
145
155
|
The Bundler runtime allows its two main methods, `Bundler.setup` and
|
|
146
156
|
`Bundler.require`, to limit their impact to particular groups.
|
|
@@ -185,70 +195,71 @@ platforms.
|
|
|
185
195
|
There are a number of `Gemfile` platforms:
|
|
186
196
|
|
|
187
197
|
* `ruby`:
|
|
188
|
-
C Ruby (MRI), Rubinius or TruffleRuby, but
|
|
198
|
+
C Ruby (MRI), Rubinius, or TruffleRuby, but not Windows
|
|
189
199
|
* `mri`:
|
|
190
|
-
|
|
191
|
-
* `
|
|
192
|
-
Windows 32
|
|
193
|
-
* `
|
|
194
|
-
Windows
|
|
200
|
+
C Ruby (MRI) only, but not Windows
|
|
201
|
+
* `windows`:
|
|
202
|
+
Windows C Ruby (MRI), including RubyInstaller 32-bit and 64-bit versions
|
|
203
|
+
* `mswin`:
|
|
204
|
+
Windows C Ruby (MRI), including RubyInstaller 32-bit versions
|
|
205
|
+
* `mswin64`:
|
|
206
|
+
Windows C Ruby (MRI), including RubyInstaller 64-bit versions
|
|
195
207
|
* `rbx`:
|
|
196
208
|
Rubinius
|
|
197
209
|
* `jruby`:
|
|
198
210
|
JRuby
|
|
199
211
|
* `truffleruby`:
|
|
200
212
|
TruffleRuby
|
|
201
|
-
* `mswin`:
|
|
202
|
-
Windows
|
|
203
213
|
|
|
204
|
-
|
|
205
|
-
|
|
214
|
+
On platforms `ruby`, `mri`, `mswin`, `mswin64`, and `windows`, you may
|
|
215
|
+
additionally specify a version by appending the major and minor version numbers
|
|
216
|
+
without a delimiter. For example, to specify that a gem should only be used on
|
|
217
|
+
platform `ruby` version 3.1, use:
|
|
206
218
|
|
|
207
|
-
|
|
208
|
-
the delimiter to the platform. For example, to specify that a gem should only be
|
|
209
|
-
used on platforms with Ruby 2.3, use:
|
|
210
|
-
|
|
211
|
-
ruby_23
|
|
212
|
-
|
|
213
|
-
The full list of platforms and supported versions includes:
|
|
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
|
|
219
|
+
ruby_31
|
|
223
220
|
|
|
224
|
-
As with groups, you
|
|
221
|
+
As with groups (above), you may specify one or more platforms:
|
|
225
222
|
|
|
226
|
-
gem "weakling", :
|
|
227
|
-
gem "ruby-debug", :
|
|
228
|
-
gem "nokogiri", :
|
|
223
|
+
gem "weakling", platforms: :jruby
|
|
224
|
+
gem "ruby-debug", platforms: :mri_31
|
|
225
|
+
gem "nokogiri", platforms: [:windows_31, :jruby]
|
|
229
226
|
|
|
230
227
|
All operations involving groups ([`bundle install`](bundle-install.1.html), `Bundler.setup`,
|
|
231
228
|
`Bundler.require`) behave exactly the same as if any groups not
|
|
232
229
|
matching the current platform were explicitly excluded.
|
|
233
230
|
|
|
231
|
+
### FORCE_RUBY_PLATFORM
|
|
232
|
+
|
|
233
|
+
If you always want the pure ruby variant of a gem to be chosen over platform
|
|
234
|
+
specific variants, you can use the `force_ruby_platform` option:
|
|
235
|
+
|
|
236
|
+
gem "ffi", force_ruby_platform: true
|
|
237
|
+
|
|
238
|
+
This can be handy (assuming the pure ruby variant works fine) when:
|
|
239
|
+
|
|
240
|
+
* You're having issues with the platform specific variant.
|
|
241
|
+
* The platform specific variant does not yet support a newer ruby (and thus has
|
|
242
|
+
a `required_ruby_version` upper bound), but you still want your Gemfile{.lock}
|
|
243
|
+
files to resolve under that ruby.
|
|
244
|
+
|
|
234
245
|
### SOURCE
|
|
235
246
|
|
|
236
|
-
You can select an alternate
|
|
247
|
+
You can select an alternate RubyGems repository for a gem using the ':source'
|
|
237
248
|
option.
|
|
238
249
|
|
|
239
|
-
gem "some_internal_gem", :
|
|
250
|
+
gem "some_internal_gem", source: "https://gems.example.com"
|
|
240
251
|
|
|
241
|
-
This forces the gem to be loaded from this source and ignores
|
|
252
|
+
This forces the gem to be loaded from this source and ignores the global source
|
|
242
253
|
declared at the top level of the file. If the gem does not exist in this source,
|
|
243
254
|
it will not be installed.
|
|
244
255
|
|
|
245
256
|
Bundler will search for child dependencies of this gem by first looking in the
|
|
246
257
|
source selected for the parent, but if they are not found there, it will fall
|
|
247
|
-
back on
|
|
258
|
+
back on the global source.
|
|
248
259
|
|
|
260
|
+
**Note about a behavior of the feature deprecated in Bundler 1.13**:
|
|
249
261
|
Selecting a specific source repository this way also suppresses the ambiguous
|
|
250
|
-
gem warning described above in
|
|
251
|
-
[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
|
|
262
|
+
gem warning described above in [GLOBAL SOURCE](#GLOBAL-SOURCE).
|
|
252
263
|
|
|
253
264
|
Using the `:source` option for an individual gem will also make that source
|
|
254
265
|
available as a possible global source for any other gems which do not specify
|
|
@@ -263,11 +274,11 @@ git repository using the `:git` parameter. The repository can be accessed via
|
|
|
263
274
|
several protocols:
|
|
264
275
|
|
|
265
276
|
* `HTTP(S)`:
|
|
266
|
-
gem "rails", :
|
|
277
|
+
gem "rails", git: "https://github.com/rails/rails.git"
|
|
267
278
|
* `SSH`:
|
|
268
|
-
gem "rails", :
|
|
279
|
+
gem "rails", git: "git@github.com:rails/rails.git"
|
|
269
280
|
* `git`:
|
|
270
|
-
gem "rails", :
|
|
281
|
+
gem "rails", git: "git://github.com/rails/rails.git"
|
|
271
282
|
|
|
272
283
|
If using SSH, the user that you use to run `bundle install` `MUST` have the
|
|
273
284
|
appropriate keys available in their `$HOME/.ssh`.
|
|
@@ -295,7 +306,7 @@ to, a version specifier, if provided, means that the git repository is
|
|
|
295
306
|
only valid if the `.gemspec` specifies a version matching the version
|
|
296
307
|
specifier. If not, bundler will print a warning.
|
|
297
308
|
|
|
298
|
-
gem "rails", "2.3.8", :
|
|
309
|
+
gem "rails", "2.3.8", git: "https://github.com/rails/rails.git"
|
|
299
310
|
# bundle install will fail, because the .gemspec in the rails
|
|
300
311
|
# repository's master branch specifies version 3.0.0
|
|
301
312
|
|
|
@@ -307,18 +318,18 @@ Git repositories support a number of additional options.
|
|
|
307
318
|
|
|
308
319
|
* `branch`, `tag`, and `ref`:
|
|
309
320
|
You `MUST` only specify at most one of these options. The default
|
|
310
|
-
is
|
|
321
|
+
is `branch: "master"`. For example:
|
|
311
322
|
|
|
312
|
-
gem "rails", :
|
|
323
|
+
gem "rails", git: "https://github.com/rails/rails.git", branch: "5-0-stable"
|
|
313
324
|
|
|
314
|
-
gem "rails", :
|
|
325
|
+
gem "rails", git: "https://github.com/rails/rails.git", tag: "v5.0.0"
|
|
315
326
|
|
|
316
|
-
gem "rails", :
|
|
327
|
+
gem "rails", git: "https://github.com/rails/rails.git", ref: "4aded"
|
|
317
328
|
|
|
318
329
|
* `submodules`:
|
|
319
330
|
For reference, a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
|
|
320
331
|
lets you have another git repository within a subfolder of your repository.
|
|
321
|
-
Specify
|
|
332
|
+
Specify `submodules: true` to cause bundler to expand any
|
|
322
333
|
submodules included in the git repository
|
|
323
334
|
|
|
324
335
|
If a git repository contains multiple `.gemspecs`, each `.gemspec`
|
|
@@ -346,11 +357,11 @@ as an argument, and a block which receives a single argument and interpolates it
|
|
|
346
357
|
string to return the full repo address:
|
|
347
358
|
|
|
348
359
|
git_source(:stash){ |repo_name| "https://stash.corp.acme.pl/#{repo_name}.git" }
|
|
349
|
-
gem 'rails', :
|
|
360
|
+
gem 'rails', stash: 'forks/rails'
|
|
350
361
|
|
|
351
362
|
In addition, if you wish to choose a specific branch:
|
|
352
363
|
|
|
353
|
-
gem "rails", :
|
|
364
|
+
gem "rails", stash: "forks/rails", branch: "branch_name"
|
|
354
365
|
|
|
355
366
|
### GITHUB
|
|
356
367
|
|
|
@@ -363,25 +374,33 @@ If the git repository you want to use is hosted on GitHub and is public, you can
|
|
|
363
374
|
trailing ".git"), separated by a slash. If both the username and repository name are the
|
|
364
375
|
same, you can omit one.
|
|
365
376
|
|
|
366
|
-
gem "rails", :
|
|
367
|
-
gem "rails", :
|
|
377
|
+
gem "rails", github: "rails/rails"
|
|
378
|
+
gem "rails", github: "rails"
|
|
368
379
|
|
|
369
380
|
Are both equivalent to
|
|
370
381
|
|
|
371
|
-
gem "rails", :
|
|
382
|
+
gem "rails", git: "https://github.com/rails/rails.git"
|
|
372
383
|
|
|
373
384
|
Since the `github` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
|
374
385
|
|
|
386
|
+
You can also directly pass a pull request URL:
|
|
387
|
+
|
|
388
|
+
gem "rails", github: "https://github.com/rails/rails/pull/43753"
|
|
389
|
+
|
|
390
|
+
Which is equivalent to:
|
|
391
|
+
|
|
392
|
+
gem "rails", github: "rails/rails", branch: "refs/pull/43753/head"
|
|
393
|
+
|
|
375
394
|
### GIST
|
|
376
395
|
|
|
377
|
-
If the git repository you want to use is hosted as a
|
|
396
|
+
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use
|
|
378
397
|
the :gist shorthand to specify the gist identifier (without the trailing ".git").
|
|
379
398
|
|
|
380
|
-
gem "the_hatch", :
|
|
399
|
+
gem "the_hatch", gist: "4815162342"
|
|
381
400
|
|
|
382
401
|
Is equivalent to:
|
|
383
402
|
|
|
384
|
-
gem "the_hatch", :
|
|
403
|
+
gem "the_hatch", git: "https://gist.github.com/4815162342.git"
|
|
385
404
|
|
|
386
405
|
Since the `gist` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
|
387
406
|
|
|
@@ -392,12 +411,12 @@ If the git repository you want to use is hosted on Bitbucket and is public, you
|
|
|
392
411
|
trailing ".git"), separated by a slash. If both the username and repository name are the
|
|
393
412
|
same, you can omit one.
|
|
394
413
|
|
|
395
|
-
gem "rails", :
|
|
396
|
-
gem "rails", :
|
|
414
|
+
gem "rails", bitbucket: "rails/rails"
|
|
415
|
+
gem "rails", bitbucket: "rails"
|
|
397
416
|
|
|
398
417
|
Are both equivalent to
|
|
399
418
|
|
|
400
|
-
gem "rails", :
|
|
419
|
+
gem "rails", git: "https://rails@bitbucket.org/rails/rails.git"
|
|
401
420
|
|
|
402
421
|
Since the `bitbucket` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
|
403
422
|
|
|
@@ -415,7 +434,7 @@ version that bundler should use.
|
|
|
415
434
|
Unlike `:git`, bundler does not compile C extensions for
|
|
416
435
|
gems specified as paths.
|
|
417
436
|
|
|
418
|
-
gem "rails", :
|
|
437
|
+
gem "rails", path: "vendor/rails"
|
|
419
438
|
|
|
420
439
|
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
440
|
|
|
@@ -444,7 +463,7 @@ applied to a group of gems by using block form.
|
|
|
444
463
|
gem "sqlite3"
|
|
445
464
|
end
|
|
446
465
|
|
|
447
|
-
group :development, :
|
|
466
|
+
group :development, optional: true do
|
|
448
467
|
gem "wirble"
|
|
449
468
|
gem "faker"
|
|
450
469
|
end
|
|
@@ -487,8 +506,8 @@ the `.gemspec` file.
|
|
|
487
506
|
|
|
488
507
|
The `gemspec` method adds any runtime dependencies as gem requirements in the
|
|
489
508
|
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
|
-
|
|
509
|
+
`development` group. Finally, it adds a gem requirement on your project (`path:
|
|
510
|
+
'.'`). In conjunction with `Bundler.setup`, this allows you to require project
|
|
492
511
|
files in your test code as you would if the project were installed as a gem; you
|
|
493
512
|
need not manipulate the load path manually or require project files via relative
|
|
494
513
|
paths.
|
|
@@ -513,5 +532,7 @@ bundler uses the following priority order:
|
|
|
513
532
|
repository declared on the parent. This results in bundler prioritizing the
|
|
514
533
|
ActiveSupport gem from the Rails git repository over ones from
|
|
515
534
|
`rubygems.org`
|
|
516
|
-
3.
|
|
517
|
-
|
|
535
|
+
3. If neither of the above conditions are met, the global source will be used.
|
|
536
|
+
If multiple global sources are specified, they will be prioritized from
|
|
537
|
+
last to first, but this is deprecated since Bundler 1.13, so Bundler prints
|
|
538
|
+
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,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bundler
|
|
4
|
+
module MatchMetadata
|
|
5
|
+
def matches_current_ruby?
|
|
6
|
+
@required_ruby_version.satisfied_by?(Gem.ruby_version)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def matches_current_rubygems?
|
|
10
|
+
@required_rubygems_version.satisfied_by?(Gem.rubygems_version)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -15,7 +15,6 @@ module Bundler
|
|
|
15
15
|
return true if Gem::Platform::RUBY == gemspec_platform
|
|
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
|
|
@@ -140,6 +140,13 @@ module Bundler
|
|
|
140
140
|
end
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
+
# Set internal representation to fetch the gems/specs locally.
|
|
144
|
+
#
|
|
145
|
+
# When this is called, the source should try to fetch the specs and
|
|
146
|
+
# install from the local system.
|
|
147
|
+
def local!
|
|
148
|
+
end
|
|
149
|
+
|
|
143
150
|
# Set internal representation to fetch the gems/specs from remote.
|
|
144
151
|
#
|
|
145
152
|
# When this is called, the source should try to fetch the specs and
|
|
@@ -237,7 +244,21 @@ module Bundler
|
|
|
237
244
|
specs.unmet_dependency_names
|
|
238
245
|
end
|
|
239
246
|
|
|
247
|
+
# Used by definition.
|
|
248
|
+
#
|
|
249
|
+
# Note: Do not override if you don't know what you are doing.
|
|
250
|
+
def spec_names
|
|
251
|
+
specs.spec_names
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Used by definition.
|
|
255
|
+
#
|
|
240
256
|
# Note: Do not override if you don't know what you are doing.
|
|
257
|
+
def add_dependency_names(names)
|
|
258
|
+
@dependencies |= Array(names)
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# NOTE: Do not override if you don't know what you are doing.
|
|
241
262
|
def can_lock?(spec)
|
|
242
263
|
spec.source == self
|
|
243
264
|
end
|
|
@@ -262,8 +283,9 @@ module Bundler
|
|
|
262
283
|
def to_s
|
|
263
284
|
"plugin source for #{@type} with uri #{@uri}"
|
|
264
285
|
end
|
|
286
|
+
alias_method :identifier, :to_s
|
|
265
287
|
|
|
266
|
-
#
|
|
288
|
+
# NOTE: Do not override if you don't know what you are doing.
|
|
267
289
|
def include?(other)
|
|
268
290
|
other == self
|
|
269
291
|
end
|
|
@@ -272,7 +294,7 @@ module Bundler
|
|
|
272
294
|
SharedHelpers.digest(:SHA1).hexdigest(uri)
|
|
273
295
|
end
|
|
274
296
|
|
|
275
|
-
#
|
|
297
|
+
# NOTE: Do not override if you don't know what you are doing.
|
|
276
298
|
def gem_install_dir
|
|
277
299
|
Bundler.install_path
|
|
278
300
|
end
|
|
@@ -286,12 +308,6 @@ module Bundler
|
|
|
286
308
|
Bundler.root
|
|
287
309
|
end
|
|
288
310
|
|
|
289
|
-
# @private
|
|
290
|
-
# Returns true
|
|
291
|
-
def bundler_plugin_api_source?
|
|
292
|
-
true
|
|
293
|
-
end
|
|
294
|
-
|
|
295
311
|
# @private
|
|
296
312
|
# This API on source might not be stable, and for now we expect plugins
|
|
297
313
|
# to download all specs in `#specs`, so we implement the method for
|
data/lib/bundler/plugin/index.rb
CHANGED
|
@@ -74,7 +74,10 @@ module Bundler
|
|
|
74
74
|
def unregister_plugin(name)
|
|
75
75
|
@commands.delete_if {|_, v| v == name }
|
|
76
76
|
@sources.delete_if {|_, v| v == name }
|
|
77
|
-
@hooks.each
|
|
77
|
+
@hooks.each do |hook, names|
|
|
78
|
+
names.delete(name)
|
|
79
|
+
@hooks.delete(hook) if names.empty?
|
|
80
|
+
end
|
|
78
81
|
@plugin_paths.delete(name)
|
|
79
82
|
@load_paths.delete(name)
|
|
80
83
|
save_index
|
|
@@ -16,15 +16,13 @@ module Bundler
|
|
|
16
16
|
|
|
17
17
|
version = options[:version] || [">= 0"]
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
install_rubygems(names, version, sources)
|
|
27
|
-
end
|
|
19
|
+
if options[:git]
|
|
20
|
+
install_git(names, version, options)
|
|
21
|
+
elsif options[:local_git]
|
|
22
|
+
install_local_git(names, version, options)
|
|
23
|
+
else
|
|
24
|
+
sources = options[:source] || Gem.sources
|
|
25
|
+
install_rubygems(names, version, sources)
|
|
28
26
|
end
|
|
29
27
|
end
|
|
30
28
|
|
|
@@ -79,10 +77,12 @@ module Bundler
|
|
|
79
77
|
source_list = SourceList.new
|
|
80
78
|
|
|
81
79
|
source_list.add_git_source(git_source_options) if git_source_options
|
|
82
|
-
source_list.
|
|
80
|
+
Array(rubygems_source).each {|remote| source_list.add_global_rubygems_remote(remote) } if rubygems_source
|
|
83
81
|
|
|
84
82
|
deps = names.map {|name| Dependency.new name, version }
|
|
85
83
|
|
|
84
|
+
Bundler.configure_gem_home_and_path(Plugin.root)
|
|
85
|
+
|
|
86
86
|
definition = Definition.new(nil, deps, source_list, true)
|
|
87
87
|
install_definition(definition)
|
|
88
88
|
end
|