bundler 2.6.5 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1172 -1024
- data/README.md +7 -7
- data/bundler.gemspec +2 -2
- data/lib/bundler/build_metadata.rb +10 -11
- data/lib/bundler/checksum.rb +22 -12
- data/lib/bundler/cli/common.rb +1 -1
- data/lib/bundler/cli/config.rb +2 -2
- data/lib/bundler/cli/doctor/diagnose.rb +167 -0
- data/lib/bundler/cli/doctor/ssl.rb +249 -0
- data/lib/bundler/cli/doctor.rb +27 -155
- data/lib/bundler/cli/gem.rb +62 -30
- data/lib/bundler/cli/inject.rb +2 -2
- data/lib/bundler/cli/install.rb +5 -5
- data/lib/bundler/cli/issue.rb +2 -2
- data/lib/bundler/cli/lock.rb +2 -1
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/update.rb +3 -3
- data/lib/bundler/cli.rb +26 -49
- data/lib/bundler/compact_index_client/cache.rb +1 -1
- data/lib/bundler/compact_index_client/parser.rb +1 -1
- data/lib/bundler/compact_index_client/updater.rb +2 -1
- data/lib/bundler/compact_index_client.rb +1 -5
- data/lib/bundler/current_ruby.rb +27 -3
- data/lib/bundler/definition.rb +184 -151
- data/lib/bundler/dependency.rb +1 -1
- data/lib/bundler/dsl.rb +35 -26
- data/lib/bundler/errors.rb +18 -0
- data/lib/bundler/feature_flag.rb +15 -12
- data/lib/bundler/fetcher/dependency.rb +2 -1
- data/lib/bundler/fetcher/downloader.rb +33 -7
- data/lib/bundler/fetcher.rb +49 -19
- data/lib/bundler/friendly_errors.rb +3 -2
- data/lib/bundler/index.rb +7 -2
- data/lib/bundler/injector.rb +9 -9
- data/lib/bundler/installer.rb +6 -5
- data/lib/bundler/lazy_specification.rb +38 -19
- data/lib/bundler/lockfile_parser.rb +29 -10
- 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 +175 -129
- data/lib/bundler/man/bundle-config.1.ronn +93 -88
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +43 -4
- data/lib/bundler/man/bundle-doctor.1.ronn +48 -4
- data/lib/bundler/man/bundle-env.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +3 -3
- data/lib/bundler/man/bundle-exec.1.ronn +2 -2
- data/lib/bundler/man/bundle-fund.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +67 -44
- data/lib/bundler/man/bundle-gem.1.ronn +8 -4
- 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 +2 -2
- data/lib/bundler/man/bundle-inject.1.ronn +1 -1
- data/lib/bundler/man/bundle-install.1 +4 -4
- data/lib/bundler/man/bundle-install.1.ronn +3 -4
- data/lib/bundler/man/bundle-issue.1 +1 -1
- data/lib/bundler/man/bundle-licenses.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 +5 -5
- data/lib/bundler/man/bundle-update.1.ronn +4 -4
- 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/match_platform.rb +31 -12
- data/lib/bundler/materialization.rb +2 -2
- data/lib/bundler/plugin/api/source.rb +1 -1
- data/lib/bundler/plugin/index.rb +1 -1
- data/lib/bundler/plugin/installer/path.rb +8 -0
- data/lib/bundler/plugin.rb +1 -1
- data/lib/bundler/resolver/candidate.rb +12 -9
- data/lib/bundler/resolver/package.rb +1 -1
- data/lib/bundler/resolver/strategy.rb +40 -0
- data/lib/bundler/resolver.rb +18 -27
- data/lib/bundler/rubygems_ext.rb +131 -120
- data/lib/bundler/rubygems_integration.rb +11 -6
- data/lib/bundler/runtime.rb +9 -6
- data/lib/bundler/self_manager.rb +32 -42
- data/lib/bundler/settings/validator.rb +0 -23
- data/lib/bundler/settings.rb +4 -6
- data/lib/bundler/shared_helpers.rb +10 -4
- data/lib/bundler/source/gemspec.rb +1 -4
- data/lib/bundler/source/git/git_proxy.rb +17 -6
- data/lib/bundler/source/git.rb +5 -1
- data/lib/bundler/source/path.rb +9 -2
- data/lib/bundler/source/rubygems/remote.rb +11 -3
- data/lib/bundler/source_list.rb +30 -16
- data/lib/bundler/source_map.rb +1 -1
- data/lib/bundler/spec_set.rb +55 -16
- data/lib/bundler/templates/Executable +0 -11
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -5
- data/lib/bundler/ui/shell.rb +2 -2
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +81 -42
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
- data/lib/bundler/vendor/uri/lib/uri/common.rb +7 -3
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +12 -11
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +6 -6
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/version.rb +10 -2
- data/lib/bundler/worker.rb +1 -1
- data/lib/bundler.rb +14 -12
- metadata +9 -16
- data/lib/bundler/compact_index_client/gem_parser.rb +0 -32
- data/lib/bundler/gem_helpers.rb +0 -144
- data/lib/bundler/templates/Executable.bundler +0 -109
- data/lib/bundler/vendor/connection_pool/.document +0 -1
- data/lib/bundler/vendor/fileutils/.document +0 -1
- data/lib/bundler/vendor/net-http-persistent/.document +0 -1
- data/lib/bundler/vendor/pub_grub/.document +0 -1
- data/lib/bundler/vendor/securerandom/.document +0 -1
- data/lib/bundler/vendor/thor/.document +0 -1
- data/lib/bundler/vendor/tsort/.document +0 -1
- data/lib/bundler/vendor/uri/.document +0 -1
data/lib/bundler.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "bundler/rubygems_ext"
|
3
4
|
require_relative "bundler/vendored_fileutils"
|
4
5
|
require "pathname"
|
5
6
|
require "rbconfig"
|
@@ -7,7 +8,6 @@ require "rbconfig"
|
|
7
8
|
require_relative "bundler/errors"
|
8
9
|
require_relative "bundler/environment_preserver"
|
9
10
|
require_relative "bundler/plugin"
|
10
|
-
require_relative "bundler/rubygems_ext"
|
11
11
|
require_relative "bundler/rubygems_integration"
|
12
12
|
require_relative "bundler/version"
|
13
13
|
require_relative "bundler/current_ruby"
|
@@ -53,7 +53,6 @@ module Bundler
|
|
53
53
|
autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
|
54
54
|
autoload :FREEBSD, File.expand_path("bundler/constants", __dir__)
|
55
55
|
autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
|
56
|
-
autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
|
57
56
|
autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
|
58
57
|
autoload :Graph, File.expand_path("bundler/graph", __dir__)
|
59
58
|
autoload :Index, File.expand_path("bundler/index", __dir__)
|
@@ -114,13 +113,13 @@ module Bundler
|
|
114
113
|
end
|
115
114
|
|
116
115
|
def configured_bundle_path
|
117
|
-
@configured_bundle_path ||= settings.path.tap(&:validate!)
|
116
|
+
@configured_bundle_path ||= Bundler.settings.path.tap(&:validate!)
|
118
117
|
end
|
119
118
|
|
120
119
|
# Returns absolute location of where binstubs are installed to.
|
121
120
|
def bin_path
|
122
121
|
@bin_path ||= begin
|
123
|
-
path = settings[:bin] || "bin"
|
122
|
+
path = Bundler.settings[:bin] || "bin"
|
124
123
|
path = Pathname.new(path).expand_path(root).expand_path
|
125
124
|
mkdir_p(path)
|
126
125
|
path
|
@@ -174,14 +173,14 @@ module Bundler
|
|
174
173
|
self_manager.restart_with_locked_bundler_if_needed
|
175
174
|
end
|
176
175
|
|
177
|
-
# Automatically install dependencies if
|
176
|
+
# Automatically install dependencies if settings[:auto_install] exists.
|
178
177
|
# This is set through config cmd `bundle config set --global auto_install 1`.
|
179
178
|
#
|
180
179
|
# Note that this method `nil`s out the global Definition object, so it
|
181
180
|
# should be called first, before you instantiate anything like an
|
182
181
|
# `Installer` that'll keep a reference to the old one instead.
|
183
182
|
def auto_install
|
184
|
-
return unless settings[:auto_install]
|
183
|
+
return unless Bundler.settings[:auto_install]
|
185
184
|
|
186
185
|
begin
|
187
186
|
definition.specs
|
@@ -239,10 +238,10 @@ module Bundler
|
|
239
238
|
end
|
240
239
|
|
241
240
|
def frozen_bundle?
|
242
|
-
frozen = settings[:frozen]
|
241
|
+
frozen = Bundler.settings[:frozen]
|
243
242
|
return frozen unless frozen.nil?
|
244
243
|
|
245
|
-
settings[:deployment]
|
244
|
+
Bundler.settings[:deployment]
|
246
245
|
end
|
247
246
|
|
248
247
|
def locked_gems
|
@@ -343,7 +342,7 @@ module Bundler
|
|
343
342
|
|
344
343
|
def app_cache(custom_path = nil)
|
345
344
|
path = custom_path || root
|
346
|
-
Pathname.new(path).join(settings.app_cache_path)
|
345
|
+
Pathname.new(path).join(Bundler.settings.app_cache_path)
|
347
346
|
end
|
348
347
|
|
349
348
|
def tmp(name = Process.pid.to_s)
|
@@ -455,10 +454,14 @@ module Bundler
|
|
455
454
|
end
|
456
455
|
|
457
456
|
def local_platform
|
458
|
-
return Gem::Platform::RUBY if settings[:force_ruby_platform]
|
457
|
+
return Gem::Platform::RUBY if Bundler.settings[:force_ruby_platform]
|
459
458
|
Gem::Platform.local
|
460
459
|
end
|
461
460
|
|
461
|
+
def generic_local_platform
|
462
|
+
Gem::Platform.generic(local_platform)
|
463
|
+
end
|
464
|
+
|
462
465
|
def default_gemfile
|
463
466
|
SharedHelpers.default_gemfile
|
464
467
|
end
|
@@ -564,7 +567,7 @@ module Bundler
|
|
564
567
|
end
|
565
568
|
|
566
569
|
def feature_flag
|
567
|
-
@feature_flag ||= FeatureFlag.new(VERSION)
|
570
|
+
@feature_flag ||= FeatureFlag.new(Bundler.settings[:simulate_version] || VERSION)
|
568
571
|
end
|
569
572
|
|
570
573
|
def reset!
|
@@ -580,7 +583,6 @@ module Bundler
|
|
580
583
|
|
581
584
|
def reset_paths!
|
582
585
|
@bin_path = nil
|
583
|
-
@bundler_major_version = nil
|
584
586
|
@bundle_path = nil
|
585
587
|
@configure = nil
|
586
588
|
@configured_bundle_path = nil
|
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.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
@@ -21,7 +21,7 @@ authors:
|
|
21
21
|
- Yehuda Katz
|
22
22
|
bindir: exe
|
23
23
|
cert_chain: []
|
24
|
-
date:
|
24
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
25
25
|
dependencies: []
|
26
26
|
description: Bundler manages an application's dependencies through its entire life,
|
27
27
|
across many machines, systematically and repeatably
|
@@ -55,6 +55,8 @@ files:
|
|
55
55
|
- lib/bundler/cli/config.rb
|
56
56
|
- lib/bundler/cli/console.rb
|
57
57
|
- lib/bundler/cli/doctor.rb
|
58
|
+
- lib/bundler/cli/doctor/diagnose.rb
|
59
|
+
- lib/bundler/cli/doctor/ssl.rb
|
58
60
|
- lib/bundler/cli/exec.rb
|
59
61
|
- lib/bundler/cli/fund.rb
|
60
62
|
- lib/bundler/cli/gem.rb
|
@@ -77,7 +79,6 @@ files:
|
|
77
79
|
- lib/bundler/compact_index_client.rb
|
78
80
|
- lib/bundler/compact_index_client/cache.rb
|
79
81
|
- lib/bundler/compact_index_client/cache_file.rb
|
80
|
-
- lib/bundler/compact_index_client/gem_parser.rb
|
81
82
|
- lib/bundler/compact_index_client/parser.rb
|
82
83
|
- lib/bundler/compact_index_client/updater.rb
|
83
84
|
- lib/bundler/constants.rb
|
@@ -103,7 +104,6 @@ files:
|
|
103
104
|
- lib/bundler/force_platform.rb
|
104
105
|
- lib/bundler/friendly_errors.rb
|
105
106
|
- lib/bundler/gem_helper.rb
|
106
|
-
- lib/bundler/gem_helpers.rb
|
107
107
|
- lib/bundler/gem_tasks.rb
|
108
108
|
- lib/bundler/gem_version_promoter.rb
|
109
109
|
- lib/bundler/graph.rb
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- lib/bundler/resolver/package.rb
|
211
211
|
- lib/bundler/resolver/root.rb
|
212
212
|
- lib/bundler/resolver/spec_group.rb
|
213
|
+
- lib/bundler/resolver/strategy.rb
|
213
214
|
- lib/bundler/retry.rb
|
214
215
|
- lib/bundler/ruby_dsl.rb
|
215
216
|
- lib/bundler/ruby_version.rb
|
@@ -240,7 +241,6 @@ files:
|
|
240
241
|
- lib/bundler/stub_specification.rb
|
241
242
|
- lib/bundler/templates/.document
|
242
243
|
- lib/bundler/templates/Executable
|
243
|
-
- lib/bundler/templates/Executable.bundler
|
244
244
|
- lib/bundler/templates/Executable.standalone
|
245
245
|
- lib/bundler/templates/Gemfile
|
246
246
|
- lib/bundler/templates/newgem/CHANGELOG.md.tt
|
@@ -283,22 +283,18 @@ files:
|
|
283
283
|
- lib/bundler/uri_credentials_filter.rb
|
284
284
|
- lib/bundler/uri_normalizer.rb
|
285
285
|
- lib/bundler/vendor/.document
|
286
|
-
- lib/bundler/vendor/connection_pool/.document
|
287
286
|
- lib/bundler/vendor/connection_pool/LICENSE
|
288
287
|
- lib/bundler/vendor/connection_pool/lib/connection_pool.rb
|
289
288
|
- lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb
|
290
289
|
- lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb
|
291
290
|
- lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
|
292
|
-
- lib/bundler/vendor/fileutils/.document
|
293
291
|
- lib/bundler/vendor/fileutils/COPYING
|
294
292
|
- lib/bundler/vendor/fileutils/lib/fileutils.rb
|
295
|
-
- lib/bundler/vendor/net-http-persistent/.document
|
296
293
|
- lib/bundler/vendor/net-http-persistent/README.rdoc
|
297
294
|
- lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
|
298
295
|
- lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
|
299
296
|
- lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb
|
300
297
|
- lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb
|
301
|
-
- lib/bundler/vendor/pub_grub/.document
|
302
298
|
- lib/bundler/vendor/pub_grub/LICENSE.txt
|
303
299
|
- lib/bundler/vendor/pub_grub/lib/pub_grub.rb
|
304
300
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb
|
@@ -310,16 +306,15 @@ files:
|
|
310
306
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb
|
311
307
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb
|
312
308
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb
|
309
|
+
- lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb
|
313
310
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb
|
314
311
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb
|
315
312
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb
|
316
313
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb
|
317
314
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb
|
318
315
|
- lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb
|
319
|
-
- lib/bundler/vendor/securerandom/.document
|
320
316
|
- lib/bundler/vendor/securerandom/COPYING
|
321
317
|
- lib/bundler/vendor/securerandom/lib/securerandom.rb
|
322
|
-
- lib/bundler/vendor/thor/.document
|
323
318
|
- lib/bundler/vendor/thor/LICENSE.md
|
324
319
|
- lib/bundler/vendor/thor/lib/thor.rb
|
325
320
|
- lib/bundler/vendor/thor/lib/thor/actions.rb
|
@@ -356,10 +351,8 @@ files:
|
|
356
351
|
- lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb
|
357
352
|
- lib/bundler/vendor/thor/lib/thor/util.rb
|
358
353
|
- lib/bundler/vendor/thor/lib/thor/version.rb
|
359
|
-
- lib/bundler/vendor/tsort/.document
|
360
354
|
- lib/bundler/vendor/tsort/LICENSE.txt
|
361
355
|
- lib/bundler/vendor/tsort/lib/tsort.rb
|
362
|
-
- lib/bundler/vendor/uri/.document
|
363
356
|
- lib/bundler/vendor/uri/COPYING
|
364
357
|
- lib/bundler/vendor/uri/lib/uri.rb
|
365
358
|
- lib/bundler/vendor/uri/lib/uri/common.rb
|
@@ -404,14 +397,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
404
397
|
requirements:
|
405
398
|
- - ">="
|
406
399
|
- !ruby/object:Gem::Version
|
407
|
-
version: 3.
|
400
|
+
version: 3.2.0
|
408
401
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
409
402
|
requirements:
|
410
403
|
- - ">="
|
411
404
|
- !ruby/object:Gem::Version
|
412
|
-
version: 3.
|
405
|
+
version: 3.4.1
|
413
406
|
requirements: []
|
414
|
-
rubygems_version: 3.
|
407
|
+
rubygems_version: 3.7.1
|
415
408
|
specification_version: 4
|
416
409
|
summary: The best way to manage your application's dependencies
|
417
410
|
test_files: []
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Bundler
|
4
|
-
class CompactIndexClient
|
5
|
-
if defined?(Gem::Resolver::APISet::GemParser)
|
6
|
-
GemParser = Gem::Resolver::APISet::GemParser
|
7
|
-
else
|
8
|
-
class GemParser
|
9
|
-
EMPTY_ARRAY = [].freeze
|
10
|
-
private_constant :EMPTY_ARRAY
|
11
|
-
|
12
|
-
def parse(line)
|
13
|
-
version_and_platform, rest = line.split(" ", 2)
|
14
|
-
version, platform = version_and_platform.split("-", 2)
|
15
|
-
dependencies, requirements = rest.split("|", 2).map! {|s| s.split(",") } if rest
|
16
|
-
dependencies = dependencies ? dependencies.map! {|d| parse_dependency(d) } : EMPTY_ARRAY
|
17
|
-
requirements = requirements ? requirements.map! {|d| parse_dependency(d) } : EMPTY_ARRAY
|
18
|
-
[version, platform, dependencies, requirements]
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
def parse_dependency(string)
|
24
|
-
dependency = string.split(":")
|
25
|
-
dependency[-1] = dependency[-1].split("&") if dependency.size > 1
|
26
|
-
dependency[0] = -dependency[0]
|
27
|
-
dependency
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
data/lib/bundler/gem_helpers.rb
DELETED
@@ -1,144 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Bundler
|
4
|
-
module GemHelpers
|
5
|
-
GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant
|
6
|
-
GENERICS = [
|
7
|
-
Gem::Platform::JAVA,
|
8
|
-
*Gem::Platform::WINDOWS,
|
9
|
-
].freeze
|
10
|
-
|
11
|
-
def generic(p)
|
12
|
-
GENERIC_CACHE[p] ||= begin
|
13
|
-
found = GENERICS.find do |match|
|
14
|
-
p === match
|
15
|
-
end
|
16
|
-
found || Gem::Platform::RUBY
|
17
|
-
end
|
18
|
-
end
|
19
|
-
module_function :generic
|
20
|
-
|
21
|
-
def generic_local_platform
|
22
|
-
generic(local_platform)
|
23
|
-
end
|
24
|
-
module_function :generic_local_platform
|
25
|
-
|
26
|
-
def local_platform
|
27
|
-
Bundler.local_platform
|
28
|
-
end
|
29
|
-
module_function :local_platform
|
30
|
-
|
31
|
-
def generic_local_platform_is_ruby?
|
32
|
-
generic_local_platform == Gem::Platform::RUBY
|
33
|
-
end
|
34
|
-
module_function :generic_local_platform_is_ruby?
|
35
|
-
|
36
|
-
def platform_specificity_match(spec_platform, user_platform)
|
37
|
-
spec_platform = Gem::Platform.new(spec_platform)
|
38
|
-
|
39
|
-
PlatformMatch.specificity_score(spec_platform, user_platform)
|
40
|
-
end
|
41
|
-
module_function :platform_specificity_match
|
42
|
-
|
43
|
-
def select_all_platform_match(specs, platform, force_ruby: false, prefer_locked: false)
|
44
|
-
matching = if force_ruby
|
45
|
-
specs.select {|spec| spec.match_platform(Gem::Platform::RUBY) && spec.force_ruby_platform! }
|
46
|
-
else
|
47
|
-
specs.select {|spec| spec.match_platform(platform) }
|
48
|
-
end
|
49
|
-
|
50
|
-
if prefer_locked
|
51
|
-
locked_originally = matching.select {|spec| spec.is_a?(LazySpecification) }
|
52
|
-
return locked_originally if locked_originally.any?
|
53
|
-
end
|
54
|
-
|
55
|
-
matching
|
56
|
-
end
|
57
|
-
module_function :select_all_platform_match
|
58
|
-
|
59
|
-
def select_best_platform_match(specs, platform, force_ruby: false, prefer_locked: false)
|
60
|
-
matching = select_all_platform_match(specs, platform, force_ruby: force_ruby, prefer_locked: prefer_locked)
|
61
|
-
|
62
|
-
sort_and_filter_best_platform_match(matching, platform)
|
63
|
-
end
|
64
|
-
module_function :select_best_platform_match
|
65
|
-
|
66
|
-
def select_best_local_platform_match(specs, force_ruby: false)
|
67
|
-
matching = select_all_platform_match(specs, local_platform, force_ruby: force_ruby).filter_map(&:materialized_for_installation)
|
68
|
-
|
69
|
-
sort_best_platform_match(matching, local_platform)
|
70
|
-
end
|
71
|
-
module_function :select_best_local_platform_match
|
72
|
-
|
73
|
-
def sort_and_filter_best_platform_match(matching, platform)
|
74
|
-
return matching if matching.one?
|
75
|
-
|
76
|
-
exact = matching.select {|spec| spec.platform == platform }
|
77
|
-
return exact if exact.any?
|
78
|
-
|
79
|
-
sorted_matching = sort_best_platform_match(matching, platform)
|
80
|
-
exemplary_spec = sorted_matching.first
|
81
|
-
|
82
|
-
sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
|
83
|
-
end
|
84
|
-
module_function :sort_and_filter_best_platform_match
|
85
|
-
|
86
|
-
def sort_best_platform_match(matching, platform)
|
87
|
-
matching.sort_by {|spec| platform_specificity_match(spec.platform, platform) }
|
88
|
-
end
|
89
|
-
module_function :sort_best_platform_match
|
90
|
-
|
91
|
-
class PlatformMatch
|
92
|
-
def self.specificity_score(spec_platform, user_platform)
|
93
|
-
return -1 if spec_platform == user_platform
|
94
|
-
return 1_000_000 if spec_platform.nil? || spec_platform == Gem::Platform::RUBY || user_platform == Gem::Platform::RUBY
|
95
|
-
|
96
|
-
os_match(spec_platform, user_platform) +
|
97
|
-
cpu_match(spec_platform, user_platform) * 10 +
|
98
|
-
platform_version_match(spec_platform, user_platform) * 100
|
99
|
-
end
|
100
|
-
|
101
|
-
def self.os_match(spec_platform, user_platform)
|
102
|
-
if spec_platform.os == user_platform.os
|
103
|
-
0
|
104
|
-
else
|
105
|
-
1
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
def self.cpu_match(spec_platform, user_platform)
|
110
|
-
if spec_platform.cpu == user_platform.cpu
|
111
|
-
0
|
112
|
-
elsif spec_platform.cpu == "arm" && user_platform.cpu.to_s.start_with?("arm")
|
113
|
-
0
|
114
|
-
elsif spec_platform.cpu.nil? || spec_platform.cpu == "universal"
|
115
|
-
1
|
116
|
-
else
|
117
|
-
2
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
def self.platform_version_match(spec_platform, user_platform)
|
122
|
-
if spec_platform.version == user_platform.version
|
123
|
-
0
|
124
|
-
elsif spec_platform.version.nil?
|
125
|
-
1
|
126
|
-
else
|
127
|
-
2
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
def same_specificity(platform, spec, exemplary_spec)
|
133
|
-
platform_specificity_match(spec.platform, platform) == platform_specificity_match(exemplary_spec.platform, platform)
|
134
|
-
end
|
135
|
-
module_function :same_specificity
|
136
|
-
|
137
|
-
def same_deps(spec, exemplary_spec)
|
138
|
-
same_runtime_deps = spec.dependencies.sort == exemplary_spec.dependencies.sort
|
139
|
-
same_metadata_deps = spec.required_ruby_version == exemplary_spec.required_ruby_version && spec.required_rubygems_version == exemplary_spec.required_rubygems_version
|
140
|
-
same_runtime_deps && same_metadata_deps
|
141
|
-
end
|
142
|
-
module_function :same_deps
|
143
|
-
end
|
144
|
-
end
|
@@ -1,109 +0,0 @@
|
|
1
|
-
#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# This file was generated by Bundler.
|
6
|
-
#
|
7
|
-
# The application '<%= executable %>' is installed as part of a gem, and
|
8
|
-
# this file is here to facilitate running it.
|
9
|
-
#
|
10
|
-
|
11
|
-
require "rubygems"
|
12
|
-
|
13
|
-
m = Module.new do
|
14
|
-
module_function
|
15
|
-
|
16
|
-
def invoked_as_script?
|
17
|
-
File.expand_path($0) == File.expand_path(__FILE__)
|
18
|
-
end
|
19
|
-
|
20
|
-
def env_var_version
|
21
|
-
ENV["BUNDLER_VERSION"]
|
22
|
-
end
|
23
|
-
|
24
|
-
def cli_arg_version
|
25
|
-
return unless invoked_as_script? # don't want to hijack other binstubs
|
26
|
-
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
27
|
-
bundler_version = nil
|
28
|
-
update_index = nil
|
29
|
-
ARGV.each_with_index do |a, i|
|
30
|
-
if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
|
31
|
-
bundler_version = a
|
32
|
-
end
|
33
|
-
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
-
bundler_version = $1
|
35
|
-
update_index = i
|
36
|
-
end
|
37
|
-
bundler_version
|
38
|
-
end
|
39
|
-
|
40
|
-
def gemfile
|
41
|
-
gemfile = ENV["BUNDLE_GEMFILE"]
|
42
|
-
return gemfile if gemfile && !gemfile.empty?
|
43
|
-
|
44
|
-
File.expand_path("<%= relative_gemfile_path %>", __dir__)
|
45
|
-
end
|
46
|
-
|
47
|
-
def lockfile
|
48
|
-
lockfile =
|
49
|
-
case File.basename(gemfile)
|
50
|
-
when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
|
51
|
-
else "#{gemfile}.lock"
|
52
|
-
end
|
53
|
-
File.expand_path(lockfile)
|
54
|
-
end
|
55
|
-
|
56
|
-
def lockfile_version
|
57
|
-
return unless File.file?(lockfile)
|
58
|
-
lockfile_contents = File.read(lockfile)
|
59
|
-
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
60
|
-
Regexp.last_match(1)
|
61
|
-
end
|
62
|
-
|
63
|
-
def bundler_requirement
|
64
|
-
@bundler_requirement ||=
|
65
|
-
env_var_version ||
|
66
|
-
cli_arg_version ||
|
67
|
-
bundler_requirement_for(lockfile_version)
|
68
|
-
end
|
69
|
-
|
70
|
-
def bundler_requirement_for(version)
|
71
|
-
return "#{Gem::Requirement.default}.a" unless version
|
72
|
-
|
73
|
-
bundler_gem_version = Gem::Version.new(version)
|
74
|
-
|
75
|
-
bundler_gem_version.approximate_recommendation
|
76
|
-
end
|
77
|
-
|
78
|
-
def load_bundler!
|
79
|
-
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
80
|
-
|
81
|
-
activate_bundler
|
82
|
-
end
|
83
|
-
|
84
|
-
def activate_bundler
|
85
|
-
gem_error = activation_error_handling do
|
86
|
-
gem "bundler", bundler_requirement
|
87
|
-
end
|
88
|
-
return if gem_error.nil?
|
89
|
-
require_error = activation_error_handling do
|
90
|
-
require "bundler/version"
|
91
|
-
end
|
92
|
-
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
93
|
-
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
94
|
-
exit 42
|
95
|
-
end
|
96
|
-
|
97
|
-
def activation_error_handling
|
98
|
-
yield
|
99
|
-
nil
|
100
|
-
rescue StandardError, LoadError => e
|
101
|
-
e
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
m.load_bundler!
|
106
|
-
|
107
|
-
if m.invoked_as_script?
|
108
|
-
load Gem.bin_path("<%= spec.name %>", "<%= executable %>")
|
109
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|
@@ -1 +0,0 @@
|
|
1
|
-
# Vendored files do not need to be documented
|