bundler 2.2.17 → 2.2.22
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +70 -0
- data/bundler.gemspec +2 -3
- data/lib/bundler.rb +2 -1
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +13 -33
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/doctor.rb +11 -1
- data/lib/bundler/cli/install.rb +7 -8
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/outdated.rb +9 -10
- data/lib/bundler/cli/update.rb +8 -3
- data/lib/bundler/current_ruby.rb +4 -4
- data/lib/bundler/definition.rb +38 -127
- data/lib/bundler/dsl.rb +3 -11
- data/lib/bundler/feature_flag.rb +0 -3
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +1 -2
- data/lib/bundler/fetcher/index.rb +0 -1
- data/lib/bundler/friendly_errors.rb +2 -4
- data/lib/bundler/index.rb +1 -2
- data/lib/bundler/installer.rb +5 -12
- data/lib/bundler/lockfile_parser.rb +2 -20
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +1 -10
- data/lib/bundler/man/bundle-config.1.ronn +0 -11
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +1 -1
- 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 +1 -1
- data/lib/bundler/man/bundle-install.1 +1 -1
- 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 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- 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 +4 -4
- data/lib/bundler/man/bundle-update.1.ronn +3 -3
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +1 -1
- data/lib/bundler/plugin/api/source.rb +14 -0
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/resolver.rb +15 -96
- data/lib/bundler/resolver/spec_group.rb +0 -24
- data/lib/bundler/rubygems_ext.rb +2 -2
- data/lib/bundler/rubygems_integration.rb +4 -3
- data/lib/bundler/settings.rb +21 -4
- data/lib/bundler/source.rb +11 -0
- data/lib/bundler/source/rubygems.rb +22 -22
- data/lib/bundler/source/rubygems_aggregate.rb +64 -0
- data/lib/bundler/source_list.rb +69 -27
- data/lib/bundler/source_map.rb +58 -0
- data/lib/bundler/spec_set.rb +2 -6
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
- data/lib/bundler/version.rb +1 -1
- metadata +5 -3
data/lib/bundler/dsl.rb
CHANGED
@@ -24,9 +24,6 @@ module Bundler
|
|
24
24
|
def initialize
|
25
25
|
@source = nil
|
26
26
|
@sources = SourceList.new
|
27
|
-
|
28
|
-
@global_rubygems_sources = []
|
29
|
-
|
30
27
|
@git_sources = {}
|
31
28
|
@dependencies = []
|
32
29
|
@groups = []
|
@@ -48,7 +45,6 @@ module Bundler
|
|
48
45
|
@gemfiles << expanded_gemfile_path
|
49
46
|
contents ||= Bundler.read_file(@gemfile.to_s)
|
50
47
|
instance_eval(contents.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1)
|
51
|
-
check_primary_source_safety
|
52
48
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
53
49
|
message = "There was an error " \
|
54
50
|
"#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \
|
@@ -168,7 +164,7 @@ module Bundler
|
|
168
164
|
elsif block_given?
|
169
165
|
with_source(@sources.add_rubygems_source("remotes" => source), &blk)
|
170
166
|
else
|
171
|
-
@
|
167
|
+
@sources.add_global_rubygems_remote(source)
|
172
168
|
end
|
173
169
|
end
|
174
170
|
|
@@ -222,6 +218,7 @@ module Bundler
|
|
222
218
|
end
|
223
219
|
|
224
220
|
def to_definition(lockfile, unlock)
|
221
|
+
check_primary_source_safety
|
225
222
|
Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
|
226
223
|
end
|
227
224
|
|
@@ -453,12 +450,7 @@ repo_name ||= user_name
|
|
453
450
|
end
|
454
451
|
|
455
452
|
def check_rubygems_source_safety
|
456
|
-
|
457
|
-
return if @global_rubygems_sources.empty?
|
458
|
-
|
459
|
-
@global_rubygems_sources.each do |source|
|
460
|
-
@sources.add_rubygems_remote(source)
|
461
|
-
end
|
453
|
+
return unless @sources.aggregate_global_source?
|
462
454
|
|
463
455
|
if Bundler.feature_flag.bundler_3_mode?
|
464
456
|
msg = "This Gemfile contains multiple primary sources. " \
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -31,8 +31,6 @@ module Bundler
|
|
31
31
|
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
|
32
32
|
settings_flag(:cache_all) { bundler_3_mode? }
|
33
33
|
settings_flag(:default_install_uses_path) { bundler_3_mode? }
|
34
|
-
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
|
35
|
-
settings_flag(:disable_multisource) { bundler_3_mode? }
|
36
34
|
settings_flag(:forget_cli_options) { bundler_3_mode? }
|
37
35
|
settings_flag(:global_gem_cache) { bundler_3_mode? }
|
38
36
|
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
|
@@ -40,7 +38,6 @@ module Bundler
|
|
40
38
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
41
39
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
42
40
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
43
|
-
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
44
41
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
45
42
|
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
46
43
|
|
@@ -111,7 +111,7 @@ module Bundler
|
|
111
111
|
def bundle_worker(func = nil)
|
112
112
|
@bundle_worker ||= begin
|
113
113
|
worker_name = "Compact Index (#{display_uri.host})"
|
114
|
-
Bundler::Worker.new(Bundler.
|
114
|
+
Bundler::Worker.new(Bundler.settings.processor_count, worker_name, func)
|
115
115
|
end
|
116
116
|
@bundle_worker.tap do |worker|
|
117
117
|
worker.instance_variable_set(:@func, func) if func
|
@@ -68,8 +68,7 @@ module Bundler
|
|
68
68
|
raise CertificateFailureError.new(uri)
|
69
69
|
rescue *HTTP_ERRORS => e
|
70
70
|
Bundler.ui.trace e
|
71
|
-
|
72
|
-
when /host down:/, /getaddrinfo: nodename nor servname provided/
|
71
|
+
if e.is_a?(SocketError) || e.message =~ /host down:/
|
73
72
|
raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
|
74
73
|
"connection and try again."
|
75
74
|
else
|
@@ -49,8 +49,6 @@ module Bundler
|
|
49
49
|
"Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)."
|
50
50
|
else request_issue_report_for(error)
|
51
51
|
end
|
52
|
-
rescue StandardError
|
53
|
-
raise error
|
54
52
|
end
|
55
53
|
|
56
54
|
def exit_status(error)
|
@@ -111,8 +109,8 @@ module Bundler
|
|
111
109
|
First, try this link to see if there are any existing issue reports for this error:
|
112
110
|
#{issues_url(e)}
|
113
111
|
|
114
|
-
If there aren't any reports for this error yet, please
|
115
|
-
https://github.com/rubygems/rubygems/issues/new?labels=Bundler
|
112
|
+
If there aren't any reports for this error yet, please copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
|
113
|
+
https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md
|
116
114
|
EOS
|
117
115
|
end
|
118
116
|
|
data/lib/bundler/index.rb
CHANGED
data/lib/bundler/installer.rb
CHANGED
@@ -135,7 +135,7 @@ module Bundler
|
|
135
135
|
next
|
136
136
|
end
|
137
137
|
|
138
|
-
mode =
|
138
|
+
mode = Gem.win_platform? ? "wb:UTF-8" : "w"
|
139
139
|
require "erb"
|
140
140
|
content = if RUBY_VERSION >= "2.6"
|
141
141
|
ERB.new(template, :trim_mode => "-").result(binding)
|
@@ -144,7 +144,7 @@ module Bundler
|
|
144
144
|
end
|
145
145
|
|
146
146
|
File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask)
|
147
|
-
if
|
147
|
+
if Gem.win_platform? || options[:all_platforms]
|
148
148
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
149
149
|
File.write("#{binstub_path}.cmd", prefix + content, :mode => mode)
|
150
150
|
end
|
@@ -182,7 +182,7 @@ module Bundler
|
|
182
182
|
executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
|
183
183
|
executable_path = executable_path
|
184
184
|
|
185
|
-
mode =
|
185
|
+
mode = Gem.win_platform? ? "wb:UTF-8" : "w"
|
186
186
|
require "erb"
|
187
187
|
content = if RUBY_VERSION >= "2.6"
|
188
188
|
ERB.new(template, :trim_mode => "-").result(binding)
|
@@ -191,7 +191,7 @@ module Bundler
|
|
191
191
|
end
|
192
192
|
|
193
193
|
File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755)
|
194
|
-
if
|
194
|
+
if Gem.win_platform? || options[:all_platforms]
|
195
195
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
196
196
|
File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode)
|
197
197
|
end
|
@@ -222,14 +222,7 @@ module Bundler
|
|
222
222
|
# Parallelization has some issues on Windows, so it's not yet the default
|
223
223
|
return 1 if Gem.win_platform?
|
224
224
|
|
225
|
-
processor_count
|
226
|
-
end
|
227
|
-
|
228
|
-
def processor_count
|
229
|
-
require "etc"
|
230
|
-
Etc.nprocessors
|
231
|
-
rescue StandardError
|
232
|
-
1
|
225
|
+
Bundler.settings.processor_count
|
233
226
|
end
|
234
227
|
|
235
228
|
def load_plugins
|
@@ -1,16 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#--
|
4
|
-
# Some versions of the Bundler 1.1 RC series introduced corrupted
|
5
|
-
# lockfiles. There were two major problems:
|
6
|
-
#
|
7
|
-
# * multiple copies of the same GIT section appeared in the lockfile
|
8
|
-
# * when this happened, those sections got multiple copies of gems
|
9
|
-
# in those sections.
|
10
|
-
#
|
11
|
-
# As a result, Bundler 1.1 contains code that fixes the earlier
|
12
|
-
# corruption. We will remove this fix-up code in Bundler 1.2.
|
13
|
-
|
14
3
|
module Bundler
|
15
4
|
class LockfileParser
|
16
5
|
attr_reader :sources, :dependencies, :specs, :platforms, :bundler_version, :ruby_version
|
@@ -124,12 +113,7 @@ module Bundler
|
|
124
113
|
@sources << @current_source
|
125
114
|
when GIT
|
126
115
|
@current_source = TYPES[@type].from_lock(@opts)
|
127
|
-
|
128
|
-
if @sources.include?(@current_source)
|
129
|
-
@current_source = @sources.find {|s| s == @current_source }
|
130
|
-
else
|
131
|
-
@sources << @current_source
|
132
|
-
end
|
116
|
+
@sources << @current_source
|
133
117
|
when GEM
|
134
118
|
@opts["remotes"] = Array(@opts.delete("remote")).reverse
|
135
119
|
@current_source = TYPES[@type].from_lock(@opts)
|
@@ -212,9 +196,7 @@ module Bundler
|
|
212
196
|
@current_spec = LazySpecification.new(name, version, platform)
|
213
197
|
@current_spec.source = @current_source
|
214
198
|
|
215
|
-
|
216
|
-
# duplicate GIT sections)
|
217
|
-
@specs[@current_spec.identifier] ||= @current_spec
|
199
|
+
@specs[@current_spec.identifier] = @current_spec
|
218
200
|
elsif spaces.size == 6
|
219
201
|
version = version.split(",").map(&:strip) if version
|
220
202
|
dep = Gem::Dependency.new(name, version)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CACHE" "1" "
|
4
|
+
.TH "BUNDLE\-CACHE" "1" "June 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CHECK" "1" "
|
4
|
+
.TH "BUNDLE\-CHECK" "1" "June 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CONFIG" "1" "
|
4
|
+
.TH "BUNDLE\-CONFIG" "1" "June 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-config\fR \- Set bundler configuration options
|
@@ -56,9 +56,6 @@ Executing \fBbundle config unset \-\-local <name> <value>\fR will delete the con
|
|
56
56
|
.P
|
57
57
|
Executing bundle with the \fBBUNDLE_IGNORE_CONFIG\fR environment variable set will cause it to ignore all configuration\.
|
58
58
|
.
|
59
|
-
.P
|
60
|
-
Executing \fBbundle config set \-\-local disable_multisource true\fR upgrades the warning about the Gemfile containing multiple primary sources to an error\. Executing \fBbundle config unset disable_multisource\fR downgrades this error to a warning\.
|
61
|
-
.
|
62
59
|
.SH "REMEMBERING OPTIONS"
|
63
60
|
Flags passed to \fBbundle install\fR or the Bundler runtime, such as \fB\-\-path foo\fR or \fB\-\-without production\fR, are remembered between commands and saved to your local application\'s configuration (normally, \fB\./\.bundle/config\fR)\.
|
64
61
|
.
|
@@ -184,9 +181,6 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
184
181
|
\fBdisable_local_revision_check\fR (\fBBUNDLE_DISABLE_LOCAL_REVISION_CHECK\fR): Allow Bundler to use a local git override without checking if the revision present in the lockfile is present in the repository\.
|
185
182
|
.
|
186
183
|
.IP "\(bu" 4
|
187
|
-
\fBdisable_multisource\fR (\fBBUNDLE_DISABLE_MULTISOURCE\fR): When set, Gemfiles containing multiple sources will produce errors instead of warnings\. Use \fBbundle config unset disable_multisource\fR to unset\.
|
188
|
-
.
|
189
|
-
.IP "\(bu" 4
|
190
184
|
\fBdisable_shared_gems\fR (\fBBUNDLE_DISABLE_SHARED_GEMS\fR): Stop Bundler from accessing gems installed to RubyGems\' normal location\.
|
191
185
|
.
|
192
186
|
.IP "\(bu" 4
|
@@ -280,9 +274,6 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
280
274
|
\fBtimeout\fR (\fBBUNDLE_TIMEOUT\fR): The seconds allowed before timing out for network requests\. Defaults to \fB10\fR\.
|
281
275
|
.
|
282
276
|
.IP "\(bu" 4
|
283
|
-
\fBunlock_source_unlocks_spec\fR (\fBBUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC\fR): Whether running \fBbundle update \-\-source NAME\fR unlocks a gem with the given name\. Defaults to \fBtrue\fR\.
|
284
|
-
.
|
285
|
-
.IP "\(bu" 4
|
286
277
|
\fBupdate_requires_all_flag\fR (\fBBUNDLE_UPDATE_REQUIRES_ALL_FLAG\fR): Require passing \fB\-\-all\fR to \fBbundle update\fR when everything should be updated, and disallow passing no options to \fBbundle update\fR\.
|
287
278
|
.
|
288
279
|
.IP "\(bu" 4
|
@@ -47,10 +47,6 @@ configuration only from the local application.
|
|
47
47
|
Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
|
48
48
|
cause it to ignore all configuration.
|
49
49
|
|
50
|
-
Executing `bundle config set --local disable_multisource true` upgrades the warning about
|
51
|
-
the Gemfile containing multiple primary sources to an error. Executing `bundle
|
52
|
-
config unset disable_multisource` downgrades this error to a warning.
|
53
|
-
|
54
50
|
## REMEMBERING OPTIONS
|
55
51
|
|
56
52
|
Flags passed to `bundle install` or the Bundler runtime, such as `--path foo` or
|
@@ -178,10 +174,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
178
174
|
* `disable_local_revision_check` (`BUNDLE_DISABLE_LOCAL_REVISION_CHECK`):
|
179
175
|
Allow Bundler to use a local git override without checking if the revision
|
180
176
|
present in the lockfile is present in the repository.
|
181
|
-
* `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`):
|
182
|
-
When set, Gemfiles containing multiple sources will produce errors
|
183
|
-
instead of warnings.
|
184
|
-
Use `bundle config unset disable_multisource` to unset.
|
185
177
|
* `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
|
186
178
|
Stop Bundler from accessing gems installed to RubyGems' normal location.
|
187
179
|
* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
|
@@ -268,9 +260,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
268
260
|
The location where RubyGems installs binstubs. Defaults to `Gem.bindir`.
|
269
261
|
* `timeout` (`BUNDLE_TIMEOUT`):
|
270
262
|
The seconds allowed before timing out for network requests. Defaults to `10`.
|
271
|
-
* `unlock_source_unlocks_spec` (`BUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC`):
|
272
|
-
Whether running `bundle update --source NAME` unlocks a gem with the given
|
273
|
-
name. Defaults to `true`.
|
274
263
|
* `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`):
|
275
264
|
Require passing `--all` to `bundle update` when everything should be updated,
|
276
265
|
and disallow passing no options to `bundle update`.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-INIT" "1" "
|
4
|
+
.TH "BUNDLE\-INIT" "1" "June 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-INJECT" "1" "
|
4
|
+
.TH "BUNDLE\-INJECT" "1" "June 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-INSTALL" "1" "
|
4
|
+
.TH "BUNDLE\-INSTALL" "1" "June 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|