bundler 2.2.21 → 2.2.25
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 +63 -0
- data/lib/bundler.rb +4 -9
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +7 -0
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/doctor.rb +12 -2
- data/lib/bundler/cli/install.rb +5 -18
- 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/update.rb +9 -4
- data/lib/bundler/current_ruby.rb +4 -4
- data/lib/bundler/definition.rb +48 -93
- data/lib/bundler/dsl.rb +23 -21
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher/downloader.rb +1 -2
- data/lib/bundler/index.rb +1 -5
- data/lib/bundler/installer.rb +4 -4
- data/lib/bundler/installer/gem_installer.rb +3 -16
- data/lib/bundler/installer/standalone.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +3 -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.rb +2 -0
- data/lib/bundler/plugin/index.rb +4 -1
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/resolver.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +22 -6
- data/lib/bundler/rubygems_gem_installer.rb +5 -1
- data/lib/bundler/runtime.rb +16 -9
- data/lib/bundler/settings.rb +4 -7
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +0 -7
- data/lib/bundler/source/git/git_proxy.rb +1 -2
- data/lib/bundler/source/rubygems.rb +5 -14
- data/lib/bundler/source_list.rb +50 -20
- data/lib/bundler/spec_set.rb +15 -42
- data/lib/bundler/templates/Executable.bundler +6 -6
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +17 -2
- metadata +3 -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"} " \
|
@@ -107,8 +103,8 @@ module Bundler
|
|
107
103
|
if current = @dependencies.find {|d| d.name == dep.name }
|
108
104
|
deleted_dep = @dependencies.delete(current) if current.type == :development
|
109
105
|
|
110
|
-
|
111
|
-
|
106
|
+
unless deleted_dep
|
107
|
+
if current.requirement != dep.requirement
|
112
108
|
return if dep.type == :development
|
113
109
|
|
114
110
|
update_prompt = ""
|
@@ -126,17 +122,14 @@ module Bundler
|
|
126
122
|
raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
|
127
123
|
"You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
|
128
124
|
"#{update_prompt}"
|
125
|
+
else
|
126
|
+
Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
|
127
|
+
"You should probably keep only one of them.\n" \
|
128
|
+
"Remove any duplicate entries and specify the gem only once.\n" \
|
129
|
+
"While it's not a problem now, it could cause errors if you change the version of one of them later."
|
129
130
|
end
|
130
131
|
|
131
|
-
|
132
|
-
Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
|
133
|
-
"You should probably keep only one of them.\n" \
|
134
|
-
"Remove any duplicate entries and specify the gem only once.\n" \
|
135
|
-
"While it's not a problem now, it could cause errors if you change the version of one of them later."
|
136
|
-
end
|
137
|
-
|
138
|
-
if current.source != dep.source
|
139
|
-
unless deleted_dep
|
132
|
+
if current.source != dep.source
|
140
133
|
return if dep.type == :development
|
141
134
|
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
|
142
135
|
"You specified that #{dep.name} (#{dep.requirement}) should come from " \
|
@@ -168,7 +161,7 @@ module Bundler
|
|
168
161
|
elsif block_given?
|
169
162
|
with_source(@sources.add_rubygems_source("remotes" => source), &blk)
|
170
163
|
else
|
171
|
-
@
|
164
|
+
@sources.add_global_rubygems_remote(source)
|
172
165
|
end
|
173
166
|
end
|
174
167
|
|
@@ -222,6 +215,7 @@ module Bundler
|
|
222
215
|
end
|
223
216
|
|
224
217
|
def to_definition(lockfile, unlock)
|
218
|
+
check_primary_source_safety
|
225
219
|
Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
|
226
220
|
end
|
227
221
|
|
@@ -453,13 +447,21 @@ repo_name ||= user_name
|
|
453
447
|
end
|
454
448
|
|
455
449
|
def check_rubygems_source_safety
|
456
|
-
@sources.
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
@sources.add_rubygems_remote(source)
|
450
|
+
if @sources.implicit_global_source?
|
451
|
+
implicit_global_source_warning
|
452
|
+
elsif @sources.aggregate_global_source?
|
453
|
+
multiple_global_source_warning
|
461
454
|
end
|
455
|
+
end
|
456
|
+
|
457
|
+
def implicit_global_source_warning
|
458
|
+
Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \
|
459
|
+
"Not using an explicit global source may result in a different lockfile being generated depending on " \
|
460
|
+
"the gems you have installed locally before bundler is run." \
|
461
|
+
"Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"."
|
462
|
+
end
|
462
463
|
|
464
|
+
def multiple_global_source_warning
|
463
465
|
if Bundler.feature_flag.bundler_3_mode?
|
464
466
|
msg = "This Gemfile contains multiple primary sources. " \
|
465
467
|
"Each source after the first must include a block to indicate which gems " \
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -38,7 +38,6 @@ module Bundler
|
|
38
38
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
39
39
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
40
40
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
41
|
-
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
42
41
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
43
42
|
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
44
43
|
|
@@ -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
|
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
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "shellwords"
|
4
|
-
|
5
3
|
module Bundler
|
6
4
|
class GemInstaller
|
7
5
|
attr_reader :spec, :standalone, :worker, :force, :installer
|
@@ -31,34 +29,23 @@ module Bundler
|
|
31
29
|
|
32
30
|
def specific_failure_message(e)
|
33
31
|
message = "#{e.class}: #{e.message}\n"
|
34
|
-
message += " " + e.backtrace.join("\n ") + "\n\n"
|
32
|
+
message += " " + e.backtrace.join("\n ") + "\n\n"
|
35
33
|
message = message.lines.first + Bundler.ui.add_color(message.lines.drop(1).join, :clear)
|
36
34
|
message + Bundler.ui.add_color(failure_message, :red)
|
37
35
|
end
|
38
36
|
|
39
37
|
def failure_message
|
40
|
-
|
41
|
-
"#{install_error_message}\n#{gem_install_message}"
|
38
|
+
install_error_message
|
42
39
|
end
|
43
40
|
|
44
41
|
def install_error_message
|
45
42
|
"An error occurred while installing #{spec.name} (#{spec.version}), and Bundler cannot continue."
|
46
43
|
end
|
47
44
|
|
48
|
-
def gem_install_message
|
49
|
-
source = spec.source
|
50
|
-
return unless source.respond_to?(:remotes)
|
51
|
-
|
52
|
-
if source.remotes.size == 1
|
53
|
-
"Make sure that `gem install #{spec.name} -v '#{spec.version}' --source '#{source.remotes.first}'` succeeds before bundling."
|
54
|
-
else
|
55
|
-
"Make sure that `gem install #{spec.name} -v '#{spec.version}'` succeeds before bundling."
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
45
|
def spec_settings
|
60
46
|
# Fetch the build settings, if there are any
|
61
47
|
if settings = Bundler.settings["build.#{spec.name}"]
|
48
|
+
require "shellwords"
|
62
49
|
Shellwords.shellsplit(settings)
|
63
50
|
end
|
64
51
|
end
|
@@ -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)
|
@@ -211,10 +195,9 @@ module Bundler
|
|
211
195
|
platform = platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
|
212
196
|
@current_spec = LazySpecification.new(name, version, platform)
|
213
197
|
@current_spec.source = @current_source
|
198
|
+
@current_source.add_dependency_names(name)
|
214
199
|
|
215
|
-
|
216
|
-
# duplicate GIT sections)
|
217
|
-
@specs[@current_spec.identifier] ||= @current_spec
|
200
|
+
@specs[@current_spec.identifier] = @current_spec
|
218
201
|
elsif spaces.size == 6
|
219
202
|
version = version.split(",").map(&:strip) if version
|
220
203
|
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
|