bundler 2.2.18 → 2.2.23
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 +66 -0
- data/bundler.gemspec +1 -1
- data/lib/bundler.rb +5 -6
- data/lib/bundler/build_metadata.rb +2 -2
- 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 +2 -0
- data/lib/bundler/cli/update.rb +8 -3
- data/lib/bundler/current_ruby.rb +4 -4
- data/lib/bundler/definition.rb +27 -55
- data/lib/bundler/dsl.rb +19 -31
- data/lib/bundler/feature_flag.rb +0 -2
- 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 +1 -3
- data/lib/bundler/index.rb +1 -5
- 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 -4
- data/lib/bundler/man/bundle-config.1.ronn +0 -3
- 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/installer.rb +1 -1
- data/lib/bundler/resolver.rb +3 -1
- data/lib/bundler/rubygems_ext.rb +22 -6
- data/lib/bundler/rubygems_integration.rb +4 -3
- data/lib/bundler/settings.rb +23 -9
- data/lib/bundler/source.rb +2 -0
- data/lib/bundler/source/rubygems.rb +10 -21
- data/lib/bundler/source_list.rb +44 -21
- data/lib/bundler/spec_set.rb +3 -7
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/version.rb +1 -1
- metadata +4 -7
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"} " \
|
@@ -106,28 +102,26 @@ module Bundler
|
|
106
102
|
# if there's already a dependency with this name we try to prefer one
|
107
103
|
if current = @dependencies.find {|d| d.name == dep.name }
|
108
104
|
deleted_dep = @dependencies.delete(current) if current.type == :development
|
105
|
+
return if deleted_dep
|
109
106
|
|
110
107
|
if current.requirement != dep.requirement
|
111
|
-
|
112
|
-
return if dep.type == :development
|
108
|
+
return if dep.type == :development
|
113
109
|
|
114
|
-
|
110
|
+
update_prompt = ""
|
115
111
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
112
|
+
if File.basename(@gemfile) == Injector::INJECTED_GEMS
|
113
|
+
if dep.requirements_list.include?(">= 0") && !current.requirements_list.include?(">= 0")
|
114
|
+
update_prompt = ". Gem already added"
|
115
|
+
else
|
116
|
+
update_prompt = ". If you want to update the gem version, run `bundle update #{current.name}`"
|
121
117
|
|
122
|
-
|
123
|
-
end
|
118
|
+
update_prompt += ". You may also need to change the version requirement specified in the Gemfile if it's too restrictive." unless current.requirements_list.include?(">= 0")
|
124
119
|
end
|
125
|
-
|
126
|
-
raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
|
127
|
-
"You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
|
128
|
-
"#{update_prompt}"
|
129
120
|
end
|
130
121
|
|
122
|
+
raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
|
123
|
+
"You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
|
124
|
+
"#{update_prompt}"
|
131
125
|
else
|
132
126
|
Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
|
133
127
|
"You should probably keep only one of them.\n" \
|
@@ -136,12 +130,10 @@ module Bundler
|
|
136
130
|
end
|
137
131
|
|
138
132
|
if current.source != dep.source
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
"#{current.source || "an unspecified source"} and #{dep.source}\n"
|
144
|
-
end
|
133
|
+
return if dep.type == :development
|
134
|
+
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
|
135
|
+
"You specified that #{dep.name} (#{dep.requirement}) should come from " \
|
136
|
+
"#{current.source || "an unspecified source"} and #{dep.source}\n"
|
145
137
|
end
|
146
138
|
end
|
147
139
|
|
@@ -168,7 +160,7 @@ module Bundler
|
|
168
160
|
elsif block_given?
|
169
161
|
with_source(@sources.add_rubygems_source("remotes" => source), &blk)
|
170
162
|
else
|
171
|
-
@
|
163
|
+
@sources.add_global_rubygems_remote(source)
|
172
164
|
end
|
173
165
|
end
|
174
166
|
|
@@ -222,6 +214,7 @@ module Bundler
|
|
222
214
|
end
|
223
215
|
|
224
216
|
def to_definition(lockfile, unlock)
|
217
|
+
check_primary_source_safety
|
225
218
|
Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
|
226
219
|
end
|
227
220
|
|
@@ -453,12 +446,7 @@ repo_name ||= user_name
|
|
453
446
|
end
|
454
447
|
|
455
448
|
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
|
449
|
+
return unless @sources.aggregate_global_source?
|
462
450
|
|
463
451
|
if Bundler.feature_flag.bundler_3_mode?
|
464
452
|
msg = "This Gemfile contains multiple primary sources. " \
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -31,7 +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
34
|
settings_flag(:forget_cli_options) { bundler_3_mode? }
|
36
35
|
settings_flag(:global_gem_cache) { bundler_3_mode? }
|
37
36
|
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
|
@@ -39,7 +38,6 @@ module Bundler
|
|
39
38
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
40
39
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
41
40
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
42
|
-
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
43
41
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
44
42
|
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
45
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,7 +109,7 @@ 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
|
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:
|
115
113
|
https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md
|
116
114
|
EOS
|
117
115
|
end
|
data/lib/bundler/index.rb
CHANGED
@@ -195,11 +195,7 @@ module Bundler
|
|
195
195
|
if base # allow all platforms when searching from a lockfile
|
196
196
|
dependency.matches_spec?(spec)
|
197
197
|
else
|
198
|
-
|
199
|
-
dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
|
200
|
-
else
|
201
|
-
dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform)
|
202
|
-
end
|
198
|
+
dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
|
203
199
|
end
|
204
200
|
end
|
205
201
|
|
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
|
@@ -274,9 +274,6 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
274
274
|
\fBtimeout\fR (\fBBUNDLE_TIMEOUT\fR): The seconds allowed before timing out for network requests\. Defaults to \fB10\fR\.
|
275
275
|
.
|
276
276
|
.IP "\(bu" 4
|
277
|
-
\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\.
|
278
|
-
.
|
279
|
-
.IP "\(bu" 4
|
280
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\.
|
281
278
|
.
|
282
279
|
.IP "\(bu" 4
|
@@ -260,9 +260,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
260
260
|
The location where RubyGems installs binstubs. Defaults to `Gem.bindir`.
|
261
261
|
* `timeout` (`BUNDLE_TIMEOUT`):
|
262
262
|
The seconds allowed before timing out for network requests. Defaults to `10`.
|
263
|
-
* `unlock_source_unlocks_spec` (`BUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC`):
|
264
|
-
Whether running `bundle update --source NAME` unlocks a gem with the given
|
265
|
-
name. Defaults to `true`.
|
266
263
|
* `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`):
|
267
264
|
Require passing `--all` to `bundle update` when everything should be updated,
|
268
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\-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
|