bundler 2.5.23 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +59 -0
- data/bundler.gemspec +2 -2
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/console.rb +0 -4
- data/lib/bundler/cli/doctor.rb +4 -4
- data/lib/bundler/cli/exec.rb +1 -0
- data/lib/bundler/cli/gem.rb +1 -1
- data/lib/bundler/cli/info.rb +2 -2
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +4 -0
- data/lib/bundler/cli/lock.rb +20 -1
- data/lib/bundler/cli/pristine.rb +1 -1
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli.rb +22 -53
- data/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/lib/bundler/compact_index_client/updater.rb +0 -11
- data/lib/bundler/definition.rb +134 -61
- data/lib/bundler/dependency.rb +1 -1
- data/lib/bundler/dsl.rb +2 -13
- data/lib/bundler/endpoint_specification.rb +10 -1
- data/lib/bundler/errors.rb +10 -0
- data/lib/bundler/feature_flag.rb +1 -0
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/fetcher.rb +10 -3
- data/lib/bundler/gem_helpers.rb +21 -5
- data/lib/bundler/injector.rb +2 -2
- data/lib/bundler/installer/standalone.rb +2 -2
- data/lib/bundler/installer.rb +4 -38
- data/lib/bundler/lazy_specification.rb +65 -24
- data/lib/bundler/lockfile_parser.rb +9 -1
- data/lib/bundler/man/bundle-add.1 +13 -10
- data/lib/bundler/man/bundle-add.1.ronn +12 -9
- data/lib/bundler/man/bundle-binstubs.1 +7 -4
- data/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/lib/bundler/man/bundle-cache.1 +30 -2
- data/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/lib/bundler/man/bundle-check.1 +3 -3
- data/lib/bundler/man/bundle-check.1.ronn +4 -2
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +3 -1
- data/lib/bundler/man/bundle-config.1.ronn +2 -0
- data/lib/bundler/man/bundle-console.1 +2 -4
- data/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/lib/bundler/man/bundle-doctor.1 +2 -2
- data/lib/bundler/man/bundle-doctor.1.ronn +1 -1
- data/lib/bundler/man/bundle-env.1 +9 -0
- data/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/lib/bundler/man/bundle-exec.1 +5 -2
- data/lib/bundler/man/bundle-exec.1.ronn +4 -1
- data/lib/bundler/man/bundle-fund.1 +22 -0
- data/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/lib/bundler/man/bundle-gem.1 +17 -5
- data/lib/bundler/man/bundle-gem.1.ronn +27 -6
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +5 -2
- data/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/lib/bundler/man/bundle-init.1 +3 -3
- data/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/lib/bundler/man/bundle-inject.1 +10 -2
- data/lib/bundler/man/bundle-inject.1.ronn +9 -1
- data/lib/bundler/man/bundle-install.1 +14 -11
- data/lib/bundler/man/bundle-install.1.ronn +21 -16
- data/lib/bundler/man/bundle-issue.1 +45 -0
- data/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/lib/bundler/man/bundle-licenses.1 +9 -0
- data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/lib/bundler/man/bundle-lock.1 +21 -6
- data/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/lib/bundler/man/bundle-open.1 +2 -2
- data/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/lib/bundler/man/bundle-outdated.1 +8 -5
- data/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- 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-pristine.1.ronn +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/lib/bundler/man/bundle-show.1 +5 -2
- data/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/lib/bundler/man/bundle-update.1 +13 -7
- data/lib/bundler/man/bundle-update.1.ronn +14 -6
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle-viz.1 +4 -4
- data/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +1 -1
- data/lib/bundler/man/index.txt +4 -0
- data/lib/bundler/materialization.rb +59 -0
- data/lib/bundler/plugin/events.rb +24 -0
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +6 -1
- data/lib/bundler/resolver/base.rb +2 -6
- data/lib/bundler/resolver/candidate.rb +2 -2
- data/lib/bundler/resolver/spec_group.rb +4 -3
- data/lib/bundler/resolver.rb +5 -5
- data/lib/bundler/rubygems_ext.rb +17 -28
- data/lib/bundler/rubygems_gem_installer.rb +0 -1
- data/lib/bundler/rubygems_integration.rb +21 -11
- data/lib/bundler/runtime.rb +27 -7
- data/lib/bundler/self_manager.rb +2 -3
- data/lib/bundler/settings.rb +1 -0
- data/lib/bundler/shared_helpers.rb +2 -2
- data/lib/bundler/source/git/git_proxy.rb +0 -6
- data/lib/bundler/source/git.rb +56 -31
- data/lib/bundler/source/path.rb +2 -2
- data/lib/bundler/source_list.rb +1 -1
- data/lib/bundler/spec_set.rb +81 -56
- data/lib/bundler/stub_specification.rb +8 -0
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/uri_credentials_filter.rb +1 -1
- data/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/lib/bundler/vendor/securerandom/lib/securerandom.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/lib/bundler/vendor/uri/COPYING +56 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
- data/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
- data/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/lib/bundler/vendored_securerandom.rb +0 -2
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler.rb +37 -13
- metadata +18 -12
- data/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
- data/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
- data/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
- data/lib/bundler/vendor/uri/LICENSE.txt +0 -22
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
#
|
5
|
+
# This class materializes a set of resolved specifications (`LazySpecification`)
|
6
|
+
# for a given gem into the most appropriate real specifications
|
7
|
+
# (`StubSepecification`, `EndpointSpecification`, etc), given a dependency and a
|
8
|
+
# target platform.
|
9
|
+
#
|
10
|
+
class Materialization
|
11
|
+
def initialize(dep, platform, candidates:)
|
12
|
+
@dep = dep
|
13
|
+
@platform = platform
|
14
|
+
@candidates = candidates
|
15
|
+
end
|
16
|
+
|
17
|
+
def complete?
|
18
|
+
specs.any?
|
19
|
+
end
|
20
|
+
|
21
|
+
def specs
|
22
|
+
@specs ||= if @candidates.nil?
|
23
|
+
[]
|
24
|
+
elsif platform
|
25
|
+
GemHelpers.select_best_platform_match(@candidates, platform, force_ruby: dep.force_ruby_platform)
|
26
|
+
else
|
27
|
+
GemHelpers.select_best_local_platform_match(@candidates, force_ruby: dep.force_ruby_platform || dep.default_force_ruby_platform)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def dependencies
|
32
|
+
specs.first.runtime_dependencies.map {|d| [d, platform] }
|
33
|
+
end
|
34
|
+
|
35
|
+
def materialized_spec
|
36
|
+
specs.reject(&:missing?).first&.materialization
|
37
|
+
end
|
38
|
+
|
39
|
+
def completely_missing_specs
|
40
|
+
return [] unless specs.all?(&:missing?)
|
41
|
+
|
42
|
+
specs
|
43
|
+
end
|
44
|
+
|
45
|
+
def partially_missing_specs
|
46
|
+
specs.select(&:missing?)
|
47
|
+
end
|
48
|
+
|
49
|
+
def incomplete_specs
|
50
|
+
return [] if complete?
|
51
|
+
|
52
|
+
@candidates || LazySpecification.new(dep.name, nil, nil)
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
attr_reader :dep, :platform
|
58
|
+
end
|
59
|
+
end
|
@@ -56,6 +56,30 @@ module Bundler
|
|
56
56
|
# Includes an Array of Bundler::Dependency objects
|
57
57
|
# GEM_AFTER_INSTALL_ALL = "after-install-all"
|
58
58
|
define :GEM_AFTER_INSTALL_ALL, "after-install-all"
|
59
|
+
|
60
|
+
# @!parse
|
61
|
+
# A hook called before each individual gem is required
|
62
|
+
# Includes a Bundler::Dependency.
|
63
|
+
# GEM_BEFORE_REQUIRE = "before-require"
|
64
|
+
define :GEM_BEFORE_REQUIRE, "before-require"
|
65
|
+
|
66
|
+
# @!parse
|
67
|
+
# A hook called after each individual gem is required
|
68
|
+
# Includes a Bundler::Dependency.
|
69
|
+
# GEM_AFTER_REQUIRE = "after-require"
|
70
|
+
define :GEM_AFTER_REQUIRE, "after-require"
|
71
|
+
|
72
|
+
# @!parse
|
73
|
+
# A hook called before any gems require
|
74
|
+
# Includes an Array of Bundler::Dependency objects.
|
75
|
+
# GEM_BEFORE_REQUIRE_ALL = "before-require-all"
|
76
|
+
define :GEM_BEFORE_REQUIRE_ALL, "before-require-all"
|
77
|
+
|
78
|
+
# @!parse
|
79
|
+
# A hook called after all gems required
|
80
|
+
# Includes an Array of Bundler::Dependency objects.
|
81
|
+
# GEM_AFTER_REQUIRE_ALL = "after-require-all"
|
82
|
+
define :GEM_AFTER_REQUIRE_ALL, "after-require-all"
|
59
83
|
end
|
60
84
|
end
|
61
85
|
end
|
@@ -34,7 +34,7 @@ module Bundler
|
|
34
34
|
# @return [Hash] map of names to their specs they are installed with
|
35
35
|
def install_definition(definition)
|
36
36
|
def definition.lock(*); end
|
37
|
-
definition.
|
37
|
+
definition.remotely!
|
38
38
|
specs = definition.specs
|
39
39
|
|
40
40
|
install_from_specs specs
|
data/lib/bundler/process_lock.rb
CHANGED
@@ -6,7 +6,7 @@ module Bundler
|
|
6
6
|
lock_file_path = File.join(bundle_path, "bundler.lock")
|
7
7
|
base_lock_file_path = lock_file_path.delete_suffix(".lock")
|
8
8
|
|
9
|
-
require "fileutils" if Bundler.rubygems.provides?("< 3.
|
9
|
+
require "fileutils" if Bundler.rubygems.provides?("< 3.6.0")
|
10
10
|
|
11
11
|
begin
|
12
12
|
SharedHelpers.filesystem_access(lock_file_path, :write) do
|
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
|
13
13
|
attr_reader :name, :version, :platform
|
14
14
|
attr_writer :dependencies
|
15
|
-
attr_accessor :source, :remote
|
15
|
+
attr_accessor :source, :remote, :locked_platform
|
16
16
|
|
17
17
|
def initialize(name, version, platform, spec_fetcher)
|
18
18
|
@name = name
|
@@ -21,6 +21,11 @@ module Bundler
|
|
21
21
|
@platform = Gem::Platform.new(platform)
|
22
22
|
@spec_fetcher = spec_fetcher
|
23
23
|
@dependencies = nil
|
24
|
+
@locked_platform = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def insecurely_materialized?
|
28
|
+
@locked_platform.to_s != @platform.to_s
|
24
29
|
end
|
25
30
|
|
26
31
|
# Needed before installs, since the arch matters then and quick
|
@@ -16,7 +16,7 @@ module Bundler
|
|
16
16
|
hash[name] = Package.new(name, platforms, **options)
|
17
17
|
end
|
18
18
|
|
19
|
-
@requirements = dependencies.
|
19
|
+
@requirements = dependencies.filter_map do |dep|
|
20
20
|
dep_platforms = dep.gem_platforms(platforms)
|
21
21
|
|
22
22
|
# Dependencies scoped to external platforms are ignored
|
@@ -27,11 +27,7 @@ module Bundler
|
|
27
27
|
@packages[name] = Package.new(name, dep_platforms, **options.merge(dependency: dep))
|
28
28
|
|
29
29
|
dep
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def specs_compatible_with(result)
|
34
|
-
@base.specs_compatible_with(result)
|
30
|
+
end
|
35
31
|
end
|
36
32
|
|
37
33
|
def [](name)
|
@@ -34,10 +34,10 @@ module Bundler
|
|
34
34
|
@spec_group.dependencies
|
35
35
|
end
|
36
36
|
|
37
|
-
def to_specs(package)
|
37
|
+
def to_specs(package, most_specific_locked_platform)
|
38
38
|
return [] if package.meta?
|
39
39
|
|
40
|
-
@spec_group.to_specs(package.force_ruby_platform
|
40
|
+
@spec_group.to_specs(package.force_ruby_platform?, most_specific_locked_platform)
|
41
41
|
end
|
42
42
|
|
43
43
|
def prerelease?
|
@@ -25,10 +25,11 @@ module Bundler
|
|
25
25
|
@source ||= exemplary_spec.source
|
26
26
|
end
|
27
27
|
|
28
|
-
def to_specs(force_ruby_platform)
|
28
|
+
def to_specs(force_ruby_platform, most_specific_locked_platform)
|
29
29
|
@specs.map do |s|
|
30
30
|
lazy_spec = LazySpecification.from_spec(s)
|
31
31
|
lazy_spec.force_ruby_platform = force_ruby_platform
|
32
|
+
lazy_spec.most_specific_locked_platform = most_specific_locked_platform
|
32
33
|
lazy_spec
|
33
34
|
end
|
34
35
|
end
|
@@ -38,9 +39,9 @@ module Bundler
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def dependencies
|
41
|
-
@dependencies ||= @specs.
|
42
|
+
@dependencies ||= @specs.flat_map do |spec|
|
42
43
|
__dependencies(spec) + metadata_dependencies(spec)
|
43
|
-
end.
|
44
|
+
end.uniq.sort
|
44
45
|
end
|
45
46
|
|
46
47
|
def ==(other)
|
data/lib/bundler/resolver.rb
CHANGED
@@ -15,10 +15,11 @@ module Bundler
|
|
15
15
|
|
16
16
|
include GemHelpers
|
17
17
|
|
18
|
-
def initialize(base, gem_version_promoter)
|
18
|
+
def initialize(base, gem_version_promoter, most_specific_locked_platform = nil)
|
19
19
|
@source_requirements = base.source_requirements
|
20
20
|
@base = base
|
21
21
|
@gem_version_promoter = gem_version_promoter
|
22
|
+
@most_specific_locked_platform = most_specific_locked_platform
|
22
23
|
end
|
23
24
|
|
24
25
|
def start
|
@@ -79,8 +80,7 @@ module Bundler
|
|
79
80
|
def solve_versions(root:, logger:)
|
80
81
|
solver = PubGrub::VersionSolver.new(source: self, root: root, logger: logger)
|
81
82
|
result = solver.solve
|
82
|
-
|
83
|
-
resolved_specs |= @base.specs_compatible_with(SpecSet.new(resolved_specs))
|
83
|
+
result.flat_map {|package, version| version.to_specs(package, @most_specific_locked_platform) }
|
84
84
|
rescue PubGrub::SolveFailure => e
|
85
85
|
incompatibility = e.incompatibility
|
86
86
|
|
@@ -417,7 +417,7 @@ module Bundler
|
|
417
417
|
end
|
418
418
|
|
419
419
|
def prepare_dependencies(requirements, packages)
|
420
|
-
to_dependency_hash(requirements, packages).
|
420
|
+
to_dependency_hash(requirements, packages).filter_map do |dep_package, dep_constraint|
|
421
421
|
name = dep_package.name
|
422
422
|
|
423
423
|
next [dep_package, dep_constraint] if name == "bundler"
|
@@ -443,7 +443,7 @@ module Bundler
|
|
443
443
|
next unless dep_package.current_platform?
|
444
444
|
|
445
445
|
raise_not_found!(dep_package)
|
446
|
-
end.
|
446
|
+
end.to_h
|
447
447
|
end
|
448
448
|
|
449
449
|
def select_sorted_versions(package, range)
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -79,14 +79,18 @@ module Gem
|
|
79
79
|
include ::Bundler::MatchMetadata
|
80
80
|
include ::Bundler::MatchPlatform
|
81
81
|
|
82
|
-
attr_accessor :remote, :
|
82
|
+
attr_accessor :remote, :relative_loaded_from
|
83
83
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
84
|
+
module AllowSettingSource
|
85
|
+
attr_writer :source
|
86
|
+
|
87
|
+
def source
|
88
|
+
(defined?(@source) && @source) || super
|
89
|
+
end
|
88
90
|
end
|
89
91
|
|
92
|
+
prepend AllowSettingSource
|
93
|
+
|
90
94
|
alias_method :rg_full_gem_path, :full_gem_path
|
91
95
|
alias_method :rg_loaded_from, :loaded_from
|
92
96
|
|
@@ -122,7 +126,9 @@ module Gem
|
|
122
126
|
end
|
123
127
|
end
|
124
128
|
|
125
|
-
|
129
|
+
# Can be removed once RubyGems 3.5.21 support is dropped
|
130
|
+
remove_method :gem_dir if method_defined?(:gem_dir, false)
|
131
|
+
|
126
132
|
def gem_dir
|
127
133
|
full_gem_path
|
128
134
|
end
|
@@ -144,6 +150,10 @@ module Gem
|
|
144
150
|
end
|
145
151
|
end
|
146
152
|
|
153
|
+
def insecurely_materialized?
|
154
|
+
false
|
155
|
+
end
|
156
|
+
|
147
157
|
def groups
|
148
158
|
@groups ||= []
|
149
159
|
end
|
@@ -278,23 +288,6 @@ module Gem
|
|
278
288
|
end
|
279
289
|
end
|
280
290
|
|
281
|
-
# Requirements using lambda operator differentiate trailing zeros since rubygems 3.2.6
|
282
|
-
if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
|
283
|
-
class Requirement
|
284
|
-
module CorrectHashForLambdaOperator
|
285
|
-
def hash
|
286
|
-
if requirements.any? {|r| r.first == "~>" }
|
287
|
-
requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
|
288
|
-
else
|
289
|
-
super
|
290
|
-
end
|
291
|
-
end
|
292
|
-
end
|
293
|
-
|
294
|
-
prepend CorrectHashForLambdaOperator
|
295
|
-
end
|
296
|
-
end
|
297
|
-
|
298
291
|
require "rubygems/platform"
|
299
292
|
|
300
293
|
class Platform
|
@@ -344,10 +337,6 @@ module Gem
|
|
344
337
|
without_gnu_nor_abi_modifiers
|
345
338
|
end
|
346
339
|
end
|
347
|
-
|
348
|
-
if RUBY_ENGINE == "truffleruby" && !defined?(REUSE_AS_BINARY_ON_TRUFFLERUBY)
|
349
|
-
REUSE_AS_BINARY_ON_TRUFFLERUBY = %w[libv8 libv8-node sorbet-static].freeze
|
350
|
-
end
|
351
340
|
end
|
352
341
|
|
353
342
|
Platform.singleton_class.module_eval do
|
@@ -453,7 +442,7 @@ module Gem
|
|
453
442
|
end
|
454
443
|
end
|
455
444
|
|
456
|
-
|
445
|
+
if Gem.rubygems_version < Gem::Version.new("3.6.0")
|
457
446
|
class Package; end
|
458
447
|
require "rubygems/package/tar_reader"
|
459
448
|
require "rubygems/package/tar_reader/entry"
|
@@ -20,10 +20,6 @@ module Bundler
|
|
20
20
|
Gem::Requirement.new(req_str).satisfied_by?(version)
|
21
21
|
end
|
22
22
|
|
23
|
-
def supports_bundler_trampolining?
|
24
|
-
provides?(">= 3.3.0.a")
|
25
|
-
end
|
26
|
-
|
27
23
|
def build_args
|
28
24
|
require "rubygems/command"
|
29
25
|
Gem::Command.build_args
|
@@ -34,6 +30,10 @@ module Bundler
|
|
34
30
|
Gem::Command.build_args = args
|
35
31
|
end
|
36
32
|
|
33
|
+
def set_target_rbconfig(path)
|
34
|
+
Gem.set_target_rbconfig(path)
|
35
|
+
end
|
36
|
+
|
37
37
|
def loaded_specs(name)
|
38
38
|
Gem.loaded_specs[name]
|
39
39
|
end
|
@@ -134,6 +134,18 @@ module Bundler
|
|
134
134
|
loaded_gem_paths.flatten
|
135
135
|
end
|
136
136
|
|
137
|
+
def load_plugins
|
138
|
+
Gem.load_plugins
|
139
|
+
end
|
140
|
+
|
141
|
+
def load_plugin_files(plugin_files)
|
142
|
+
Gem.load_plugin_files(plugin_files)
|
143
|
+
end
|
144
|
+
|
145
|
+
def load_env_plugins
|
146
|
+
Gem.load_env_plugins
|
147
|
+
end
|
148
|
+
|
137
149
|
def ui=(obj)
|
138
150
|
Gem::DefaultUserInteraction.ui = obj
|
139
151
|
end
|
@@ -304,11 +316,7 @@ module Bundler
|
|
304
316
|
@replaced_methods.each do |(sym, klass), method|
|
305
317
|
redefine_method(klass, sym, method)
|
306
318
|
end
|
307
|
-
|
308
|
-
post_reset_hooks.reject! {|proc| proc.binding.source_location[0] == __FILE__ }
|
309
|
-
else
|
310
|
-
post_reset_hooks.reject! {|proc| proc.binding.eval("__FILE__") == __FILE__ }
|
311
|
-
end
|
319
|
+
post_reset_hooks.reject! {|proc| proc.binding.source_location[0] == __FILE__ }
|
312
320
|
@replaced_methods.clear
|
313
321
|
end
|
314
322
|
|
@@ -385,7 +393,9 @@ module Bundler
|
|
385
393
|
def download_gem(spec, uri, cache_dir, fetcher)
|
386
394
|
require "rubygems/remote_fetcher"
|
387
395
|
uri = Bundler.settings.mirror_for(uri)
|
388
|
-
|
396
|
+
redacted_uri = Gem::Uri.redact(uri)
|
397
|
+
|
398
|
+
Bundler::Retry.new("download gem from #{redacted_uri}").attempts do
|
389
399
|
gem_file_name = spec.file_name
|
390
400
|
local_gem_path = File.join cache_dir, gem_file_name
|
391
401
|
return if File.exist? local_gem_path
|
@@ -407,7 +417,7 @@ module Bundler
|
|
407
417
|
end
|
408
418
|
end
|
409
419
|
rescue Gem::RemoteFetcher::FetchError => e
|
410
|
-
raise Bundler::HTTPError, "Could not download gem from #{
|
420
|
+
raise Bundler::HTTPError, "Could not download gem from #{redacted_uri} due to underlying error <#{e.message}>"
|
411
421
|
end
|
412
422
|
|
413
423
|
def build(spec, skip_validation = false)
|
data/lib/bundler/runtime.rb
CHANGED
@@ -41,12 +41,17 @@ module Bundler
|
|
41
41
|
groups.map!(&:to_sym)
|
42
42
|
groups = [:default] if groups.empty?
|
43
43
|
|
44
|
-
@definition.dependencies.
|
45
|
-
#
|
46
|
-
#
|
47
|
-
|
44
|
+
dependencies = @definition.dependencies.select do |dep|
|
45
|
+
# Select the dependency if it is in any of the requested groups, and
|
46
|
+
# for the current platform, and matches the gem constraints.
|
47
|
+
(dep.groups & groups).any? && dep.should_include?
|
48
|
+
end
|
49
|
+
|
50
|
+
Plugin.hook(Plugin::Events::GEM_BEFORE_REQUIRE_ALL, dependencies)
|
48
51
|
|
52
|
+
dependencies.each do |dep|
|
49
53
|
required_file = nil
|
54
|
+
Plugin.hook(Plugin::Events::GEM_BEFORE_REQUIRE, dep)
|
50
55
|
|
51
56
|
begin
|
52
57
|
# Loop through all the specified autorequires for the
|
@@ -76,7 +81,13 @@ module Bundler
|
|
76
81
|
end
|
77
82
|
end
|
78
83
|
end
|
84
|
+
|
85
|
+
Plugin.hook(Plugin::Events::GEM_AFTER_REQUIRE, dep)
|
79
86
|
end
|
87
|
+
|
88
|
+
Plugin.hook(Plugin::Events::GEM_AFTER_REQUIRE_ALL, dependencies)
|
89
|
+
|
90
|
+
dependencies
|
80
91
|
end
|
81
92
|
|
82
93
|
def self.definition_method(meth)
|
@@ -125,7 +136,16 @@ module Bundler
|
|
125
136
|
specs_to_cache.each do |spec|
|
126
137
|
next if spec.name == "bundler"
|
127
138
|
next if spec.source.is_a?(Source::Gemspec)
|
128
|
-
|
139
|
+
if spec.source.respond_to?(:migrate_cache)
|
140
|
+
spec.source.migrate_cache(custom_path, local: local)
|
141
|
+
elsif spec.source.respond_to?(:cache)
|
142
|
+
spec.source.cache(spec, custom_path)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
Dir[cache_path.join("*/.git")].each do |git_dir|
|
147
|
+
FileUtils.rm_rf(git_dir)
|
148
|
+
FileUtils.touch(File.expand_path("../.bundlecache", git_dir))
|
129
149
|
end
|
130
150
|
|
131
151
|
prune_cache(cache_path) unless Bundler.settings[:no_prune]
|
@@ -252,10 +272,10 @@ module Bundler
|
|
252
272
|
|
253
273
|
def setup_manpath
|
254
274
|
# Add man/ subdirectories from activated bundles to MANPATH for man(1)
|
255
|
-
manuals = $LOAD_PATH.
|
275
|
+
manuals = $LOAD_PATH.filter_map do |path|
|
256
276
|
man_subdir = path.sub(/lib$/, "man")
|
257
277
|
man_subdir unless Dir[man_subdir + "/man?/"].empty?
|
258
|
-
end
|
278
|
+
end
|
259
279
|
|
260
280
|
return if manuals.empty?
|
261
281
|
Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
|
data/lib/bundler/self_manager.rb
CHANGED
@@ -84,8 +84,8 @@ module Bundler
|
|
84
84
|
require "shellwords"
|
85
85
|
cmd = [*Shellwords.shellsplit(bundler_spec_original_cmd), *ARGV]
|
86
86
|
else
|
87
|
-
cmd = [
|
88
|
-
cmd.unshift(Gem.ruby) unless File.executable?(
|
87
|
+
cmd = [Process.argv0, *ARGV]
|
88
|
+
cmd.unshift(Gem.ruby) unless File.executable?(Process.argv0)
|
89
89
|
end
|
90
90
|
|
91
91
|
Bundler.with_original_env do
|
@@ -106,7 +106,6 @@ module Bundler
|
|
106
106
|
|
107
107
|
def autoswitching_applies?
|
108
108
|
ENV["BUNDLER_VERSION"].nil? &&
|
109
|
-
Bundler.rubygems.supports_bundler_trampolining? &&
|
110
109
|
ruby_can_restart_with_same_arguments? &&
|
111
110
|
SharedHelpers.in_bundle? &&
|
112
111
|
lockfile_version
|
data/lib/bundler/settings.rb
CHANGED
@@ -162,10 +162,10 @@ module Bundler
|
|
162
162
|
extra_deps = new_deps - old_deps
|
163
163
|
return if extra_deps.empty?
|
164
164
|
|
165
|
-
Bundler.ui.debug "#{spec.full_name} from #{spec.remote} has
|
165
|
+
Bundler.ui.debug "#{spec.full_name} from #{spec.remote} has corrupted API dependencies" \
|
166
166
|
" (was expecting #{old_deps.map(&:to_s)}, but the real spec has #{new_deps.map(&:to_s)})"
|
167
167
|
raise APIResponseMismatchError,
|
168
|
-
"Downloading #{spec.full_name} revealed dependencies not in the API
|
168
|
+
"Downloading #{spec.full_name} revealed dependencies not in the API (#{extra_deps.join(", ")})." \
|
169
169
|
"\nRunning `bundle update #{spec.name}` should fix the problem."
|
170
170
|
end
|
171
171
|
|
@@ -84,12 +84,6 @@ module Bundler
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
def not_a_repository?
|
88
|
-
_, status = git_null("rev-parse", "--resolve-git-dir", path.to_s, dir: path)
|
89
|
-
|
90
|
-
!status.success?
|
91
|
-
end
|
92
|
-
|
93
87
|
def contains?(commit)
|
94
88
|
allowed_with_path do
|
95
89
|
result, status = git_null("branch", "--contains", commit, dir: path)
|