bundler 2.2.3 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +73 -2
- data/bundler.gemspec +1 -1
- data/lib/bundler.rb +0 -1
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +3 -5
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/gem.rb +14 -0
- data/lib/bundler/compact_index_client/updater.rb +0 -8
- data/lib/bundler/definition.rb +17 -27
- data/lib/bundler/dep_proxy.rb +15 -8
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher.rb +0 -1
- data/lib/bundler/gem_helper.rb +9 -7
- data/lib/bundler/gem_version_promoter.rb +2 -2
- data/lib/bundler/index.rb +6 -5
- data/lib/bundler/installer.rb +0 -17
- data/lib/bundler/installer/standalone.rb +15 -0
- data/lib/bundler/lazy_specification.rb +9 -18
- data/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
- data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +4 -4
- data/lib/bundler/man/bundle-config.1.ronn +3 -3
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/{man → lib/bundler/man}/bundle-gem.1 +1 -1
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man → lib/bundler/man}/bundle-install.1 +1 -1
- data/{man → lib/bundler/man}/bundle-list.1 +1 -1
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +1 -1
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man → lib/bundler/man}/bundle.1 +1 -1
- data/{man → lib/bundler/man}/gemfile.5 +1 -1
- data/{man → lib/bundler/man}/index.txt +0 -0
- data/lib/bundler/resolver.rb +82 -43
- data/lib/bundler/resolver/spec_group.rb +56 -44
- data/lib/bundler/rubygems_ext.rb +16 -0
- data/lib/bundler/settings.rb +1 -1
- data/lib/bundler/shared_helpers.rb +2 -2
- data/lib/bundler/source/git.rb +19 -17
- data/lib/bundler/source/git/git_proxy.rb +54 -49
- data/lib/bundler/source/path/installer.rb +2 -0
- data/lib/bundler/source/rubygems.rb +10 -2
- data/lib/bundler/source_list.rb +2 -4
- data/lib/bundler/spec_set.rb +5 -4
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/templates/newgem/rubocop.yml.tt +3 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +11 -7
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -6
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
- data/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- metadata +30 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecc144a2ffbedf2460fd802504e4bf73715f0ffd07baf7d27ef00697d3e316f1
|
4
|
+
data.tar.gz: cd63494a4857929510cebb582cef49aa0ff539d1a186697ad0fa3ea2c7812296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1edc265326d10957e714d5937f7b6e481b0b9773b8e8a46679704ff6f9ce6bd51b1f4cb7d061b95568ce7507b4a3ff078aa38dfa9a6fb726434554dcb33e1df1
|
7
|
+
data.tar.gz: f322244527a59ade88ad8456e0b0953bfc93c765b927deb5b4fedcc099ac518b5e36924e19945c3a64c8459bb6e752693412f742858c8127fa6742fc3c1454e1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,74 @@
|
|
1
|
+
# 2.2.8 (February 2, 2021)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Add a CHANGELOG.md file to gems generated by `bundle gem` [#4093](https://github.com/rubygems/rubygems/pull/4093)
|
6
|
+
- Support gemified `set` [#4297](https://github.com/rubygems/rubygems/pull/4297)
|
7
|
+
|
8
|
+
## Bug fixes:
|
9
|
+
|
10
|
+
- Fix standalone Kernel.require visibility [#4337](https://github.com/rubygems/rubygems/pull/4337)
|
11
|
+
|
12
|
+
## Performance:
|
13
|
+
|
14
|
+
- Fix resolver edge cases and speed up bundler [#4277](https://github.com/rubygems/rubygems/pull/4277)
|
15
|
+
|
16
|
+
# 2.2.7 (January 26, 2021)
|
17
|
+
|
18
|
+
## Enhancements:
|
19
|
+
|
20
|
+
- Improve error messages when dependency on bundler conflicts with running version [#4308](https://github.com/rubygems/rubygems/pull/4308)
|
21
|
+
- Avoid showing platforms with requirements in error messages [#4310](https://github.com/rubygems/rubygems/pull/4310)
|
22
|
+
- Introduce disable_local_revision_check config [#4237](https://github.com/rubygems/rubygems/pull/4237)
|
23
|
+
- Reverse rubygems require mixin with bundler standalone [#4299](https://github.com/rubygems/rubygems/pull/4299)
|
24
|
+
|
25
|
+
## Bug fixes:
|
26
|
+
|
27
|
+
- Fix releasing from a not yet pushed branch [#4309](https://github.com/rubygems/rubygems/pull/4309)
|
28
|
+
- Install cache only once if it already exists [#4304](https://github.com/rubygems/rubygems/pull/4304)
|
29
|
+
- Fix `force_ruby_platform` no longer being respected [#4302](https://github.com/rubygems/rubygems/pull/4302)
|
30
|
+
|
31
|
+
## Performance:
|
32
|
+
|
33
|
+
- Fix resolver dependency comparison [#4289](https://github.com/rubygems/rubygems/pull/4289)
|
34
|
+
|
35
|
+
# 2.2.6 (January 18, 2021)
|
36
|
+
|
37
|
+
## Enhancements:
|
38
|
+
|
39
|
+
- Improve resolver debugging [#4288](https://github.com/rubygems/rubygems/pull/4288)
|
40
|
+
|
41
|
+
## Bug fixes:
|
42
|
+
|
43
|
+
- Fix dependency locking for path source [#4293](https://github.com/rubygems/rubygems/pull/4293)
|
44
|
+
|
45
|
+
## Performance:
|
46
|
+
|
47
|
+
- Speed up complex dependency resolves by creating DepProxy factory and cache [#4216](https://github.com/rubygems/rubygems/pull/4216)
|
48
|
+
|
49
|
+
# 2.2.5 (January 11, 2021)
|
50
|
+
|
51
|
+
## Enhancements:
|
52
|
+
|
53
|
+
- Improve rubocop setup in the new gem template [#4220](https://github.com/rubygems/rubygems/pull/4220)
|
54
|
+
- Support repositories with default branch not named master [#4224](https://github.com/rubygems/rubygems/pull/4224)
|
55
|
+
|
56
|
+
## Bug fixes:
|
57
|
+
|
58
|
+
- Let Net::HTTP decompress the index instead of doing it manually [#4081](https://github.com/rubygems/rubygems/pull/4081)
|
59
|
+
- Workaround for another jruby crash when autoloading a constant [#4252](https://github.com/rubygems/rubygems/pull/4252)
|
60
|
+
- Fix another performance regression in the resolver [#4243](https://github.com/rubygems/rubygems/pull/4243)
|
61
|
+
- Restore support for old git versions [#4233](https://github.com/rubygems/rubygems/pull/4233)
|
62
|
+
- Give a proper error if cache path does not have write access [#4215](https://github.com/rubygems/rubygems/pull/4215)
|
63
|
+
- Fix running `rake release` from an ambiguous ref [#4219](https://github.com/rubygems/rubygems/pull/4219)
|
64
|
+
|
65
|
+
# 2.2.4 (December 31, 2020)
|
66
|
+
|
67
|
+
## Bug fixes:
|
68
|
+
|
69
|
+
- Fix bundle man pages display on truffleruby [#4209](https://github.com/rubygems/rubygems/pull/4209)
|
70
|
+
- Fix Windows + JRuby no longer being able to install git sources [#4196](https://github.com/rubygems/rubygems/pull/4196)
|
71
|
+
|
1
72
|
# 2.2.3 (December 22, 2020)
|
2
73
|
|
3
74
|
## Bug fixes:
|
@@ -320,7 +391,7 @@
|
|
320
391
|
- Fix `bundle update` message about exclude groups saying "installed" instead of "updated" ([#7150](https://github.com/rubygems/bundler/pull/7150))
|
321
392
|
- Fix `bundle licenses` not showing correct information about bundler itself ([#7147](https://github.com/rubygems/bundler/pull/7147))
|
322
393
|
- Fix installation path not including ruby scope when `BUNDLE_PATH` was set ([#7163](https://github.com/rubygems/bundler/pull/7163))
|
323
|
-
- Fix `bundle clean` incorrectly removing git
|
394
|
+
- Fix `bundle clean` incorrectly removing git dependencies present in the Gemfile when rubygems 3.0+ was used and path involved a symlink ([#7211](https://github.com/rubygems/bundler/pull/7211))
|
324
395
|
- Fix platform specific gems always being re-resolved when bundler was not running under that platform ([#7212](https://github.com/rubygems/bundler/pull/7212))
|
325
396
|
- Fix `bundle package --all-platforms` causing `bundle install` to ignore `--with` and `--without` ([#6113](https://github.com/rubygems/bundler/pull/6113))
|
326
397
|
- Fix `MissingRevision` git errors to include the specific `git` command that failed under the hood ([#7225](https://github.com/rubygems/bundler/pull/7225))
|
@@ -492,7 +563,7 @@ Changes
|
|
492
563
|
## Bug fixes:
|
493
564
|
|
494
565
|
- Fix issue where updating a gem resulted in the gem's version being downgraded when `BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS` was set ([#6529](https://github.com/rubygems/bundler/issues/6529), @theflow)
|
495
|
-
- Fix some rescue calls that don't
|
566
|
+
- Fix some rescue calls that don't specify error type (@utilum)
|
496
567
|
- Fix an issue when the Lockfile would contain platform-specific gems that it didn't need ([#6491](https://github.com/rubygems/bundler/issues/6491), @segiddins)
|
497
568
|
- Improve handling of adding new gems with only a single group to the Gemfile in `bundle add` (@agrim123)
|
498
569
|
- Refactor check for OpenSSL in `bundle env` (@voxik)
|
data/bundler.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.required_ruby_version = ">= 2.3.0"
|
35
35
|
s.required_rubygems_version = ">= 2.5.2"
|
36
36
|
|
37
|
-
s.files = Dir.glob("{lib,
|
37
|
+
s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
38
38
|
|
39
39
|
# Include the CHANGELOG.md, LICENSE.md, README.md manually
|
40
40
|
s.files += %w[CHANGELOG.md LICENSE.md README.md]
|
data/lib/bundler.rb
CHANGED
@@ -63,7 +63,6 @@ module Bundler
|
|
63
63
|
autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
|
64
64
|
autoload :Retry, File.expand_path("bundler/retry", __dir__)
|
65
65
|
autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
|
66
|
-
autoload :RubyGemsGemInstaller, File.expand_path("bundler/rubygems_gem_installer", __dir__)
|
67
66
|
autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
|
68
67
|
autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
|
69
68
|
autoload :Settings, File.expand_path("bundler/settings", __dir__)
|
@@ -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 = "
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2021-02-02".freeze
|
8
|
+
@git_commit_sha = "4015e550dc".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
data/lib/bundler/cli.rb
CHANGED
@@ -122,9 +122,7 @@ module Bundler
|
|
122
122
|
else command = "bundle-#{cli}"
|
123
123
|
end
|
124
124
|
|
125
|
-
man_path = File.expand_path("
|
126
|
-
# man files are located under ruby's mandir with the default gems of bundler
|
127
|
-
man_path = RbConfig::CONFIG["mandir"] unless File.directory?(man_path)
|
125
|
+
man_path = File.expand_path("man", __dir__)
|
128
126
|
man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
|
129
127
|
[File.basename(f, ".*"), f]
|
130
128
|
end]
|
@@ -134,8 +132,7 @@ module Bundler
|
|
134
132
|
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
135
133
|
Kernel.exec "man #{man_page}"
|
136
134
|
else
|
137
|
-
|
138
|
-
puts File.read("#{fallback_man_path}/#{File.basename(man_page)}.ronn")
|
135
|
+
puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
|
139
136
|
end
|
140
137
|
elsif command_path = Bundler.which("bundler-#{cli}")
|
141
138
|
Kernel.exec(command_path, "--help")
|
@@ -589,6 +586,7 @@ module Bundler
|
|
589
586
|
method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
|
590
587
|
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
|
591
588
|
method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
|
589
|
+
method_option :changelog, :type => :boolean, :desc => "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
|
592
590
|
method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library",
|
593
591
|
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
594
592
|
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
|
data/lib/bundler/cli/cache.rb
CHANGED
data/lib/bundler/cli/gem.rb
CHANGED
@@ -59,6 +59,7 @@ module Bundler
|
|
59
59
|
:exe => options[:exe],
|
60
60
|
:bundler_version => bundler_dependency_version,
|
61
61
|
:github_username => github_username.empty? ? "[USERNAME]" : github_username,
|
62
|
+
:required_ruby_version => Gem.ruby_version < Gem::Version.new("2.4.a") ? "2.3.0" : "2.4.0",
|
62
63
|
}
|
63
64
|
ensure_safe_gem_name(name, constant_array)
|
64
65
|
|
@@ -141,12 +142,25 @@ module Bundler
|
|
141
142
|
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
|
142
143
|
end
|
143
144
|
|
145
|
+
if ask_and_set(:changelog, "Do you want to include a changelog?",
|
146
|
+
"A changelog is a file which contains a curated, chronologically ordered list of notable " \
|
147
|
+
"changes for each version of a project. To make it easier for users and contributors to" \
|
148
|
+
" see precisely what notable changes have been made between each release (or version) of" \
|
149
|
+
" the project. Whether consumers or developers, the end users of software are" \
|
150
|
+
" human beings who care about what's in the software. When the software changes, people " \
|
151
|
+
"want to know why and how. see https://keepachangelog.com")
|
152
|
+
config[:changelog] = true
|
153
|
+
Bundler.ui.info "Changelog enabled in config"
|
154
|
+
templates.merge!("CHANGELOG.md.tt" => "CHANGELOG.md")
|
155
|
+
end
|
156
|
+
|
144
157
|
if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
|
145
158
|
"RuboCop is a static code analyzer that has out-of-the-box rules for many " \
|
146
159
|
"of the guidelines in the community style guide. " \
|
147
160
|
"For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
|
148
161
|
"and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
|
149
162
|
config[:rubocop] = true
|
163
|
+
config[:rubocop_version] = Gem.ruby_version < Gem::Version.new("2.4.a") ? "0.81.0" : "1.7"
|
150
164
|
Bundler.ui.info "RuboCop enabled in config"
|
151
165
|
templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
|
152
166
|
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../vendored_fileutils"
|
4
|
-
require "stringio"
|
5
|
-
require "zlib"
|
6
4
|
|
7
5
|
module Bundler
|
8
6
|
class CompactIndexClient
|
@@ -45,18 +43,12 @@ module Bundler
|
|
45
43
|
else
|
46
44
|
"bytes=#{local_temp_path.size}-"
|
47
45
|
end
|
48
|
-
else
|
49
|
-
# Fastly ignores Range when Accept-Encoding: gzip is set
|
50
|
-
headers["Accept-Encoding"] = "gzip"
|
51
46
|
end
|
52
47
|
|
53
48
|
response = @fetcher.call(remote_path, headers)
|
54
49
|
return nil if response.is_a?(Net::HTTPNotModified)
|
55
50
|
|
56
51
|
content = response.body
|
57
|
-
if response["Content-Encoding"] == "gzip"
|
58
|
-
content = Zlib::GzipReader.new(StringIO.new(content)).read
|
59
|
-
end
|
60
52
|
|
61
53
|
SharedHelpers.filesystem_access(local_temp_path) do
|
62
54
|
if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?
|
data/lib/bundler/definition.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "lockfile_parser"
|
4
|
-
require "set"
|
5
4
|
|
6
5
|
module Bundler
|
7
6
|
class Definition
|
@@ -259,23 +258,18 @@ module Bundler
|
|
259
258
|
def resolve
|
260
259
|
@resolve ||= begin
|
261
260
|
last_resolve = converge_locked_specs
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
end
|
275
|
-
|
276
|
-
# filter out gems that _can_ be installed on multiple platforms, but don't need
|
277
|
-
# to be
|
278
|
-
resolve.for(expand_dependencies(dependencies, true), [], false, false, false)
|
261
|
+
if Bundler.frozen_bundle?
|
262
|
+
Bundler.ui.debug "Frozen, using resolution from the lockfile"
|
263
|
+
last_resolve
|
264
|
+
elsif !unlocking? && nothing_changed?
|
265
|
+
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
|
266
|
+
last_resolve
|
267
|
+
else
|
268
|
+
# Run a resolve against the locally available gems
|
269
|
+
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
270
|
+
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote)
|
271
|
+
Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
272
|
+
end
|
279
273
|
end
|
280
274
|
end
|
281
275
|
|
@@ -604,7 +598,7 @@ module Bundler
|
|
604
598
|
deps_for_source = @dependencies.select {|s| s.source == source }
|
605
599
|
locked_deps_for_source = @locked_deps.values.select {|dep| dep.source == locked_source }
|
606
600
|
|
607
|
-
|
601
|
+
deps_for_source.sort != locked_deps_for_source.sort
|
608
602
|
end
|
609
603
|
|
610
604
|
def specs_for_source_changed?(source)
|
@@ -818,11 +812,6 @@ module Bundler
|
|
818
812
|
# commonly happens if the version changed in the gemspec
|
819
813
|
next unless new_spec
|
820
814
|
|
821
|
-
new_runtime_deps = new_spec.dependencies.select {|d| d.type != :development }
|
822
|
-
old_runtime_deps = s.dependencies.select {|d| d.type != :development }
|
823
|
-
# If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it
|
824
|
-
next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) }
|
825
|
-
|
826
815
|
s.dependencies.replace(new_spec.dependencies)
|
827
816
|
end
|
828
817
|
|
@@ -889,7 +878,7 @@ module Bundler
|
|
889
878
|
dependencies.each do |dep|
|
890
879
|
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
|
891
880
|
next unless remote || dep.current_platform?
|
892
|
-
target_platforms = dep.gem_platforms(remote ?
|
881
|
+
target_platforms = dep.gem_platforms(remote ? @platforms : [generic_local_platform])
|
893
882
|
deps += expand_dependency_with_platforms(dep, target_platforms)
|
894
883
|
end
|
895
884
|
deps
|
@@ -897,7 +886,7 @@ module Bundler
|
|
897
886
|
|
898
887
|
def expand_dependency_with_platforms(dep, platforms)
|
899
888
|
platforms.map do |p|
|
900
|
-
DepProxy.
|
889
|
+
DepProxy.get_proxy(dep, p)
|
901
890
|
end
|
902
891
|
end
|
903
892
|
|
@@ -918,6 +907,7 @@ module Bundler
|
|
918
907
|
metadata_dependencies.each do |dep|
|
919
908
|
source_requirements[dep.name] = sources.metadata_source
|
920
909
|
end
|
910
|
+
source_requirements[:default_bundler] = source_requirements["bundler"] || source_requirements[:default]
|
921
911
|
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
|
922
912
|
source_requirements
|
923
913
|
end
|
@@ -977,7 +967,7 @@ module Bundler
|
|
977
967
|
next requirements if @locked_gems.dependencies[name] != dependency
|
978
968
|
next requirements if dependency.source.is_a?(Source::Path)
|
979
969
|
dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
|
980
|
-
requirements[name] = DepProxy.
|
970
|
+
requirements[name] = DepProxy.get_proxy(dep, locked_spec.platform)
|
981
971
|
requirements
|
982
972
|
end.values
|
983
973
|
end
|
data/lib/bundler/dep_proxy.rb
CHANGED
@@ -4,19 +4,18 @@ module Bundler
|
|
4
4
|
class DepProxy
|
5
5
|
attr_reader :__platform, :dep
|
6
6
|
|
7
|
+
@proxies = {}
|
8
|
+
|
9
|
+
def self.get_proxy(dep, platform)
|
10
|
+
@proxies[[dep, platform]] ||= new(dep, platform).freeze
|
11
|
+
end
|
12
|
+
|
7
13
|
def initialize(dep, platform)
|
8
14
|
@dep = dep
|
9
15
|
@__platform = platform
|
10
16
|
end
|
11
17
|
|
12
|
-
|
13
|
-
@hash ||= [dep, __platform].hash
|
14
|
-
end
|
15
|
-
|
16
|
-
def ==(other)
|
17
|
-
return false if other.class != self.class
|
18
|
-
dep == other.dep && __platform == other.__platform
|
19
|
-
end
|
18
|
+
private_class_method :new
|
20
19
|
|
21
20
|
alias_method :eql?, :==
|
22
21
|
|
@@ -39,6 +38,14 @@ module Bundler
|
|
39
38
|
s
|
40
39
|
end
|
41
40
|
|
41
|
+
def dup
|
42
|
+
raise NoMethodError.new("DepProxy cannot be duplicated")
|
43
|
+
end
|
44
|
+
|
45
|
+
def clone
|
46
|
+
raise NoMethodError.new("DepProxy cannot be cloned")
|
47
|
+
end
|
48
|
+
|
42
49
|
private
|
43
50
|
|
44
51
|
def method_missing(*args, &blk)
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -27,7 +27,6 @@ module Bundler
|
|
27
27
|
|
28
28
|
(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
|
29
29
|
|
30
|
-
settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
|
31
30
|
settings_flag(:allow_offline_install) { bundler_3_mode? }
|
32
31
|
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
|
33
32
|
settings_flag(:cache_all) { bundler_3_mode? }
|
data/lib/bundler/fetcher.rb
CHANGED
data/lib/bundler/gem_helper.rb
CHANGED
@@ -116,19 +116,21 @@ module Bundler
|
|
116
116
|
|
117
117
|
def git_push(remote = nil)
|
118
118
|
remote ||= default_remote
|
119
|
-
perform_git_push remote
|
120
|
-
perform_git_push "#{remote}
|
119
|
+
perform_git_push "#{remote} refs/heads/#{current_branch}"
|
120
|
+
perform_git_push "#{remote} refs/tags/#{version_tag}"
|
121
121
|
Bundler.ui.confirm "Pushed git commits and release tag."
|
122
122
|
end
|
123
123
|
|
124
124
|
def default_remote
|
125
|
-
|
126
|
-
return "origin"
|
125
|
+
remote_for_branch, status = sh_with_status(%W[git config --get branch.#{current_branch}.remote])
|
126
|
+
return "origin" unless status.success?
|
127
127
|
|
128
|
-
remote_for_branch
|
129
|
-
|
128
|
+
remote_for_branch.strip
|
129
|
+
end
|
130
130
|
|
131
|
-
|
131
|
+
def current_branch
|
132
|
+
# We can replace this with `git branch --show-current` once we drop support for git < 2.22.0
|
133
|
+
sh(%w[git rev-parse --abbrev-ref HEAD]).gsub(%r{\Aheads/}, "").strip
|
132
134
|
end
|
133
135
|
|
134
136
|
def allowed_push_host
|
@@ -81,8 +81,8 @@ module Bundler
|
|
81
81
|
sort_dep_specs(spec_groups, locked_spec)
|
82
82
|
end.tap do |specs|
|
83
83
|
if DEBUG
|
84
|
-
|
85
|
-
|
84
|
+
puts before_result
|
85
|
+
puts " after sort_versions: #{debug_format_result(dep, specs).inspect}"
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
data/lib/bundler/index.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "set"
|
4
|
-
|
5
3
|
module Bundler
|
6
4
|
class Index
|
7
5
|
include Enumerable
|
@@ -65,11 +63,14 @@ module Bundler
|
|
65
63
|
def unsorted_search(query, base)
|
66
64
|
results = local_search(query, base)
|
67
65
|
|
68
|
-
seen = results.map(&:full_name).
|
66
|
+
seen = results.map(&:full_name).uniq unless @sources.empty?
|
69
67
|
|
70
68
|
@sources.each do |source|
|
71
69
|
source.unsorted_search(query, base).each do |spec|
|
72
|
-
|
70
|
+
next if seen.include?(spec.full_name)
|
71
|
+
|
72
|
+
seen << spec.full_name
|
73
|
+
results << spec
|
73
74
|
end
|
74
75
|
end
|
75
76
|
|
@@ -170,7 +171,7 @@ module Bundler
|
|
170
171
|
def dependencies_eql?(spec, other_spec)
|
171
172
|
deps = spec.dependencies.select {|d| d.type != :development }
|
172
173
|
other_deps = other_spec.dependencies.select {|d| d.type != :development }
|
173
|
-
|
174
|
+
deps.sort == other_deps.sort
|
174
175
|
end
|
175
176
|
|
176
177
|
def add_source(index)
|