bundler 2.3.10 → 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 +71 -0
- data/exe/bundler +1 -1
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/common.rb +1 -1
- data/lib/bundler/cli/info.rb +1 -1
- data/lib/bundler/cli/init.rb +1 -1
- data/lib/bundler/cli/install.rb +0 -2
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli.rb +3 -7
- data/lib/bundler/current_ruby.rb +1 -0
- data/lib/bundler/definition.rb +29 -46
- data/lib/bundler/dependency.rb +20 -0
- data/lib/bundler/dsl.rb +7 -11
- data/lib/bundler/endpoint_specification.rb +4 -1
- 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 +4 -13
- 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 +4 -4
- data/lib/bundler/man/bundle-config.1.ronn +8 -6
- 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/spec_group.rb +2 -2
- data/lib/bundler/resolver.rb +73 -43
- data/lib/bundler/ruby_version.rb +0 -13
- data/lib/bundler/rubygems_ext.rb +18 -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 +9 -9
- data/lib/bundler/source/git.rb +7 -9
- data/lib/bundler/source/metadata.rb +2 -2
- 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/templates/Executable +2 -4
- data/lib/bundler/templates/Executable.bundler +1 -1
- data/lib/bundler/templates/Executable.standalone +2 -4
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +32 -26
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/tsort/lib/tsort.rb +318 -319
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler.rb +13 -2
- metadata +3 -3
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
|
@@ -312,29 +312,63 @@ module Bundler
|
|
312
312
|
|
313
313
|
e = Molinillo::VersionConflict.new(conflicts, e.specification_provider) unless conflicts.empty?
|
314
314
|
|
315
|
-
solver_name = "Bundler"
|
316
|
-
possibility_type = "gem"
|
317
315
|
e.message_with_trees(
|
318
|
-
:
|
319
|
-
|
320
|
-
|
316
|
+
:full_message_for_conflict => lambda do |name, conflict|
|
317
|
+
o = if name.end_with?("\0")
|
318
|
+
String.new("Bundler found conflicting requirements for the #{name} version:")
|
319
|
+
else
|
320
|
+
String.new("Bundler could not find compatible versions for gem \"#{name}\":")
|
321
|
+
end
|
322
|
+
o << %(\n)
|
323
|
+
if conflict.locked_requirement
|
324
|
+
o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
|
325
|
+
o << %( #{SharedHelpers.pretty_dependency(conflict.locked_requirement)}\n)
|
326
|
+
o << %(\n)
|
327
|
+
end
|
328
|
+
o << %( In #{name_for_explicit_dependency_source}:\n)
|
329
|
+
trees = conflict.requirement_trees
|
330
|
+
|
321
331
|
# called first, because we want to reduce the amount of work required to find maximal empty sets
|
322
332
|
trees = trees.uniq {|t| t.flatten.map {|dep| [dep.name, dep.requirement] } }
|
323
333
|
|
324
334
|
# bail out if tree size is too big for Array#combination to make any sense
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
335
|
+
if trees.size <= 15
|
336
|
+
maximal = 1.upto(trees.size).map do |size|
|
337
|
+
trees.map(&:last).flatten(1).combination(size).to_a
|
338
|
+
end.flatten(1).select do |deps|
|
339
|
+
Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
|
340
|
+
end.min_by(&:size)
|
341
|
+
|
342
|
+
trees.reject! {|t| !maximal.include?(t.last) } if maximal
|
343
|
+
|
344
|
+
trees.sort_by! {|t| t.reverse.map(&:name) }
|
345
|
+
end
|
346
|
+
|
347
|
+
o << trees.map do |tree|
|
348
|
+
t = "".dup
|
349
|
+
depth = 2
|
350
|
+
|
351
|
+
base_tree = tree.first
|
352
|
+
base_tree_name = base_tree.name
|
353
|
+
|
354
|
+
if base_tree_name.end_with?("\0")
|
355
|
+
t = nil
|
356
|
+
else
|
357
|
+
tree.each do |req|
|
358
|
+
t << " " * depth << SharedHelpers.pretty_dependency(req)
|
359
|
+
unless tree.last == req
|
360
|
+
if spec = conflict.activated_by_name[req.name]
|
361
|
+
t << %( was resolved to #{spec.version}, which)
|
362
|
+
end
|
363
|
+
t << %( depends on)
|
364
|
+
end
|
365
|
+
t << %(\n)
|
366
|
+
depth += 1
|
367
|
+
end
|
368
|
+
end
|
369
|
+
t
|
370
|
+
end.compact.join("\n")
|
371
|
+
|
338
372
|
if name == "bundler"
|
339
373
|
o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
|
340
374
|
|
@@ -355,11 +389,13 @@ module Bundler
|
|
355
389
|
o << "Your bundle requires a different version of Bundler than the one you're running, and that version could not be found.\n"
|
356
390
|
end
|
357
391
|
end
|
392
|
+
elsif name.end_with?("\0")
|
393
|
+
o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(@metadata_requirements.find {|req| req.name == name })}\n\n)
|
358
394
|
elsif conflict.locked_requirement
|
359
395
|
o << "\n"
|
360
|
-
o << %(
|
396
|
+
o << %(Deleting your #{name_for_locking_dependency_source} file and running `bundle install` will rebuild your snapshot from scratch, using only\n)
|
361
397
|
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
|
362
|
-
elsif !conflict.existing
|
398
|
+
elsif !conflict.existing
|
363
399
|
o << "\n"
|
364
400
|
|
365
401
|
relevant_source = conflict.requirement.source || source_for(name)
|
@@ -372,14 +408,8 @@ module Bundler
|
|
372
408
|
|
373
409
|
o << gem_not_found_message(name, conflict.requirement, relevant_source, extra_message)
|
374
410
|
end
|
375
|
-
|
376
|
-
|
377
|
-
:incompatible_version_message_for_conflict => lambda do |name, _conflict|
|
378
|
-
if name.end_with?("\0")
|
379
|
-
%(#{solver_name} found conflicting requirements for the #{name} version:)
|
380
|
-
else
|
381
|
-
%(#{solver_name} could not find compatible versions for #{possibility_type} "#{name}":)
|
382
|
-
end
|
411
|
+
|
412
|
+
o
|
383
413
|
end
|
384
414
|
)
|
385
415
|
end
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -110,19 +110,6 @@ module Bundler
|
|
110
110
|
@ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
|
111
111
|
end
|
112
112
|
|
113
|
-
def to_gem_version_with_patchlevel
|
114
|
-
@gem_version_with_patch ||= begin
|
115
|
-
Gem::Version.create("#{@gem_version}.#{@patchlevel}")
|
116
|
-
rescue ArgumentError
|
117
|
-
@gem_version
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
def exact?
|
122
|
-
return @exact if defined?(@exact)
|
123
|
-
@exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
|
124
|
-
end
|
125
|
-
|
126
113
|
private
|
127
114
|
|
128
115
|
def matches?(requirements, version)
|
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
|
@@ -67,6 +67,23 @@ module Gem
|
|
67
67
|
full_gem_path
|
68
68
|
end
|
69
69
|
|
70
|
+
unless const_defined?(:LATEST_RUBY_WITHOUT_PATCH_VERSIONS)
|
71
|
+
LATEST_RUBY_WITHOUT_PATCH_VERSIONS = Gem::Version.new("2.1")
|
72
|
+
|
73
|
+
alias_method :rg_required_ruby_version=, :required_ruby_version=
|
74
|
+
def required_ruby_version=(req)
|
75
|
+
self.rg_required_ruby_version = req
|
76
|
+
|
77
|
+
@required_ruby_version.requirements.map! do |op, v|
|
78
|
+
if v >= LATEST_RUBY_WITHOUT_PATCH_VERSIONS && v.release.segments.size == 4
|
79
|
+
[op == "~>" ? "=" : op, Gem::Version.new(v.segments.tap {|s| s.delete_at(3) }.join("."))]
|
80
|
+
else
|
81
|
+
[op, v]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
70
87
|
def groups
|
71
88
|
@groups ||= []
|
72
89
|
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"]
|
@@ -274,10 +274,10 @@ module Bundler
|
|
274
274
|
|
275
275
|
def set_bundle_variables
|
276
276
|
# bundler exe & lib folders have same root folder, typical gem installation
|
277
|
-
exe_file = File.expand_path("
|
277
|
+
exe_file = File.expand_path("../../exe/bundle", __dir__)
|
278
278
|
|
279
279
|
# for Ruby core repository testing
|
280
|
-
exe_file = File.expand_path("
|
280
|
+
exe_file = File.expand_path("../../libexec/bundle", __dir__) unless File.exist?(exe_file)
|
281
281
|
|
282
282
|
# bundler is a default gem, exe path is separate
|
283
283
|
exe_file = Bundler.rubygems.bin_path("bundler", "bundle", VERSION) unless File.exist?(exe_file)
|
@@ -309,7 +309,7 @@ module Bundler
|
|
309
309
|
end
|
310
310
|
|
311
311
|
def bundler_ruby_lib
|
312
|
-
|
312
|
+
File.expand_path("..", __dir__)
|
313
313
|
end
|
314
314
|
|
315
315
|
def clean_load_path
|
@@ -325,7 +325,7 @@ module Bundler
|
|
325
325
|
|
326
326
|
def resolve_path(path)
|
327
327
|
expanded = File.expand_path(path)
|
328
|
-
return expanded unless File.
|
328
|
+
return expanded unless File.exist?(expanded)
|
329
329
|
|
330
330
|
File.realpath(expanded)
|
331
331
|
end
|
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
|
|
@@ -5,7 +5,7 @@ module Bundler
|
|
5
5
|
class Metadata < Source
|
6
6
|
def specs
|
7
7
|
@specs ||= Index.build do |idx|
|
8
|
-
idx << Gem::Specification.new("Ruby\0", RubyVersion.system.
|
8
|
+
idx << Gem::Specification.new("Ruby\0", RubyVersion.system.gem_version)
|
9
9
|
idx << Gem::Specification.new("RubyGems\0", Gem::VERSION) do |s|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.default
|
11
11
|
end
|
@@ -22,7 +22,7 @@ module Bundler
|
|
22
22
|
s.summary = "The best way to manage your application's dependencies"
|
23
23
|
s.executables = %w[bundle]
|
24
24
|
# can't point to the actual gemspec or else the require paths will be wrong
|
25
|
-
s.loaded_from =
|
25
|
+
s.loaded_from = __dir__
|
26
26
|
end
|
27
27
|
|
28
28
|
if local_spec = Bundler.rubygems.find_bundler(VERSION)
|
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)
|