bundler 2.3.13 → 2.3.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/common.rb +1 -1
- data/lib/bundler/cli/install.rb +0 -2
- data/lib/bundler/cli.rb +2 -6
- data/lib/bundler/definition.rb +17 -21
- data/lib/bundler/dependency.rb +2 -0
- data/lib/bundler/dsl.rb +7 -11
- data/lib/bundler/errors.rb +14 -4
- data/lib/bundler/fetcher/base.rb +6 -8
- data/lib/bundler/fetcher.rb +4 -0
- data/lib/bundler/friendly_errors.rb +16 -2
- data/lib/bundler/gem_helpers.rb +1 -1
- data/lib/bundler/injector.rb +4 -0
- data/lib/bundler/inline.rb +1 -11
- data/lib/bundler/installer/gem_installer.rb +14 -1
- data/lib/bundler/installer.rb +2 -11
- data/lib/bundler/lazy_specification.rb +1 -1
- data/lib/bundler/man/bundle-add.1 +7 -3
- data/lib/bundler/man/bundle-add.1.ronn +5 -2
- 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 -1
- 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 +1 -1
- 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 +3 -3
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +0 -4
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/resolver.rb +17 -20
- data/lib/bundler/rubygems_ext.rb +1 -1
- data/lib/bundler/rubygems_gem_installer.rb +11 -8
- data/lib/bundler/rubygems_integration.rb +3 -21
- data/lib/bundler/settings.rb +1 -1
- data/lib/bundler/shared_helpers.rb +5 -5
- data/lib/bundler/source/git.rb +7 -9
- data/lib/bundler/source/path.rb +1 -1
- data/lib/bundler/source/rubygems.rb +90 -86
- data/lib/bundler/source.rb +3 -4
- data/lib/bundler/spec_set.rb +5 -3
- data/lib/bundler/stub_specification.rb +5 -3
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler.rb +12 -1
- metadata +3 -3
@@ -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" "May 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-install\fR \- Install the dependencies specified in your 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\-OUTDATED" "1" "
|
4
|
+
.TH "BUNDLE\-OUTDATED" "1" "May 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-outdated\fR \- List installed gems with newer versions available
|
@@ -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\-PLATFORM" "1" "
|
4
|
+
.TH "BUNDLE\-PLATFORM" "1" "May 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-platform\fR \- Displays platform compatibility information
|
@@ -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\-PRISTINE" "1" "
|
4
|
+
.TH "BUNDLE\-PRISTINE" "1" "May 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
@@ -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\-SHOW" "1" "
|
4
|
+
.TH "BUNDLE\-SHOW" "1" "May 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
|
@@ -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\-UPDATE" "1" "
|
4
|
+
.TH "BUNDLE\-UPDATE" "1" "May 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
data/lib/bundler/man/bundle.1
CHANGED
data/lib/bundler/man/gemfile.5
CHANGED
@@ -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/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.
|
data/lib/bundler/resolver.rb
CHANGED
@@ -19,13 +19,15 @@ module Bundler
|
|
19
19
|
# collection of gemspecs is returned. Otherwise, nil is returned.
|
20
20
|
def self.resolve(requirements, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
|
21
21
|
base = SpecSet.new(base) unless base.is_a?(SpecSet)
|
22
|
-
|
22
|
+
metadata_requirements, regular_requirements = requirements.partition {|dep| dep.name.end_with?("\0") }
|
23
|
+
resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
|
23
24
|
result = resolver.start(requirements)
|
24
|
-
SpecSet.new(SpecSet.new(result).for(
|
25
|
+
SpecSet.new(SpecSet.new(result).for(regular_requirements))
|
25
26
|
end
|
26
27
|
|
27
|
-
def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
|
28
|
+
def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
|
28
29
|
@source_requirements = source_requirements
|
30
|
+
@metadata_requirements = metadata_requirements
|
29
31
|
@base = base
|
30
32
|
@resolver = Molinillo::Resolver.new(self, self)
|
31
33
|
@search_for = {}
|
@@ -231,19 +233,17 @@ module Bundler
|
|
231
233
|
# before dependencies that are unconstrained
|
232
234
|
def amount_constrained(dependency)
|
233
235
|
@amount_constrained ||= {}
|
234
|
-
@amount_constrained[dependency.name] ||=
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
all = index_for(dependency).search(dependency.name).size
|
236
|
+
@amount_constrained[dependency.name] ||= if (base = @base[dependency.name]) && !base.empty?
|
237
|
+
dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
|
238
|
+
else
|
239
|
+
all = index_for(dependency).search(dependency.name).size
|
239
240
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
end
|
241
|
+
if all <= 1
|
242
|
+
all - 1_000_000
|
243
|
+
else
|
244
|
+
search = search_for(dependency)
|
245
|
+
search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? }
|
246
|
+
search - all
|
247
247
|
end
|
248
248
|
end
|
249
249
|
end
|
@@ -344,8 +344,6 @@ module Bundler
|
|
344
344
|
trees.sort_by! {|t| t.reverse.map(&:name) }
|
345
345
|
end
|
346
346
|
|
347
|
-
metadata_requirements = {}
|
348
|
-
|
349
347
|
o << trees.map do |tree|
|
350
348
|
t = "".dup
|
351
349
|
depth = 2
|
@@ -354,7 +352,6 @@ module Bundler
|
|
354
352
|
base_tree_name = base_tree.name
|
355
353
|
|
356
354
|
if base_tree_name.end_with?("\0")
|
357
|
-
metadata_requirements[base_tree_name] = base_tree
|
358
355
|
t = nil
|
359
356
|
else
|
360
357
|
tree.each do |req|
|
@@ -393,10 +390,10 @@ module Bundler
|
|
393
390
|
end
|
394
391
|
end
|
395
392
|
elsif name.end_with?("\0")
|
396
|
-
o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(metadata_requirements
|
393
|
+
o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(@metadata_requirements.find {|req| req.name == name })}\n\n)
|
397
394
|
elsif conflict.locked_requirement
|
398
395
|
o << "\n"
|
399
|
-
o << %(
|
396
|
+
o << %(Deleting your #{name_for_locking_dependency_source} file and running `bundle install` will rebuild your snapshot from scratch, using only\n)
|
400
397
|
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
|
401
398
|
elsif !conflict.existing
|
402
399
|
o << "\n"
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -34,7 +34,7 @@ module Gem
|
|
34
34
|
|
35
35
|
def full_gem_path
|
36
36
|
if source.respond_to?(:root)
|
37
|
-
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
37
|
+
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap {|x| x.untaint if RUBY_VERSION < "2.7" }
|
38
38
|
else
|
39
39
|
rg_full_gem_path
|
40
40
|
end
|
@@ -90,17 +90,20 @@ module Bundler
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
def spec
|
94
|
+
if Bundler.rubygems.provides?("< 3.3.12") # RubyGems implementation rescues and re-raises errors before 3.3.12 and we don't want that
|
95
|
+
@package.spec
|
96
|
+
else
|
97
|
+
super
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
93
101
|
private
|
94
102
|
|
95
103
|
def strict_rm_rf(dir)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
# inside `fileutils` but for now I`m checking whether the folder was
|
100
|
-
# removed after it completes, and raising otherwise.
|
101
|
-
FileUtils.rm_rf dir
|
102
|
-
|
103
|
-
raise PermissionError.new(dir, :delete) if File.directory?(dir)
|
104
|
+
Bundler.rm_rf dir
|
105
|
+
rescue Errno::ENOTEMPTY => e
|
106
|
+
raise DirectoryRemovalError.new(e.cause, "Could not delete previous installation of `#{dir}`")
|
104
107
|
end
|
105
108
|
|
106
109
|
def validate_bundler_checksum(checksum)
|
@@ -203,20 +203,9 @@ module Bundler
|
|
203
203
|
EXT_LOCK
|
204
204
|
end
|
205
205
|
|
206
|
-
def spec_from_gem(path
|
207
|
-
require "rubygems/
|
208
|
-
|
209
|
-
gem_from_path(path, security_policies[policy]).spec
|
210
|
-
rescue Exception, Gem::Exception, Gem::Security::Exception => e # rubocop:disable Lint/RescueException
|
211
|
-
if e.is_a?(Gem::Security::Exception) ||
|
212
|
-
e.message =~ /unknown trust policy|unsigned gem/i ||
|
213
|
-
e.message =~ /couldn't verify (meta)?data signature/i
|
214
|
-
raise SecurityError,
|
215
|
-
"The gem #{File.basename(path, ".gem")} can't be installed because " \
|
216
|
-
"the security policy didn't allow it, with the message: #{e.message}"
|
217
|
-
else
|
218
|
-
raise e
|
219
|
-
end
|
206
|
+
def spec_from_gem(path)
|
207
|
+
require "rubygems/package"
|
208
|
+
Gem::Package.new(path).spec
|
220
209
|
end
|
221
210
|
|
222
211
|
def build_gem(gem_dir, spec)
|
@@ -514,13 +503,6 @@ module Bundler
|
|
514
503
|
Gem::RemoteFetcher.new(proxy)
|
515
504
|
end
|
516
505
|
|
517
|
-
def gem_from_path(path, policy = nil)
|
518
|
-
require "rubygems/package"
|
519
|
-
p = Gem::Package.new(path)
|
520
|
-
p.security_policy = policy if policy
|
521
|
-
p
|
522
|
-
end
|
523
|
-
|
524
506
|
def build(spec, skip_validation = false)
|
525
507
|
require "rubygems/package"
|
526
508
|
Gem::Package.build(spec, skip_validation)
|
data/lib/bundler/settings.rb
CHANGED
@@ -487,7 +487,7 @@ module Bundler
|
|
487
487
|
/ix.freeze
|
488
488
|
|
489
489
|
def self.key_for(key)
|
490
|
-
key = normalize_uri(key).to_s if key.is_a?(String) &&
|
490
|
+
key = normalize_uri(key).to_s if key.is_a?(String) && key.start_with?("http", "mirror.http")
|
491
491
|
key = key.to_s.gsub(".", "__").gsub("-", "___").upcase
|
492
492
|
"BUNDLE_#{key}"
|
493
493
|
end
|
@@ -13,13 +13,13 @@ module Bundler
|
|
13
13
|
def root
|
14
14
|
gemfile = find_gemfile
|
15
15
|
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
|
16
|
-
Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path.parent
|
16
|
+
Pathname.new(gemfile).tap {|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path.parent
|
17
17
|
end
|
18
18
|
|
19
19
|
def default_gemfile
|
20
20
|
gemfile = find_gemfile
|
21
21
|
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
|
22
|
-
Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path
|
22
|
+
Pathname.new(gemfile).tap {|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path
|
23
23
|
end
|
24
24
|
|
25
25
|
def default_lockfile
|
@@ -28,7 +28,7 @@ module Bundler
|
|
28
28
|
case gemfile.basename.to_s
|
29
29
|
when "gems.rb" then Pathname.new(gemfile.sub(/.rb$/, ".locked"))
|
30
30
|
else Pathname.new("#{gemfile}.lock")
|
31
|
-
end.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
31
|
+
end.tap {|x| x.untaint if RUBY_VERSION < "2.7" }
|
32
32
|
end
|
33
33
|
|
34
34
|
def default_bundle_dir
|
@@ -100,7 +100,7 @@ module Bundler
|
|
100
100
|
#
|
101
101
|
# @see {Bundler::PermissionError}
|
102
102
|
def filesystem_access(path, action = :write, &block)
|
103
|
-
yield(path.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" })
|
103
|
+
yield(path.dup.tap {|x| x.untaint if RUBY_VERSION < "2.7" })
|
104
104
|
rescue Errno::EACCES
|
105
105
|
raise PermissionError.new(path, action)
|
106
106
|
rescue Errno::EAGAIN
|
@@ -236,7 +236,7 @@ module Bundler
|
|
236
236
|
|
237
237
|
def search_up(*names)
|
238
238
|
previous = nil
|
239
|
-
current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
239
|
+
current = File.expand_path(SharedHelpers.pwd).tap {|x| x.untaint if RUBY_VERSION < "2.7" }
|
240
240
|
|
241
241
|
until !File.directory?(current) || current == previous
|
242
242
|
if ENV["BUNDLER_SPEC_RUN"]
|
data/lib/bundler/source/git.rb
CHANGED
@@ -181,7 +181,7 @@ module Bundler
|
|
181
181
|
def install(spec, options = {})
|
182
182
|
force = options[:force]
|
183
183
|
|
184
|
-
print_using_message "Using #{version_message(spec)} from #{self}"
|
184
|
+
print_using_message "Using #{version_message(spec, options[:previous_spec])} from #{self}"
|
185
185
|
|
186
186
|
if (requires_checkout? && !@copied) || force
|
187
187
|
Bundler.ui.debug " * Checking out revision: #{ref}"
|
@@ -219,13 +219,11 @@ module Bundler
|
|
219
219
|
# across different projects, this cache will be shared.
|
220
220
|
# When using local git repos, this is set to the local repo.
|
221
221
|
def cache_path
|
222
|
-
@cache_path ||=
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
end.join("git", git_scope)
|
228
|
-
end
|
222
|
+
@cache_path ||= if Bundler.requires_sudo? || Bundler.feature_flag.global_gem_cache?
|
223
|
+
Bundler.user_cache
|
224
|
+
else
|
225
|
+
Bundler.bundle_path.join("cache", "bundler")
|
226
|
+
end.join("git", git_scope)
|
229
227
|
end
|
230
228
|
|
231
229
|
def app_cache_dirname
|
@@ -336,7 +334,7 @@ module Bundler
|
|
336
334
|
|
337
335
|
def load_gemspec(file)
|
338
336
|
stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
|
339
|
-
stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
337
|
+
stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap {|x| x.untaint if RUBY_VERSION < "2.7" }
|
340
338
|
StubSpecification.from_stub(stub)
|
341
339
|
end
|
342
340
|
|
data/lib/bundler/source/path.rb
CHANGED
@@ -82,7 +82,7 @@ module Bundler
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def install(spec, options = {})
|
85
|
-
using_message = "Using #{version_message(spec)} from #{self}"
|
85
|
+
using_message = "Using #{version_message(spec, options[:previous_spec])} from #{self}"
|
86
86
|
using_message += " and installing its executables" unless spec.executables.empty?
|
87
87
|
print_using_message using_message
|
88
88
|
generate_bin(spec, :disable_extensions => true)
|