bundler 2.3.10 → 2.3.13
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 +30 -0
- data/exe/bundler +1 -1
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/cli/info.rb +1 -1
- data/lib/bundler/cli/init.rb +1 -1
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli.rb +1 -1
- data/lib/bundler/current_ruby.rb +1 -0
- data/lib/bundler/definition.rb +18 -31
- data/lib/bundler/dependency.rb +18 -0
- data/lib/bundler/endpoint_specification.rb +4 -1
- data/lib/bundler/installer.rb +2 -2
- data/lib/bundler/man/bundle-config.1 +3 -3
- data/lib/bundler/man/bundle-config.1.ronn +8 -6
- data/lib/bundler/resolver/spec_group.rb +2 -2
- data/lib/bundler/resolver.rb +60 -27
- data/lib/bundler/ruby_version.rb +0 -13
- data/lib/bundler/rubygems_ext.rb +17 -0
- data/lib/bundler/shared_helpers.rb +4 -4
- data/lib/bundler/source/metadata.rb +2 -2
- 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 +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcf48063fd68ff2303185f1bb117dcb52395cfdbc622d9a41dfc658115b196eb
|
4
|
+
data.tar.gz: 28a397130a9eb30ec877e7563cecccf29e8a1d849096028a6c49eb7ddd48ebd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e1ef096a5444ba67c2b3d89ad91f6e26df973c18793c41b96ff2797ca15be596df5e6bd0c78a9e17d9078d30f5e348bcc17cde5d76bb1ce2534f3247716538f
|
7
|
+
data.tar.gz: 2ab4b43b9863888cb4515a5305b1fcbcb5eb4fa5e4f9aaa27c8202ad0de0a210dbf3304318728514436513060e950a8bfbad0c849f6ae73ac61eac120b36d644
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
# 2.3.13 (May 4, 2022)
|
2
|
+
|
3
|
+
## Bug fixes:
|
4
|
+
|
5
|
+
- Fix missing required rubygems version when using old APIs [#5496](https://github.com/rubygems/rubygems/pull/5496)
|
6
|
+
- Fix crash when gem used twice in Gemfile under different platforms [#5187](https://github.com/rubygems/rubygems/pull/5187)
|
7
|
+
|
8
|
+
## Performance:
|
9
|
+
|
10
|
+
- Speed up `bundler/setup` time [#5503](https://github.com/rubygems/rubygems/pull/5503)
|
11
|
+
|
12
|
+
# 2.3.12 (April 20, 2022)
|
13
|
+
|
14
|
+
## Enhancements:
|
15
|
+
|
16
|
+
- Improve Ruby version resolution conflicts [#5474](https://github.com/rubygems/rubygems/pull/5474)
|
17
|
+
- Stop considering `RUBY_PATCHLEVEL` for resolution [#5472](https://github.com/rubygems/rubygems/pull/5472)
|
18
|
+
- Add modern rubies as valid platform values in Gemfile DSL [#5469](https://github.com/rubygems/rubygems/pull/5469)
|
19
|
+
|
20
|
+
# 2.3.11 (April 7, 2022)
|
21
|
+
|
22
|
+
## Enhancements:
|
23
|
+
|
24
|
+
- Bump actions/checkout to 3 in bundler gem template [#5445](https://github.com/rubygems/rubygems/pull/5445)
|
25
|
+
- Prefer `__dir__` to `__FILE__` [#5444](https://github.com/rubygems/rubygems/pull/5444)
|
26
|
+
|
27
|
+
## Documentation:
|
28
|
+
|
29
|
+
- Update bundler documentation to reflect bundle config scope changes [#5441](https://github.com/rubygems/rubygems/pull/5441)
|
30
|
+
|
1
31
|
# 2.3.10 (March 23, 2022)
|
2
32
|
|
3
33
|
## Enhancements:
|
data/exe/bundler
CHANGED
@@ -4,8 +4,8 @@ module Bundler
|
|
4
4
|
# Represents metadata from when the Bundler gem was built.
|
5
5
|
module BuildMetadata
|
6
6
|
# begin ivars
|
7
|
-
@built_at = "2022-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2022-05-04".freeze
|
8
|
+
@git_commit_sha = "b20be5a433".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
@@ -29,7 +29,7 @@ module Bundler
|
|
29
29
|
|
30
30
|
# If Bundler has been installed without its .git directory and without a
|
31
31
|
# commit instance variable then we can't determine its commits SHA.
|
32
|
-
git_dir = File.
|
32
|
+
git_dir = File.expand_path("../../../.git", __dir__)
|
33
33
|
if File.directory?(git_dir)
|
34
34
|
return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
|
35
35
|
end
|
data/lib/bundler/cli/info.rb
CHANGED
data/lib/bundler/cli/init.rb
CHANGED
@@ -32,7 +32,7 @@ module Bundler
|
|
32
32
|
file << spec.to_gemfile
|
33
33
|
end
|
34
34
|
else
|
35
|
-
FileUtils.cp(File.expand_path("
|
35
|
+
FileUtils.cp(File.expand_path("../templates/#{gemfile}", __dir__), gemfile)
|
36
36
|
end
|
37
37
|
|
38
38
|
puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
|
data/lib/bundler/cli/show.rb
CHANGED
data/lib/bundler/cli.rb
CHANGED
@@ -610,7 +610,7 @@ module Bundler
|
|
610
610
|
private :gem
|
611
611
|
|
612
612
|
def self.source_root
|
613
|
-
File.expand_path(
|
613
|
+
File.expand_path("templates", __dir__)
|
614
614
|
end
|
615
615
|
|
616
616
|
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
|
data/lib/bundler/current_ruby.rb
CHANGED
data/lib/bundler/definition.rb
CHANGED
@@ -87,10 +87,11 @@ module Bundler
|
|
87
87
|
@platforms = @locked_platforms.dup
|
88
88
|
@locked_bundler_version = @locked_gems.bundler_version
|
89
89
|
@locked_ruby_version = @locked_gems.ruby_version
|
90
|
+
@originally_locked_specs = SpecSet.new(@locked_gems.specs)
|
90
91
|
|
91
92
|
if unlock != true
|
92
93
|
@locked_deps = @locked_gems.dependencies
|
93
|
-
@locked_specs =
|
94
|
+
@locked_specs = @originally_locked_specs
|
94
95
|
@locked_sources = @locked_gems.sources
|
95
96
|
else
|
96
97
|
@unlock = {}
|
@@ -255,14 +256,14 @@ module Bundler
|
|
255
256
|
# @return [SpecSet] resolved dependencies
|
256
257
|
def resolve
|
257
258
|
@resolve ||= begin
|
258
|
-
last_resolve = converge_locked_specs
|
259
259
|
if Bundler.frozen_bundle?
|
260
260
|
Bundler.ui.debug "Frozen, using resolution from the lockfile"
|
261
|
-
|
261
|
+
@locked_specs
|
262
262
|
elsif !unlocking? && nothing_changed?
|
263
263
|
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
|
264
|
-
|
264
|
+
SpecSet.new(filter_specs(@locked_specs, @dependencies.select{|dep| @locked_specs[dep].any? }))
|
265
265
|
else
|
266
|
+
last_resolve = converge_locked_specs
|
266
267
|
# Run a resolve against the locally available gems
|
267
268
|
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
268
269
|
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
|
@@ -464,6 +465,10 @@ module Bundler
|
|
464
465
|
|
465
466
|
private
|
466
467
|
|
468
|
+
def filter_specs(specs, deps)
|
469
|
+
SpecSet.new(specs).for(expand_dependencies(deps, true), false, false)
|
470
|
+
end
|
471
|
+
|
467
472
|
def materialize(dependencies)
|
468
473
|
specs = resolve.materialize(dependencies)
|
469
474
|
missing_specs = specs.missing_specs
|
@@ -679,17 +684,17 @@ module Bundler
|
|
679
684
|
end
|
680
685
|
|
681
686
|
def converge_specs(specs)
|
682
|
-
deps = []
|
683
687
|
converged = []
|
688
|
+
|
689
|
+
deps = @dependencies.select do |dep|
|
690
|
+
specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
|
691
|
+
end
|
692
|
+
|
684
693
|
specs.each do |s|
|
685
694
|
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
686
695
|
dep = @dependencies.find {|d| s.satisfies?(d) }
|
687
696
|
|
688
|
-
|
689
|
-
deps << dep
|
690
|
-
end
|
691
|
-
|
692
|
-
s.source = (dep && dep.source) || sources.get(s.source) || sources.default_source unless Bundler.frozen_bundle?
|
697
|
+
s.source = (dep && dep.source) || sources.get(s.source) || sources.default_source
|
693
698
|
|
694
699
|
next if @unlock[:sources].include?(s.source.name)
|
695
700
|
|
@@ -726,36 +731,18 @@ module Bundler
|
|
726
731
|
end
|
727
732
|
end
|
728
733
|
|
729
|
-
|
730
|
-
SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false).reject{|s| @unlock[:gems].include?(s.name) })
|
734
|
+
SpecSet.new(filter_specs(converged, deps).reject{|s| @unlock[:gems].include?(s.name) })
|
731
735
|
end
|
732
736
|
|
733
737
|
def metadata_dependencies
|
734
738
|
@metadata_dependencies ||= begin
|
735
|
-
ruby_versions = ruby_version_requirements(@ruby_version)
|
736
739
|
[
|
737
|
-
Dependency.new("Ruby\0",
|
740
|
+
Dependency.new("Ruby\0", RubyVersion.system.gem_version),
|
738
741
|
Dependency.new("RubyGems\0", Gem::VERSION),
|
739
742
|
]
|
740
743
|
end
|
741
744
|
end
|
742
745
|
|
743
|
-
def ruby_version_requirements(ruby_version)
|
744
|
-
return [] unless ruby_version
|
745
|
-
if ruby_version.patchlevel
|
746
|
-
[ruby_version.to_gem_version_with_patchlevel]
|
747
|
-
else
|
748
|
-
ruby_version.versions.map do |version|
|
749
|
-
requirement = Gem::Requirement.new(version)
|
750
|
-
if requirement.exact?
|
751
|
-
"~> #{version}.0"
|
752
|
-
else
|
753
|
-
requirement
|
754
|
-
end
|
755
|
-
end
|
756
|
-
end
|
757
|
-
end
|
758
|
-
|
759
746
|
def expand_dependencies(dependencies, remote = false)
|
760
747
|
deps = []
|
761
748
|
dependencies.each do |dep|
|
@@ -821,7 +808,7 @@ module Bundler
|
|
821
808
|
|
822
809
|
def additional_base_requirements_for_resolve
|
823
810
|
return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
824
|
-
converge_specs(@
|
811
|
+
converge_specs(@originally_locked_specs).map do |locked_spec|
|
825
812
|
name = locked_spec.name
|
826
813
|
dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
|
827
814
|
DepProxy.get_proxy(dep, locked_spec.platform)
|
data/lib/bundler/dependency.rb
CHANGED
@@ -20,6 +20,9 @@ module Bundler
|
|
20
20
|
:ruby_24 => Gem::Platform::RUBY,
|
21
21
|
:ruby_25 => Gem::Platform::RUBY,
|
22
22
|
:ruby_26 => Gem::Platform::RUBY,
|
23
|
+
:ruby_27 => Gem::Platform::RUBY,
|
24
|
+
:ruby_30 => Gem::Platform::RUBY,
|
25
|
+
:ruby_31 => Gem::Platform::RUBY,
|
23
26
|
:mri => Gem::Platform::RUBY,
|
24
27
|
:mri_18 => Gem::Platform::RUBY,
|
25
28
|
:mri_19 => Gem::Platform::RUBY,
|
@@ -30,6 +33,9 @@ module Bundler
|
|
30
33
|
:mri_24 => Gem::Platform::RUBY,
|
31
34
|
:mri_25 => Gem::Platform::RUBY,
|
32
35
|
:mri_26 => Gem::Platform::RUBY,
|
36
|
+
:mri_27 => Gem::Platform::RUBY,
|
37
|
+
:mri_30 => Gem::Platform::RUBY,
|
38
|
+
:mri_31 => Gem::Platform::RUBY,
|
33
39
|
:rbx => Gem::Platform::RUBY,
|
34
40
|
:truffleruby => Gem::Platform::RUBY,
|
35
41
|
:jruby => Gem::Platform::JAVA,
|
@@ -45,6 +51,9 @@ module Bundler
|
|
45
51
|
:mswin_24 => Gem::Platform::MSWIN,
|
46
52
|
:mswin_25 => Gem::Platform::MSWIN,
|
47
53
|
:mswin_26 => Gem::Platform::MSWIN,
|
54
|
+
:mswin_27 => Gem::Platform::MSWIN,
|
55
|
+
:mswin_30 => Gem::Platform::MSWIN,
|
56
|
+
:mswin_31 => Gem::Platform::MSWIN,
|
48
57
|
:mswin64 => Gem::Platform::MSWIN64,
|
49
58
|
:mswin64_19 => Gem::Platform::MSWIN64,
|
50
59
|
:mswin64_20 => Gem::Platform::MSWIN64,
|
@@ -54,6 +63,9 @@ module Bundler
|
|
54
63
|
:mswin64_24 => Gem::Platform::MSWIN64,
|
55
64
|
:mswin64_25 => Gem::Platform::MSWIN64,
|
56
65
|
:mswin64_26 => Gem::Platform::MSWIN64,
|
66
|
+
:mswin64_27 => Gem::Platform::MSWIN64,
|
67
|
+
:mswin64_30 => Gem::Platform::MSWIN64,
|
68
|
+
:mswin64_31 => Gem::Platform::MSWIN64,
|
57
69
|
:mingw => Gem::Platform::MINGW,
|
58
70
|
:mingw_18 => Gem::Platform::MINGW,
|
59
71
|
:mingw_19 => Gem::Platform::MINGW,
|
@@ -64,6 +76,9 @@ module Bundler
|
|
64
76
|
:mingw_24 => Gem::Platform::MINGW,
|
65
77
|
:mingw_25 => Gem::Platform::MINGW,
|
66
78
|
:mingw_26 => Gem::Platform::MINGW,
|
79
|
+
:mingw_27 => Gem::Platform::MINGW,
|
80
|
+
:mingw_30 => Gem::Platform::MINGW,
|
81
|
+
:mingw_31 => Gem::Platform::MINGW,
|
67
82
|
:x64_mingw => Gem::Platform::X64_MINGW,
|
68
83
|
:x64_mingw_20 => Gem::Platform::X64_MINGW,
|
69
84
|
:x64_mingw_21 => Gem::Platform::X64_MINGW,
|
@@ -72,6 +87,9 @@ module Bundler
|
|
72
87
|
:x64_mingw_24 => Gem::Platform::X64_MINGW,
|
73
88
|
:x64_mingw_25 => Gem::Platform::X64_MINGW,
|
74
89
|
:x64_mingw_26 => Gem::Platform::X64_MINGW,
|
90
|
+
:x64_mingw_27 => Gem::Platform::X64_MINGW,
|
91
|
+
:x64_mingw_30 => Gem::Platform::X64_MINGW,
|
92
|
+
:x64_mingw_31 => Gem::Platform::X64_MINGW,
|
75
93
|
}.freeze
|
76
94
|
|
77
95
|
def initialize(name, version, options = {}, &blk)
|
@@ -26,8 +26,11 @@ module Bundler
|
|
26
26
|
@required_ruby_version ||= _remote_specification.required_ruby_version
|
27
27
|
end
|
28
28
|
|
29
|
+
# A fallback is included because the original version of the specification
|
30
|
+
# API didn't include that field, so some marshalled specs in the index have it
|
31
|
+
# set to +nil+.
|
29
32
|
def required_rubygems_version
|
30
|
-
@required_rubygems_version ||= _remote_specification.required_rubygems_version
|
33
|
+
@required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
|
31
34
|
end
|
32
35
|
|
33
36
|
def fetch_platform
|
data/lib/bundler/installer.rb
CHANGED
@@ -119,7 +119,7 @@ module Bundler
|
|
119
119
|
relative_gemfile_path = relative_gemfile_path
|
120
120
|
ruby_command = Thor::Util.ruby_command
|
121
121
|
ruby_command = ruby_command
|
122
|
-
template_path = File.expand_path("
|
122
|
+
template_path = File.expand_path("templates/Executable", __dir__)
|
123
123
|
if spec.name == "bundler"
|
124
124
|
template_path += ".bundler"
|
125
125
|
spec.executables = %(bundle)
|
@@ -172,7 +172,7 @@ module Bundler
|
|
172
172
|
end
|
173
173
|
standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
|
174
174
|
standalone_path = standalone_path
|
175
|
-
template = File.read(File.expand_path("
|
175
|
+
template = File.read(File.expand_path("templates/Executable.standalone", __dir__))
|
176
176
|
ruby_command = Thor::Util.ruby_command
|
177
177
|
ruby_command = ruby_command
|
178
178
|
|
@@ -36,13 +36,13 @@ Executing \fBbundle config list\fR with will print a list of all bundler configu
|
|
36
36
|
Executing \fBbundle config get <name>\fR will print the value of that configuration setting, and where it was set\.
|
37
37
|
.
|
38
38
|
.P
|
39
|
-
Executing \fBbundle config set <name> <value>\fR
|
39
|
+
Executing \fBbundle config set <name> <value>\fR defaults to setting \fBlocal\fR configuration if executing from within a local application, otherwise it will set \fBglobal\fR configuration\. See \fB\-\-local\fR and \fB\-\-global\fR options below\.
|
40
40
|
.
|
41
41
|
.P
|
42
|
-
Executing \fBbundle config set \-\-
|
42
|
+
Executing \fBbundle config set \-\-local <name> <value>\fR will set that configuration in the directory for the local application\. The configuration will be stored in \fB<project_root>/\.bundle/config\fR\. If \fBBUNDLE_APP_CONFIG\fR is set, the configuration will be stored in \fB$BUNDLE_APP_CONFIG/config\fR\.
|
43
43
|
.
|
44
44
|
.P
|
45
|
-
Executing \fBbundle config set \-\-
|
45
|
+
Executing \fBbundle config set \-\-global <name> <value>\fR will set that configuration to the value specified for all bundles executed as the current user\. The configuration will be stored in \fB~/\.bundle/config\fR\. If \fIname\fR already is set, \fIname\fR will be overridden and user will be warned\.
|
46
46
|
.
|
47
47
|
.P
|
48
48
|
Executing \fBbundle config unset <name>\fR will delete the configuration in both local and global sources\.
|
@@ -23,18 +23,20 @@ was set.
|
|
23
23
|
Executing `bundle config get <name>` will print the value of that configuration
|
24
24
|
setting, and where it was set.
|
25
25
|
|
26
|
-
Executing `bundle config set <name> <value>`
|
27
|
-
|
28
|
-
|
29
|
-
overridden and user will be warned.
|
30
|
-
|
31
|
-
Executing `bundle config set --global <name> <value>` works the same as above.
|
26
|
+
Executing `bundle config set <name> <value>` defaults to setting `local`
|
27
|
+
configuration if executing from within a local application, otherwise it will
|
28
|
+
set `global` configuration. See `--local` and `--global` options below.
|
32
29
|
|
33
30
|
Executing `bundle config set --local <name> <value>` will set that configuration
|
34
31
|
in the directory for the local application. The configuration will be stored in
|
35
32
|
`<project_root>/.bundle/config`. If `BUNDLE_APP_CONFIG` is set, the configuration
|
36
33
|
will be stored in `$BUNDLE_APP_CONFIG/config`.
|
37
34
|
|
35
|
+
Executing `bundle config set --global <name> <value>` will set that
|
36
|
+
configuration to the value specified for all bundles executed as the current
|
37
|
+
user. The configuration will be stored in `~/.bundle/config`. If <name> already
|
38
|
+
is set, <name> will be overridden and user will be warned.
|
39
|
+
|
38
40
|
Executing `bundle config unset <name>` will delete the configuration in both
|
39
41
|
local and global sources.
|
40
42
|
|
@@ -97,10 +97,10 @@ module Bundler
|
|
97
97
|
spec = @specs[platform].first
|
98
98
|
return [] if spec.is_a?(LazySpecification)
|
99
99
|
dependencies = []
|
100
|
-
|
100
|
+
unless spec.required_ruby_version.none?
|
101
101
|
dependencies << DepProxy.get_proxy(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
|
102
102
|
end
|
103
|
-
|
103
|
+
unless spec.required_rubygems_version.none?
|
104
104
|
dependencies << DepProxy.get_proxy(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
|
105
105
|
end
|
106
106
|
dependencies
|
data/lib/bundler/resolver.rb
CHANGED
@@ -312,29 +312,66 @@ 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
|
+
metadata_requirements = {}
|
348
|
+
|
349
|
+
o << trees.map do |tree|
|
350
|
+
t = "".dup
|
351
|
+
depth = 2
|
352
|
+
|
353
|
+
base_tree = tree.first
|
354
|
+
base_tree_name = base_tree.name
|
355
|
+
|
356
|
+
if base_tree_name.end_with?("\0")
|
357
|
+
metadata_requirements[base_tree_name] = base_tree
|
358
|
+
t = nil
|
359
|
+
else
|
360
|
+
tree.each do |req|
|
361
|
+
t << " " * depth << SharedHelpers.pretty_dependency(req)
|
362
|
+
unless tree.last == req
|
363
|
+
if spec = conflict.activated_by_name[req.name]
|
364
|
+
t << %( was resolved to #{spec.version}, which)
|
365
|
+
end
|
366
|
+
t << %( depends on)
|
367
|
+
end
|
368
|
+
t << %(\n)
|
369
|
+
depth += 1
|
370
|
+
end
|
371
|
+
end
|
372
|
+
t
|
373
|
+
end.compact.join("\n")
|
374
|
+
|
338
375
|
if name == "bundler"
|
339
376
|
o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
|
340
377
|
|
@@ -355,11 +392,13 @@ module Bundler
|
|
355
392
|
o << "Your bundle requires a different version of Bundler than the one you're running, and that version could not be found.\n"
|
356
393
|
end
|
357
394
|
end
|
395
|
+
elsif name.end_with?("\0")
|
396
|
+
o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(metadata_requirements[name])}\n\n)
|
358
397
|
elsif conflict.locked_requirement
|
359
398
|
o << "\n"
|
360
399
|
o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
|
361
400
|
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
|
362
|
-
elsif !conflict.existing
|
401
|
+
elsif !conflict.existing
|
363
402
|
o << "\n"
|
364
403
|
|
365
404
|
relevant_source = conflict.requirement.source || source_for(name)
|
@@ -372,14 +411,8 @@ module Bundler
|
|
372
411
|
|
373
412
|
o << gem_not_found_message(name, conflict.requirement, relevant_source, extra_message)
|
374
413
|
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
|
414
|
+
|
415
|
+
o
|
383
416
|
end
|
384
417
|
)
|
385
418
|
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
@@ -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
|
@@ -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
|
@@ -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)
|
@@ -8,11 +8,9 @@
|
|
8
8
|
# this file is here to facilitate running it.
|
9
9
|
#
|
10
10
|
|
11
|
-
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
|
13
|
-
Pathname.new(__FILE__).realpath)
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("<%= relative_gemfile_path %>", __dir__)
|
14
12
|
|
15
|
-
bundle_binstub = File.expand_path("
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
16
14
|
|
17
15
|
if File.file?(bundle_binstub)
|
18
16
|
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
@@ -6,9 +6,7 @@
|
|
6
6
|
# this file is here to facilitate running it.
|
7
7
|
#
|
8
8
|
|
9
|
-
|
10
|
-
path = Pathname.new(__FILE__)
|
11
|
-
$:.unshift File.expand_path "../<%= standalone_path %>", path.realpath
|
9
|
+
$:.unshift File.expand_path "<%= standalone_path %>", __dir__
|
12
10
|
|
13
11
|
require "bundler/setup"
|
14
|
-
load File.expand_path "
|
12
|
+
load File.expand_path "<%= executable_path %>", __dir__
|