bundler 2.3.12 → 2.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +367 -1
- data/README.md +2 -2
- data/bundler.gemspec +8 -10
- data/exe/bundle +1 -4
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/add.rb +1 -1
- data/lib/bundler/cli/binstubs.rb +5 -1
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/common.rb +3 -1
- data/lib/bundler/cli/console.rb +2 -2
- data/lib/bundler/cli/doctor.rb +4 -6
- data/lib/bundler/cli/gem.rb +62 -40
- data/lib/bundler/cli/init.rb +5 -1
- data/lib/bundler/cli/install.rb +7 -5
- data/lib/bundler/cli/lock.rb +8 -5
- data/lib/bundler/cli/open.rb +6 -4
- data/lib/bundler/cli/outdated.rb +13 -6
- data/lib/bundler/cli/platform.rb +1 -1
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +52 -7
- data/lib/bundler/compact_index_client/cache.rb +1 -1
- data/lib/bundler/compact_index_client/updater.rb +53 -39
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +15 -6
- data/lib/bundler/definition.rb +203 -110
- data/lib/bundler/dependency.rb +21 -84
- data/lib/bundler/digest.rb +1 -1
- data/lib/bundler/dsl.rb +13 -18
- data/lib/bundler/endpoint_specification.rb +6 -10
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/environment_preserver.rb +1 -0
- data/lib/bundler/errors.rb +15 -15
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher/base.rb +6 -8
- data/lib/bundler/fetcher/compact_index.rb +9 -11
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +2 -5
- data/lib/bundler/fetcher.rb +12 -12
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +21 -7
- data/lib/bundler/gem_helpers.rb +9 -2
- data/lib/bundler/gem_version_promoter.rb +53 -98
- data/lib/bundler/graph.rb +3 -3
- data/lib/bundler/index.rb +11 -49
- data/lib/bundler/injector.rb +8 -3
- data/lib/bundler/inline.rb +9 -21
- data/lib/bundler/installer/gem_installer.rb +14 -1
- data/lib/bundler/installer/parallel_installer.rb +0 -31
- data/lib/bundler/installer/standalone.rb +41 -10
- data/lib/bundler/installer.rb +18 -39
- data/lib/bundler/lazy_specification.rb +53 -48
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +9 -5
- data/lib/bundler/man/bundle-add.1 +13 -5
- data/lib/bundler/man/bundle-add.1.ronn +10 -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 +26 -7
- data/lib/bundler/man/bundle-config.1.ronn +17 -7
- 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 +6 -6
- data/lib/bundler/man/bundle-exec.1.ronn +6 -6
- data/lib/bundler/man/bundle-gem.1 +27 -37
- data/lib/bundler/man/bundle-gem.1.ronn +5 -5
- 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 +5 -30
- data/lib/bundler/man/bundle-install.1.ronn +6 -29
- 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 +22 -2
- data/lib/bundler/man/bundle-open.1.ronn +9 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- 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 +1 -1
- 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 +92 -81
- data/lib/bundler/man/gemfile.5.ronn +98 -85
- 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/mirror.rb +5 -7
- data/lib/bundler/plugin/api/source.rb +3 -3
- data/lib/bundler/plugin/index.rb +4 -4
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +0 -8
- data/lib/bundler/plugin.rb +2 -0
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +8 -9
- data/lib/bundler/resolver/base.rb +77 -0
- data/lib/bundler/resolver/candidate.rb +94 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +72 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +42 -70
- data/lib/bundler/resolver.rb +322 -326
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +5 -5
- data/lib/bundler/rubygems_ext.rb +102 -12
- data/lib/bundler/rubygems_gem_installer.rb +32 -20
- data/lib/bundler/rubygems_integration.rb +12 -34
- data/lib/bundler/runtime.rb +1 -6
- data/lib/bundler/settings.rb +2 -8
- data/lib/bundler/shared_helpers.rb +7 -7
- data/lib/bundler/source/git/git_proxy.rb +193 -67
- data/lib/bundler/source/git.rb +21 -25
- data/lib/bundler/source/metadata.rb +1 -2
- data/lib/bundler/source/path/installer.rb +1 -22
- data/lib/bundler/source/path.rb +6 -6
- data/lib/bundler/source/rubygems.rb +75 -117
- data/lib/bundler/source.rb +3 -4
- data/lib/bundler/source_list.rb +12 -2
- data/lib/bundler/spec_set.rb +52 -34
- data/lib/bundler/stub_specification.rb +5 -3
- data/lib/bundler/templates/Executable +1 -1
- data/lib/bundler/templates/Executable.bundler +4 -9
- data/lib/bundler/templates/Executable.standalone +2 -0
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +3 -0
- data/lib/bundler/templates/newgem/README.md.tt +6 -4
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -1
- 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-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +10 -0
- 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 +8 -2
- data/lib/bundler/ui/shell.rb +35 -12
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +3 -1
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
- 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 +151 -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 +53 -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 +128 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -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/lib/thor/shell/basic.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/common.rb +64 -16
- data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +27 -7
- data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -2
- data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +13 -7
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +10 -5
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +1 -2
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri.rb +3 -2
- data/lib/bundler/vendored_persistent.rb +1 -33
- data/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/worker.rb +5 -7
- data/lib/bundler.rb +35 -69
- metadata +45 -34
- data/lib/bundler/dep_proxy.rb +0 -55
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/lib/bundler/vendor/molinillo/LICENSE +0 -9
- 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 -149
- 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/vendored_molinillo.rb +0 -4
- data/lib/bundler/version_ranges.rb +0 -122
- /data/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +0 -0
@@ -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.
|
99
107
|
|
100
|
-
|
108
|
+
This option was implemented in Bundler 1.4.0 for Ruby 2.0 or earlier.
|
109
|
+
|
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
|
-
|
204
|
-
You can restrict further by platform and version for all platforms *except* for
|
205
|
-
`rbx`, `jruby`, `truffleruby` and `mswin`.
|
206
213
|
|
207
|
-
|
208
|
-
|
209
|
-
|
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:
|
210
218
|
|
211
|
-
|
219
|
+
ruby_31
|
212
220
|
|
213
|
-
|
221
|
+
As with groups (above), you may specify one or more platforms:
|
214
222
|
|
215
|
-
|
216
|
-
|
217
|
-
|
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
|
223
|
-
|
224
|
-
As with groups, you can specify one or more platforms:
|
225
|
-
|
226
|
-
gem "weakling", :platforms => :jruby
|
227
|
-
gem "ruby-debug", :platforms => :mri_18
|
228
|
-
gem "nokogiri", :platforms => [:mri_18, :jruby]
|
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,33 +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
|
|
375
386
|
You can also directly pass a pull request URL:
|
376
387
|
|
377
|
-
gem "rails", :
|
388
|
+
gem "rails", github: "https://github.com/rails/rails/pull/43753"
|
378
389
|
|
379
390
|
Which is equivalent to:
|
380
391
|
|
381
|
-
gem "rails", :
|
392
|
+
gem "rails", github: "rails/rails", branch: "refs/pull/43753/head"
|
382
393
|
|
383
394
|
### GIST
|
384
395
|
|
385
396
|
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use
|
386
397
|
the :gist shorthand to specify the gist identifier (without the trailing ".git").
|
387
398
|
|
388
|
-
gem "the_hatch", :
|
399
|
+
gem "the_hatch", gist: "4815162342"
|
389
400
|
|
390
401
|
Is equivalent to:
|
391
402
|
|
392
|
-
gem "the_hatch", :
|
403
|
+
gem "the_hatch", git: "https://gist.github.com/4815162342.git"
|
393
404
|
|
394
405
|
Since the `gist` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
395
406
|
|
@@ -400,12 +411,12 @@ If the git repository you want to use is hosted on Bitbucket and is public, you
|
|
400
411
|
trailing ".git"), separated by a slash. If both the username and repository name are the
|
401
412
|
same, you can omit one.
|
402
413
|
|
403
|
-
gem "rails", :
|
404
|
-
gem "rails", :
|
414
|
+
gem "rails", bitbucket: "rails/rails"
|
415
|
+
gem "rails", bitbucket: "rails"
|
405
416
|
|
406
417
|
Are both equivalent to
|
407
418
|
|
408
|
-
gem "rails", :
|
419
|
+
gem "rails", git: "https://rails@bitbucket.org/rails/rails.git"
|
409
420
|
|
410
421
|
Since the `bitbucket` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
411
422
|
|
@@ -423,7 +434,7 @@ version that bundler should use.
|
|
423
434
|
Unlike `:git`, bundler does not compile C extensions for
|
424
435
|
gems specified as paths.
|
425
436
|
|
426
|
-
gem "rails", :
|
437
|
+
gem "rails", path: "vendor/rails"
|
427
438
|
|
428
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.
|
429
440
|
|
@@ -452,7 +463,7 @@ applied to a group of gems by using block form.
|
|
452
463
|
gem "sqlite3"
|
453
464
|
end
|
454
465
|
|
455
|
-
group :development, :
|
466
|
+
group :development, optional: true do
|
456
467
|
gem "wirble"
|
457
468
|
gem "faker"
|
458
469
|
end
|
@@ -495,8 +506,8 @@ the `.gemspec` file.
|
|
495
506
|
|
496
507
|
The `gemspec` method adds any runtime dependencies as gem requirements in the
|
497
508
|
default group. It also adds development dependencies as gem requirements in the
|
498
|
-
`development` group. Finally, it adds a gem requirement on your project (
|
499
|
-
|
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
|
500
511
|
files in your test code as you would if the project were installed as a gem; you
|
501
512
|
need not manipulate the load path manually or require project files via relative
|
502
513
|
paths.
|
@@ -521,5 +532,7 @@ bundler uses the following priority order:
|
|
521
532
|
repository declared on the parent. This results in bundler prioritizing the
|
522
533
|
ActiveSupport gem from the Rails git repository over ones from
|
523
534
|
`rubygems.org`
|
524
|
-
3.
|
525
|
-
|
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
|
data/lib/bundler/mirror.rb
CHANGED
@@ -148,13 +148,11 @@ module Bundler
|
|
148
148
|
class TCPSocketProbe
|
149
149
|
def replies?(mirror)
|
150
150
|
MirrorSockets.new(mirror).any? do |socket, address, timeout|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
false
|
157
|
-
end
|
151
|
+
socket.connect_nonblock(address)
|
152
|
+
rescue Errno::EINPROGRESS
|
153
|
+
wait_for_writtable_socket(socket, address, timeout)
|
154
|
+
rescue RuntimeError # Connection failed somehow, again
|
155
|
+
false
|
158
156
|
end
|
159
157
|
end
|
160
158
|
|
@@ -258,7 +258,7 @@ module Bundler
|
|
258
258
|
@dependencies |= Array(names)
|
259
259
|
end
|
260
260
|
|
261
|
-
#
|
261
|
+
# NOTE: Do not override if you don't know what you are doing.
|
262
262
|
def can_lock?(spec)
|
263
263
|
spec.source == self
|
264
264
|
end
|
@@ -285,7 +285,7 @@ module Bundler
|
|
285
285
|
end
|
286
286
|
alias_method :identifier, :to_s
|
287
287
|
|
288
|
-
#
|
288
|
+
# NOTE: Do not override if you don't know what you are doing.
|
289
289
|
def include?(other)
|
290
290
|
other == self
|
291
291
|
end
|
@@ -294,7 +294,7 @@ module Bundler
|
|
294
294
|
SharedHelpers.digest(:SHA1).hexdigest(uri)
|
295
295
|
end
|
296
296
|
|
297
|
-
#
|
297
|
+
# NOTE: Do not override if you don't know what you are doing.
|
298
298
|
def gem_install_dir
|
299
299
|
Bundler.install_path
|
300
300
|
end
|
data/lib/bundler/plugin/index.rb
CHANGED
@@ -167,11 +167,11 @@ module Bundler
|
|
167
167
|
# to be only String key value pairs)
|
168
168
|
def save_index
|
169
169
|
index = {
|
170
|
-
"commands"
|
171
|
-
"hooks"
|
172
|
-
"load_paths"
|
170
|
+
"commands" => @commands,
|
171
|
+
"hooks" => @hooks,
|
172
|
+
"load_paths" => @load_paths,
|
173
173
|
"plugin_paths" => @plugin_paths,
|
174
|
-
"sources"
|
174
|
+
"sources" => @sources,
|
175
175
|
}
|
176
176
|
|
177
177
|
require_relative "../yaml_serializer"
|
@@ -4,16 +4,8 @@ module Bundler
|
|
4
4
|
module Plugin
|
5
5
|
class Installer
|
6
6
|
class Rubygems < Bundler::Source::Rubygems
|
7
|
-
def version_message(spec)
|
8
|
-
"#{spec.name} #{spec.version}"
|
9
|
-
end
|
10
|
-
|
11
7
|
private
|
12
8
|
|
13
|
-
def requires_sudo?
|
14
|
-
false # Will change on implementation of project level plugins
|
15
|
-
end
|
16
|
-
|
17
9
|
def rubygems_dir
|
18
10
|
Plugin.root
|
19
11
|
end
|
data/lib/bundler/plugin.rb
CHANGED
@@ -36,6 +36,8 @@ module Bundler
|
|
36
36
|
# @param [Hash] options various parameters as described in description.
|
37
37
|
# Refer to cli/plugin for available options
|
38
38
|
def install(names, options)
|
39
|
+
raise InvalidOption, "You cannot specify `--branch` and `--ref` at the same time." if options["branch"] && options["ref"]
|
40
|
+
|
39
41
|
specs = Installer.new.install(names, options)
|
40
42
|
|
41
43
|
save_plugins names, specs
|
data/lib/bundler/process_lock.rb
CHANGED
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
yield
|
13
13
|
f.flock(File::LOCK_UN)
|
14
14
|
end
|
15
|
-
rescue Errno::EACCES, Errno::ENOLCK, Errno::ENOTSUP
|
15
|
+
rescue Errno::EACCES, Errno::ENOLCK, Errno::ENOTSUP, Errno::EPERM, Errno::EROFS
|
16
16
|
# In the case the user does not have access to
|
17
17
|
# create the lock file or is using NFS where
|
18
18
|
# locks are not available we skip locking.
|
@@ -6,6 +6,7 @@ module Bundler
|
|
6
6
|
# be seeded with what we're given from the source's abbreviated index - the
|
7
7
|
# full specification will only be fetched when necessary.
|
8
8
|
class RemoteSpecification
|
9
|
+
include MatchRemoteMetadata
|
9
10
|
include MatchPlatform
|
10
11
|
include Comparable
|
11
12
|
|
@@ -16,7 +17,8 @@ module Bundler
|
|
16
17
|
def initialize(name, version, platform, spec_fetcher)
|
17
18
|
@name = name
|
18
19
|
@version = Gem::Version.create version
|
19
|
-
@
|
20
|
+
@original_platform = platform || Gem::Platform::RUBY
|
21
|
+
@platform = Gem::Platform.new(platform)
|
20
22
|
@spec_fetcher = spec_fetcher
|
21
23
|
@dependencies = nil
|
22
24
|
end
|
@@ -27,18 +29,15 @@ module Bundler
|
|
27
29
|
@platform = _remote_specification.platform
|
28
30
|
end
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
# set to +nil+.
|
33
|
-
def required_rubygems_version
|
34
|
-
@required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
|
32
|
+
def identifier
|
33
|
+
@__identifier ||= [name, version, @platform.to_s]
|
35
34
|
end
|
36
35
|
|
37
36
|
def full_name
|
38
|
-
if platform == Gem::Platform::RUBY
|
37
|
+
if @platform == Gem::Platform::RUBY
|
39
38
|
"#{@name}-#{@version}"
|
40
39
|
else
|
41
|
-
"#{@name}-#{@version}-#{platform}"
|
40
|
+
"#{@name}-#{@version}-#{@platform}"
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
@@ -105,7 +104,7 @@ module Bundler
|
|
105
104
|
end
|
106
105
|
|
107
106
|
def _remote_specification
|
108
|
-
@_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @
|
107
|
+
@_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @original_platform])
|
109
108
|
@_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \
|
110
109
|
" missing from the server! Try installing with `--full-index` as a workaround.")
|
111
110
|
end
|