bundler 2.5.11 → 2.5.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +84 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/fund.rb +1 -1
- data/lib/bundler/cli/gem.rb +8 -15
- data/lib/bundler/cli.rb +26 -26
- data/lib/bundler/compact_index_client/cache.rb +47 -81
- data/lib/bundler/compact_index_client/parser.rb +84 -0
- data/lib/bundler/compact_index_client.rb +51 -80
- data/lib/bundler/definition.rb +50 -24
- data/lib/bundler/endpoint_specification.rb +11 -0
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +15 -24
- data/lib/bundler/force_platform.rb +0 -2
- data/lib/bundler/gem_helpers.rb +14 -7
- data/lib/bundler/injector.rb +1 -4
- data/lib/bundler/installer/gem_installer.rb +0 -1
- data/lib/bundler/installer/standalone.rb +0 -3
- data/lib/bundler/installer.rb +1 -3
- data/lib/bundler/lazy_specification.rb +1 -0
- 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 +2 -2
- data/lib/bundler/man/bundle-config.1.ronn +1 -1
- data/lib/bundler/man/bundle-console.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 +7 -1
- data/lib/bundler/man/bundle-gem.1.ronn +11 -0
- data/lib/bundler/man/bundle-help.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-plugin.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-version.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 +1 -0
- data/lib/bundler/resolver/base.rb +4 -0
- data/lib/bundler/resolver/candidate.rb +4 -16
- data/lib/bundler/resolver/package.rb +4 -0
- data/lib/bundler/resolver/spec_group.rb +20 -2
- data/lib/bundler/resolver.rb +18 -9
- data/lib/bundler/rubygems_ext.rb +76 -14
- data/lib/bundler/rubygems_gem_installer.rb +35 -2
- data/lib/bundler/rubygems_integration.rb +16 -2
- data/lib/bundler/runtime.rb +1 -6
- data/lib/bundler/self_manager.rb +22 -2
- data/lib/bundler/settings.rb +12 -8
- data/lib/bundler/setup.rb +3 -0
- data/lib/bundler/shared_helpers.rb +2 -2
- data/lib/bundler/source/git.rb +43 -16
- data/lib/bundler/source/path.rb +0 -13
- data/lib/bundler/source/rubygems.rb +26 -13
- data/lib/bundler/spec_set.rb +15 -13
- data/lib/bundler/stub_specification.rb +8 -0
- data/lib/bundler/vendored_net_http.rb +17 -6
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/yaml_serializer.rb +2 -9
- data/lib/bundler.rb +6 -1
- metadata +4 -3
data/lib/bundler/runtime.rb
CHANGED
@@ -10,7 +10,7 @@ module Bundler
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def setup(*groups)
|
13
|
-
@definition.ensure_equivalent_gemfile_and_lockfile
|
13
|
+
@definition.ensure_equivalent_gemfile_and_lockfile
|
14
14
|
|
15
15
|
# Has to happen first
|
16
16
|
clean_load_path
|
@@ -128,11 +128,6 @@ module Bundler
|
|
128
128
|
spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache)
|
129
129
|
end
|
130
130
|
|
131
|
-
Dir[cache_path.join("*/.git")].each do |git_dir|
|
132
|
-
FileUtils.rm_rf(git_dir)
|
133
|
-
FileUtils.touch(File.expand_path("../.bundlecache", git_dir))
|
134
|
-
end
|
135
|
-
|
136
131
|
prune_cache(cache_path) unless Bundler.settings[:no_prune]
|
137
132
|
end
|
138
133
|
|
data/lib/bundler/self_manager.rb
CHANGED
@@ -70,8 +70,23 @@ module Bundler
|
|
70
70
|
configured_gem_home = ENV["GEM_HOME"]
|
71
71
|
configured_gem_path = ENV["GEM_PATH"]
|
72
72
|
|
73
|
-
|
74
|
-
|
73
|
+
# Bundler specs need some stuff to be required before Bundler starts
|
74
|
+
# running, for example, for faking the compact index API. However, these
|
75
|
+
# flags are lost when we reexec to a different version of Bundler. In the
|
76
|
+
# future, we may be able to properly reconstruct the original Ruby
|
77
|
+
# invocation (see https://bugs.ruby-lang.org/issues/6648), but for now
|
78
|
+
# there's no way to do it, so we need to be explicit about how to re-exec.
|
79
|
+
# This may be a feature end users request at some point, but maybe by that
|
80
|
+
# time, we have builtin tools to do. So for now, we use an undocumented
|
81
|
+
# ENV variable only for our specs.
|
82
|
+
bundler_spec_original_cmd = ENV["BUNDLER_SPEC_ORIGINAL_CMD"]
|
83
|
+
if bundler_spec_original_cmd
|
84
|
+
require "shellwords"
|
85
|
+
cmd = [*Shellwords.shellsplit(bundler_spec_original_cmd), *ARGV]
|
86
|
+
else
|
87
|
+
cmd = [$PROGRAM_NAME, *ARGV]
|
88
|
+
cmd.unshift(Gem.ruby) unless File.executable?($PROGRAM_NAME)
|
89
|
+
end
|
75
90
|
|
76
91
|
Bundler.with_original_env do
|
77
92
|
Kernel.exec(
|
@@ -92,6 +107,7 @@ module Bundler
|
|
92
107
|
def autoswitching_applies?
|
93
108
|
ENV["BUNDLER_VERSION"].nil? &&
|
94
109
|
Bundler.rubygems.supports_bundler_trampolining? &&
|
110
|
+
ruby_can_restart_with_same_arguments? &&
|
95
111
|
SharedHelpers.in_bundle? &&
|
96
112
|
lockfile_version
|
97
113
|
end
|
@@ -151,6 +167,10 @@ module Bundler
|
|
151
167
|
!version.to_s.end_with?(".dev")
|
152
168
|
end
|
153
169
|
|
170
|
+
def ruby_can_restart_with_same_arguments?
|
171
|
+
$PROGRAM_NAME != "-e"
|
172
|
+
end
|
173
|
+
|
154
174
|
def updating?
|
155
175
|
"update".start_with?(ARGV.first || " ") && ARGV[1..-1].any? {|a| a.start_with?("--bundler") }
|
156
176
|
end
|
data/lib/bundler/settings.rb
CHANGED
@@ -103,6 +103,7 @@ module Bundler
|
|
103
103
|
def initialize(root = nil)
|
104
104
|
@root = root
|
105
105
|
@local_config = load_config(local_config_file)
|
106
|
+
@local_root = root || Pathname.new(".bundle").expand_path
|
106
107
|
|
107
108
|
@env_config = ENV.to_h
|
108
109
|
@env_config.select! {|key, _value| key.start_with?("BUNDLE_") }
|
@@ -142,7 +143,7 @@ module Bundler
|
|
142
143
|
end
|
143
144
|
|
144
145
|
def set_local(key, value)
|
145
|
-
local_config_file
|
146
|
+
local_config_file = @local_root.join("config")
|
146
147
|
|
147
148
|
set_key(key, value, @local_config, local_config_file)
|
148
149
|
end
|
@@ -491,6 +492,10 @@ module Bundler
|
|
491
492
|
valid_file = file.exist? && !file.size.zero?
|
492
493
|
return {} unless valid_file
|
493
494
|
serializer_class.load(file.read).inject({}) do |config, (k, v)|
|
495
|
+
k = k.dup
|
496
|
+
k << "/" if /https?:/i.match?(k) && !k.end_with?("/", "__#{FALLBACK_TIMEOUT_URI_OPTION.upcase}")
|
497
|
+
k.gsub!(".", "__")
|
498
|
+
|
494
499
|
unless k.start_with?("#")
|
495
500
|
if k.include?("-")
|
496
501
|
Bundler.ui.warn "Your #{file} config includes `#{k}`, which contains the dash character (`-`).\n" \
|
@@ -518,26 +523,25 @@ module Bundler
|
|
518
523
|
YAMLSerializer
|
519
524
|
end
|
520
525
|
|
521
|
-
|
522
|
-
fallback_timeout
|
523
|
-
].freeze
|
526
|
+
FALLBACK_TIMEOUT_URI_OPTION = "fallback_timeout"
|
524
527
|
|
525
528
|
NORMALIZE_URI_OPTIONS_PATTERN =
|
526
529
|
/
|
527
530
|
\A
|
528
531
|
(\w+\.)? # optional prefix key
|
529
532
|
(https?.*?) # URI
|
530
|
-
(\.#{
|
533
|
+
(\.#{FALLBACK_TIMEOUT_URI_OPTION})? # optional suffix key
|
531
534
|
\z
|
532
535
|
/ix
|
533
536
|
|
534
537
|
def self.key_for(key)
|
535
|
-
key =
|
536
|
-
key =
|
538
|
+
key = key_to_s(key)
|
539
|
+
key = normalize_uri(key) if key.start_with?("http", "mirror.http")
|
540
|
+
key = key.gsub(".", "__")
|
537
541
|
key.gsub!("-", "___")
|
538
542
|
key.upcase!
|
539
543
|
|
540
|
-
key.
|
544
|
+
key.gsub(/\A([ #]*)/, '\1BUNDLE_')
|
541
545
|
end
|
542
546
|
|
543
547
|
# TODO: duplicates Rubygems#normalize_uri
|
data/lib/bundler/setup.rb
CHANGED
@@ -5,6 +5,9 @@ require_relative "shared_helpers"
|
|
5
5
|
if Bundler::SharedHelpers.in_bundle?
|
6
6
|
require_relative "../bundler"
|
7
7
|
|
8
|
+
# autoswitch to locked Bundler version if available
|
9
|
+
Bundler.auto_switch
|
10
|
+
|
8
11
|
# try to auto_install first before we get to the `Bundler.ui.silence`, so user knows what is happening
|
9
12
|
Bundler.auto_install
|
10
13
|
|
@@ -4,14 +4,14 @@ require_relative "version"
|
|
4
4
|
require_relative "rubygems_integration"
|
5
5
|
require_relative "current_ruby"
|
6
6
|
|
7
|
+
autoload :Pathname, "pathname"
|
8
|
+
|
7
9
|
module Bundler
|
8
10
|
autoload :WINDOWS, File.expand_path("constants", __dir__)
|
9
11
|
autoload :FREEBSD, File.expand_path("constants", __dir__)
|
10
12
|
autoload :NULL, File.expand_path("constants", __dir__)
|
11
13
|
|
12
14
|
module SharedHelpers
|
13
|
-
autoload :Pathname, "pathname"
|
14
|
-
|
15
15
|
def root
|
16
16
|
gemfile = find_gemfile
|
17
17
|
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
|
data/lib/bundler/source/git.rb
CHANGED
@@ -32,6 +32,20 @@ module Bundler
|
|
32
32
|
@local = false
|
33
33
|
end
|
34
34
|
|
35
|
+
def remote!
|
36
|
+
return if @allow_remote
|
37
|
+
|
38
|
+
@local_specs = nil
|
39
|
+
@allow_remote = true
|
40
|
+
end
|
41
|
+
|
42
|
+
def cached!
|
43
|
+
return if @allow_cached
|
44
|
+
|
45
|
+
@local_specs = nil
|
46
|
+
@allow_cached = true
|
47
|
+
end
|
48
|
+
|
35
49
|
def self.from_lock(options)
|
36
50
|
new(options.merge("uri" => options.delete("remote")))
|
37
51
|
end
|
@@ -150,7 +164,8 @@ module Bundler
|
|
150
164
|
"does not exist. Run `bundle config unset local.#{override_for(original_path)}` to remove the local override"
|
151
165
|
end
|
152
166
|
|
153
|
-
|
167
|
+
@local = true
|
168
|
+
set_paths!(path)
|
154
169
|
|
155
170
|
# Create a new git proxy without the cached revision
|
156
171
|
# so the Gemfile.lock always picks up the new revision.
|
@@ -173,13 +188,11 @@ module Bundler
|
|
173
188
|
end
|
174
189
|
|
175
190
|
def specs(*)
|
176
|
-
|
191
|
+
set_cache_path!(app_cache_path) if has_app_cache? && !local?
|
177
192
|
|
178
193
|
if requires_checkout? && !@copied
|
179
194
|
fetch
|
180
|
-
|
181
|
-
serialize_gemspecs_in(install_path)
|
182
|
-
@copied = true
|
195
|
+
checkout
|
183
196
|
end
|
184
197
|
|
185
198
|
local_specs
|
@@ -192,10 +205,7 @@ module Bundler
|
|
192
205
|
print_using_message "Using #{version_message(spec, options[:previous_spec])} from #{self}"
|
193
206
|
|
194
207
|
if (requires_checkout? && !@copied) || force
|
195
|
-
|
196
|
-
git_proxy.copy_to(install_path, submodules)
|
197
|
-
serialize_gemspecs_in(install_path)
|
198
|
-
@copied = true
|
208
|
+
checkout
|
199
209
|
end
|
200
210
|
|
201
211
|
generate_bin_options = { disable_extensions: !Bundler.rubygems.spec_missing_extensions?(spec), build_args: options[:build_args] }
|
@@ -207,12 +217,13 @@ module Bundler
|
|
207
217
|
def cache(spec, custom_path = nil)
|
208
218
|
app_cache_path = app_cache_path(custom_path)
|
209
219
|
return unless Bundler.feature_flag.cache_all?
|
210
|
-
return if
|
220
|
+
return if install_path == app_cache_path
|
221
|
+
return if cache_path == app_cache_path
|
211
222
|
cached!
|
212
223
|
FileUtils.rm_rf(app_cache_path)
|
213
224
|
git_proxy.checkout if requires_checkout?
|
214
|
-
|
215
|
-
|
225
|
+
FileUtils.cp_r("#{cache_path}/.", app_cache_path)
|
226
|
+
FileUtils.touch(app_cache_path.join(".bundlecache"))
|
216
227
|
end
|
217
228
|
|
218
229
|
def load_spec_files
|
@@ -256,6 +267,13 @@ module Bundler
|
|
256
267
|
|
257
268
|
private
|
258
269
|
|
270
|
+
def checkout
|
271
|
+
Bundler.ui.debug " * Checking out revision: #{ref}"
|
272
|
+
git_proxy.copy_to(install_path, submodules)
|
273
|
+
serialize_gemspecs_in(install_path)
|
274
|
+
@copied = true
|
275
|
+
end
|
276
|
+
|
259
277
|
def humanized_ref
|
260
278
|
if local?
|
261
279
|
path
|
@@ -284,10 +302,19 @@ module Bundler
|
|
284
302
|
end
|
285
303
|
end
|
286
304
|
|
287
|
-
def
|
288
|
-
|
289
|
-
|
290
|
-
|
305
|
+
def set_paths!(path)
|
306
|
+
set_cache_path!(path)
|
307
|
+
set_install_path!(path)
|
308
|
+
end
|
309
|
+
|
310
|
+
def set_cache_path!(path)
|
311
|
+
@git_proxy = nil
|
312
|
+
@cache_path = path
|
313
|
+
end
|
314
|
+
|
315
|
+
def set_install_path!(path)
|
316
|
+
@local_specs = nil
|
317
|
+
@install_path = path
|
291
318
|
end
|
292
319
|
|
293
320
|
def has_app_cache?
|
data/lib/bundler/source/path.rb
CHANGED
@@ -18,9 +18,6 @@ module Bundler
|
|
18
18
|
@options = options.dup
|
19
19
|
@glob = options["glob"] || DEFAULT_GLOB
|
20
20
|
|
21
|
-
@allow_cached = false
|
22
|
-
@allow_remote = false
|
23
|
-
|
24
21
|
@root_path = options["root_path"] || root
|
25
22
|
|
26
23
|
if options["path"]
|
@@ -41,16 +38,6 @@ module Bundler
|
|
41
38
|
@original_path = @path
|
42
39
|
end
|
43
40
|
|
44
|
-
def remote!
|
45
|
-
@local_specs = nil
|
46
|
-
@allow_remote = true
|
47
|
-
end
|
48
|
-
|
49
|
-
def cached!
|
50
|
-
@local_specs = nil
|
51
|
-
@allow_cached = true
|
52
|
-
end
|
53
|
-
|
54
41
|
def self.from_lock(options)
|
55
42
|
new(options.merge("path" => options.delete("remote")))
|
56
43
|
end
|
@@ -22,6 +22,8 @@ module Bundler
|
|
22
22
|
@checksum_store = Checksum::Store.new
|
23
23
|
|
24
24
|
Array(options["remotes"]).reverse_each {|r| add_remote(r) }
|
25
|
+
|
26
|
+
@lockfile_remotes = @remotes if options["from_lockfile"]
|
25
27
|
end
|
26
28
|
|
27
29
|
def caches
|
@@ -91,13 +93,13 @@ module Bundler
|
|
91
93
|
|
92
94
|
def self.from_lock(options)
|
93
95
|
options["remotes"] = Array(options.delete("remote")).reverse
|
94
|
-
new(options)
|
96
|
+
new(options.merge("from_lockfile" => true))
|
95
97
|
end
|
96
98
|
|
97
99
|
def to_lock
|
98
100
|
out = String.new("GEM\n")
|
99
|
-
|
100
|
-
out << " remote: #{
|
101
|
+
lockfile_remotes.reverse_each do |remote|
|
102
|
+
out << " remote: #{remote}\n"
|
101
103
|
end
|
102
104
|
out << " specs:\n"
|
103
105
|
end
|
@@ -136,20 +138,17 @@ module Bundler
|
|
136
138
|
index = @allow_remote ? remote_specs.dup : Index.new
|
137
139
|
index.merge!(cached_specs) if @allow_cached
|
138
140
|
index.merge!(installed_specs) if @allow_local
|
141
|
+
|
142
|
+
# complete with default specs, only if not already available in the
|
143
|
+
# index through remote, cached, or installed specs
|
144
|
+
index.use(default_specs) if @allow_local
|
145
|
+
|
139
146
|
index
|
140
147
|
end
|
141
148
|
end
|
142
149
|
|
143
150
|
def install(spec, options = {})
|
144
|
-
|
145
|
-
ensure_builtin_gems_cached = options[:ensure_builtin_gems_cached]
|
146
|
-
|
147
|
-
if ensure_builtin_gems_cached && spec.default_gem? && !cached_path(spec)
|
148
|
-
cached_built_in_gem(spec) unless spec.remote
|
149
|
-
force = true
|
150
|
-
end
|
151
|
-
|
152
|
-
if installed?(spec) && !force
|
151
|
+
if (spec.default_gem? && !cached_built_in_gem(spec)) || (installed?(spec) && !options[:force])
|
153
152
|
print_using_message "Using #{version_message(spec, options[:previous_spec])}"
|
154
153
|
return nil # no post-install message
|
155
154
|
end
|
@@ -207,6 +206,7 @@ module Bundler
|
|
207
206
|
|
208
207
|
spec.full_gem_path = installed_spec.full_gem_path
|
209
208
|
spec.loaded_from = installed_spec.loaded_from
|
209
|
+
spec.base_dir = installed_spec.base_dir
|
210
210
|
|
211
211
|
spec.post_install_message
|
212
212
|
end
|
@@ -362,7 +362,7 @@ module Bundler
|
|
362
362
|
|
363
363
|
def installed_specs
|
364
364
|
@installed_specs ||= Index.build do |idx|
|
365
|
-
Bundler.rubygems.
|
365
|
+
Bundler.rubygems.installed_specs.reverse_each do |spec|
|
366
366
|
spec.source = self
|
367
367
|
if Bundler.rubygems.spec_missing_extensions?(spec, false)
|
368
368
|
Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
|
@@ -373,6 +373,15 @@ module Bundler
|
|
373
373
|
end
|
374
374
|
end
|
375
375
|
|
376
|
+
def default_specs
|
377
|
+
@default_specs ||= Index.build do |idx|
|
378
|
+
Bundler.rubygems.default_specs.each do |spec|
|
379
|
+
spec.source = self
|
380
|
+
idx << spec
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
376
385
|
def cached_specs
|
377
386
|
@cached_specs ||= begin
|
378
387
|
idx = Index.new
|
@@ -457,6 +466,10 @@ module Bundler
|
|
457
466
|
|
458
467
|
private
|
459
468
|
|
469
|
+
def lockfile_remotes
|
470
|
+
@lockfile_remotes || credless_remotes
|
471
|
+
end
|
472
|
+
|
460
473
|
# Checks if the requested spec exists in the global cache. If it does,
|
461
474
|
# we copy it to the download path, and if it does not, we download it.
|
462
475
|
#
|
data/lib/bundler/spec_set.rb
CHANGED
@@ -71,12 +71,6 @@ module Bundler
|
|
71
71
|
platforms
|
72
72
|
end
|
73
73
|
|
74
|
-
def complete_platforms!(platforms)
|
75
|
-
platforms.each do |platform|
|
76
|
-
complete_platform(platform)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
74
|
def validate_deps(s)
|
81
75
|
s.runtime_dependencies.each do |dep|
|
82
76
|
next if dep.name == "bundler"
|
@@ -100,7 +94,7 @@ module Bundler
|
|
100
94
|
end
|
101
95
|
|
102
96
|
def delete(specs)
|
103
|
-
specs.each {|spec| @specs.delete(spec) }
|
97
|
+
Array(specs).each {|spec| @specs.delete(spec) }
|
104
98
|
|
105
99
|
reset!
|
106
100
|
end
|
@@ -158,6 +152,12 @@ module Bundler
|
|
158
152
|
@specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
|
159
153
|
end
|
160
154
|
|
155
|
+
def specs_compatible_with(other)
|
156
|
+
select do |spec|
|
157
|
+
other.valid?(spec)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
161
|
def delete_by_name(name)
|
162
162
|
@specs.reject! {|spec| spec.name == name }
|
163
163
|
|
@@ -195,6 +195,10 @@ module Bundler
|
|
195
195
|
lookup.keys
|
196
196
|
end
|
197
197
|
|
198
|
+
def valid?(s)
|
199
|
+
s.matches_current_metadata? && valid_dependencies?(s)
|
200
|
+
end
|
201
|
+
|
198
202
|
private
|
199
203
|
|
200
204
|
def reset!
|
@@ -209,7 +213,7 @@ module Bundler
|
|
209
213
|
spec = specs.first
|
210
214
|
matching_specs = spec.source.specs.search([spec.name, spec.version])
|
211
215
|
platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
|
212
|
-
|
216
|
+
valid?(s)
|
213
217
|
end
|
214
218
|
|
215
219
|
if platform_spec
|
@@ -273,13 +277,11 @@ module Bundler
|
|
273
277
|
specs_for_name = lookup[dep.name]
|
274
278
|
return [] unless specs_for_name
|
275
279
|
|
276
|
-
|
277
|
-
GemHelpers.
|
280
|
+
if platform
|
281
|
+
GemHelpers.select_best_platform_match(specs_for_name, platform, force_ruby: dep.force_ruby_platform)
|
278
282
|
else
|
279
|
-
GemHelpers.
|
283
|
+
GemHelpers.select_best_local_platform_match(specs_for_name, force_ruby: dep.force_ruby_platform || dep.default_force_ruby_platform)
|
280
284
|
end
|
281
|
-
matching_specs.map!(&:materialize_for_installation).compact! if platform.nil?
|
282
|
-
matching_specs
|
283
285
|
end
|
284
286
|
|
285
287
|
def tsort_each_child(s)
|
@@ -1,12 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
# This defined? guard can be removed once RubyGems 3.4 support is dropped.
|
4
|
+
#
|
5
|
+
# Bundler specs load this code from `spec/support/vendored_net_http.rb` to avoid
|
6
|
+
# activating the Bundler gem too early. Without this guard, we get redefinition
|
7
|
+
# warnings once Bundler is actually activated and
|
8
|
+
# `lib/bundler/vendored_net_http.rb` is required. This is not an issue in
|
9
|
+
# RubyGems versions including `rubygems/vendored_net_http` since `require` takes
|
10
|
+
# care of avoiding the double load.
|
11
|
+
#
|
12
|
+
unless defined?(Gem::Net)
|
6
13
|
begin
|
7
|
-
require "rubygems/
|
14
|
+
require "rubygems/vendored_net_http"
|
8
15
|
rescue LoadError
|
9
|
-
|
10
|
-
|
16
|
+
begin
|
17
|
+
require "rubygems/net/http"
|
18
|
+
rescue LoadError
|
19
|
+
require "net/http"
|
20
|
+
Gem::Net = Net
|
21
|
+
end
|
11
22
|
end
|
12
23
|
end
|
data/lib/bundler/version.rb
CHANGED
@@ -41,7 +41,7 @@ module Bundler
|
|
41
41
|
HASH_REGEX = /
|
42
42
|
^
|
43
43
|
([ ]*) # indentations
|
44
|
-
(
|
44
|
+
([^#]+) # key excludes comment char '#'
|
45
45
|
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
|
46
46
|
[ ]?
|
47
47
|
(['"]?) # optional opening quote
|
@@ -60,7 +60,6 @@ module Bundler
|
|
60
60
|
indent, key, quote, val = match.captures
|
61
61
|
val = strip_comment(val)
|
62
62
|
|
63
|
-
convert_to_backward_compatible_key!(key)
|
64
63
|
depth = indent.size / 2
|
65
64
|
if quote.empty? && val.empty?
|
66
65
|
new_hash = {}
|
@@ -92,14 +91,8 @@ module Bundler
|
|
92
91
|
end
|
93
92
|
end
|
94
93
|
|
95
|
-
# for settings' keys
|
96
|
-
def convert_to_backward_compatible_key!(key)
|
97
|
-
key << "/" if /https?:/i.match?(key) && !%r{/\Z}.match?(key)
|
98
|
-
key.gsub!(".", "__")
|
99
|
-
end
|
100
|
-
|
101
94
|
class << self
|
102
|
-
private :dump_hash
|
95
|
+
private :dump_hash
|
103
96
|
end
|
104
97
|
end
|
105
98
|
end
|
data/lib/bundler.rb
CHANGED
@@ -42,6 +42,7 @@ module Bundler
|
|
42
42
|
autoload :Checksum, File.expand_path("bundler/checksum", __dir__)
|
43
43
|
autoload :CLI, File.expand_path("bundler/cli", __dir__)
|
44
44
|
autoload :CIDetector, File.expand_path("bundler/ci_detector", __dir__)
|
45
|
+
autoload :CompactIndexClient, File.expand_path("bundler/compact_index_client", __dir__)
|
45
46
|
autoload :Definition, File.expand_path("bundler/definition", __dir__)
|
46
47
|
autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
|
47
48
|
autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
|
@@ -166,6 +167,10 @@ module Bundler
|
|
166
167
|
end
|
167
168
|
end
|
168
169
|
|
170
|
+
def auto_switch
|
171
|
+
self_manager.restart_with_locked_bundler_if_needed
|
172
|
+
end
|
173
|
+
|
169
174
|
# Automatically install dependencies if Bundler.settings[:auto_install] exists.
|
170
175
|
# This is set through config cmd `bundle config set --global auto_install 1`.
|
171
176
|
#
|
@@ -356,7 +361,7 @@ module Bundler
|
|
356
361
|
def settings
|
357
362
|
@settings ||= Settings.new(app_config_path)
|
358
363
|
rescue GemfileNotFound
|
359
|
-
@settings = Settings.new
|
364
|
+
@settings = Settings.new
|
360
365
|
end
|
361
366
|
|
362
367
|
# @return [Hash] Environment present before Bundler was activated
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
@@ -22,7 +22,7 @@ authors:
|
|
22
22
|
autorequire:
|
23
23
|
bindir: exe
|
24
24
|
cert_chain: []
|
25
|
-
date: 2024-
|
25
|
+
date: 2024-08-01 00:00:00.000000000 Z
|
26
26
|
dependencies: []
|
27
27
|
description: Bundler manages an application's dependencies through its entire life,
|
28
28
|
across many machines, systematically and repeatably
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- lib/bundler/compact_index_client/cache.rb
|
80
80
|
- lib/bundler/compact_index_client/cache_file.rb
|
81
81
|
- lib/bundler/compact_index_client/gem_parser.rb
|
82
|
+
- lib/bundler/compact_index_client/parser.rb
|
82
83
|
- lib/bundler/compact_index_client/updater.rb
|
83
84
|
- lib/bundler/constants.rb
|
84
85
|
- lib/bundler/current_ruby.rb
|
@@ -399,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
399
400
|
- !ruby/object:Gem::Version
|
400
401
|
version: 3.2.3
|
401
402
|
requirements: []
|
402
|
-
rubygems_version: 3.5.
|
403
|
+
rubygems_version: 3.5.17
|
403
404
|
signing_key:
|
404
405
|
specification_version: 4
|
405
406
|
summary: The best way to manage your application's dependencies
|