bundler 2.2.4 → 2.2.5
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 +18 -2
- data/lib/bundler.rb +0 -1
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/gem.rb +2 -0
- data/lib/bundler/compact_index_client/updater.rb +0 -8
- data/lib/bundler/gem_helper.rb +3 -3
- data/lib/bundler/resolver.rb +6 -1
- data/lib/bundler/source/git.rb +18 -16
- data/lib/bundler/source/git/git_proxy.rb +35 -17
- data/lib/bundler/source/path/installer.rb +2 -0
- data/lib/bundler/source/rubygems.rb +10 -1
- 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/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9014f3bd2d636c4436c097ca7320f15602fe63d151839c3e0304dcd90f28d62f
|
4
|
+
data.tar.gz: 7eb224ffa516b5f29d11a35de89b64943fb9dea34c60ccdf51fa031ca81d7dbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62c02abf9d6d7b4f5e8e28bbeebc364c1154b48ebcfefa7f7f13a2d16b09fa8c14c8f293fb80887666a9e2533d2effc29d6516c10d7433a92a7a953ec3f5a94b
|
7
|
+
data.tar.gz: 7db47841661df295e9db0c8861a0fe07129d0e7b5750efd4f987bbe1e223dae8f83733765df2d8f076a18166a624aae1c0361d268a00f9474e81c92c9533e4ac
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
# 2.2.5 (January 11, 2021)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Improve rubocop setup in the new gem template [#4220](https://github.com/rubygems/rubygems/pull/4220)
|
6
|
+
- Support repositories with default branch not named master [#4224](https://github.com/rubygems/rubygems/pull/4224)
|
7
|
+
|
8
|
+
## Bug fixes:
|
9
|
+
|
10
|
+
- Let Net::HTTP decompress the index instead of doing it manually [#4081](https://github.com/rubygems/rubygems/pull/4081)
|
11
|
+
- Workaround for another jruby crash when autoloading a constant [#4252](https://github.com/rubygems/rubygems/pull/4252)
|
12
|
+
- Fix another performance regression in the resolver [#4243](https://github.com/rubygems/rubygems/pull/4243)
|
13
|
+
- Restore support for old git versions [#4233](https://github.com/rubygems/rubygems/pull/4233)
|
14
|
+
- Give a proper error if cache path does not have write access [#4215](https://github.com/rubygems/rubygems/pull/4215)
|
15
|
+
- Fix running `rake release` from an ambiguous ref [#4219](https://github.com/rubygems/rubygems/pull/4219)
|
16
|
+
|
1
17
|
# 2.2.4 (December 31, 2020)
|
2
18
|
|
3
19
|
## Bug fixes:
|
@@ -327,7 +343,7 @@
|
|
327
343
|
- Fix `bundle update` message about exclude groups saying "installed" instead of "updated" ([#7150](https://github.com/rubygems/bundler/pull/7150))
|
328
344
|
- Fix `bundle licenses` not showing correct information about bundler itself ([#7147](https://github.com/rubygems/bundler/pull/7147))
|
329
345
|
- Fix installation path not including ruby scope when `BUNDLE_PATH` was set ([#7163](https://github.com/rubygems/bundler/pull/7163))
|
330
|
-
- Fix `bundle clean` incorrectly removing git
|
346
|
+
- 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))
|
331
347
|
- Fix platform specific gems always being re-resolved when bundler was not running under that platform ([#7212](https://github.com/rubygems/bundler/pull/7212))
|
332
348
|
- Fix `bundle package --all-platforms` causing `bundle install` to ignore `--with` and `--without` ([#6113](https://github.com/rubygems/bundler/pull/6113))
|
333
349
|
- Fix `MissingRevision` git errors to include the specific `git` command that failed under the hood ([#7225](https://github.com/rubygems/bundler/pull/7225))
|
@@ -499,7 +515,7 @@ Changes
|
|
499
515
|
## Bug fixes:
|
500
516
|
|
501
517
|
- 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)
|
502
|
-
- Fix some rescue calls that don't
|
518
|
+
- Fix some rescue calls that don't specify error type (@utilum)
|
503
519
|
- 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)
|
504
520
|
- Improve handling of adding new gems with only a single group to the Gemfile in `bundle add` (@agrim123)
|
505
521
|
- Refactor check for OpenSSL in `bundle env` (@voxik)
|
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-01-11".freeze
|
8
|
+
@git_commit_sha = "ba867aed7f".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
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
|
|
@@ -147,6 +148,7 @@ module Bundler
|
|
147
148
|
"For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
|
148
149
|
"and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
|
149
150
|
config[:rubocop] = true
|
151
|
+
config[:rubocop_version] = Gem.ruby_version < Gem::Version.new("2.4.a") ? "0.81.0" : "1.7"
|
150
152
|
Bundler.ui.info "RuboCop enabled in config"
|
151
153
|
templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
|
152
154
|
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/gem_helper.rb
CHANGED
@@ -117,13 +117,13 @@ module Bundler
|
|
117
117
|
def git_push(remote = nil)
|
118
118
|
remote ||= default_remote
|
119
119
|
perform_git_push remote
|
120
|
-
perform_git_push "#{remote}
|
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
|
-
|
125
|
+
# We can replace this with `git branch --show-current` once we drop support for git < 2.22.0
|
126
|
+
current_branch = sh(%w[git rev-parse --abbrev-ref HEAD]).gsub(%r{\Aheads/}, "").strip
|
127
127
|
|
128
128
|
remote_for_branch = sh(%W[git config --get branch.#{current_branch}.remote]).strip
|
129
129
|
return "origin" if remote_for_branch.empty?
|
data/lib/bundler/resolver.rb
CHANGED
@@ -163,7 +163,12 @@ module Bundler
|
|
163
163
|
# Add a spec group for "non platform specific spec" as the fallback
|
164
164
|
# spec group.
|
165
165
|
sg_ruby = sg.copy_for([Gem::Platform::RUBY])
|
166
|
-
|
166
|
+
next unless sg_ruby
|
167
|
+
|
168
|
+
sg_ruby_deps = sg_ruby.dependencies_for_activated_platforms.map(&:dep)
|
169
|
+
sg_all_platforms_deps = sg_all_platforms.dependencies_for_activated_platforms.map(&:dep)
|
170
|
+
|
171
|
+
selected_sgs.insert(-2, sg_ruby) if sg_ruby_deps != sg_all_platforms_deps
|
167
172
|
end
|
168
173
|
selected_sgs
|
169
174
|
end
|
data/lib/bundler/source/git.rb
CHANGED
@@ -22,7 +22,7 @@ module Bundler
|
|
22
22
|
@uri = options["uri"] || ""
|
23
23
|
@safe_uri = URICredentialsFilter.credential_filtered_uri(@uri)
|
24
24
|
@branch = options["branch"]
|
25
|
-
@ref = options["ref"] || options["branch"] || options["tag"]
|
25
|
+
@ref = options["ref"] || options["branch"] || options["tag"]
|
26
26
|
@submodules = options["submodules"]
|
27
27
|
@name = options["name"]
|
28
28
|
@version = options["version"].to_s.strip.gsub("-", ".pre.")
|
@@ -60,25 +60,27 @@ module Bundler
|
|
60
60
|
alias_method :==, :eql?
|
61
61
|
|
62
62
|
def to_s
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
begin
|
64
|
+
at = if local?
|
65
|
+
path
|
66
|
+
elsif user_ref = options["ref"]
|
67
|
+
if ref =~ /\A[a-z0-9]{4,}\z/i
|
68
|
+
shortref_for_display(user_ref)
|
69
|
+
else
|
70
|
+
user_ref
|
71
|
+
end
|
72
|
+
elsif ref
|
73
|
+
ref
|
68
74
|
else
|
69
|
-
|
75
|
+
git_proxy.branch
|
70
76
|
end
|
71
|
-
else
|
72
|
-
ref
|
73
|
-
end
|
74
77
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
end
|
78
|
+
rev = " (at #{at}@#{shortref_for_display(revision)})"
|
79
|
+
rescue GitError
|
80
|
+
""
|
81
|
+
end
|
80
82
|
|
81
|
-
"#{@safe_uri}
|
83
|
+
"#{@safe_uri}#{rev}"
|
82
84
|
end
|
83
85
|
|
84
86
|
def name
|
@@ -17,7 +17,7 @@ module Bundler
|
|
17
17
|
class GitNotAllowedError < GitError
|
18
18
|
def initialize(command)
|
19
19
|
msg = String.new
|
20
|
-
msg << "Bundler is trying to run
|
20
|
+
msg << "Bundler is trying to run `#{command}` at runtime. You probably need to run `bundle install`. However, "
|
21
21
|
msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md "
|
22
22
|
msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
|
23
23
|
super msg
|
@@ -27,11 +27,11 @@ module Bundler
|
|
27
27
|
class GitCommandError < GitError
|
28
28
|
attr_reader :command
|
29
29
|
|
30
|
-
def initialize(command, path,
|
30
|
+
def initialize(command, path, extra_info = nil)
|
31
31
|
@command = command
|
32
32
|
|
33
33
|
msg = String.new
|
34
|
-
msg << "Git error: command
|
34
|
+
msg << "Git error: command `#{command}` in directory #{path} has failed."
|
35
35
|
msg << "\n#{extra_info}" if extra_info
|
36
36
|
msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path.exist?
|
37
37
|
super msg
|
@@ -39,9 +39,9 @@ module Bundler
|
|
39
39
|
end
|
40
40
|
|
41
41
|
class MissingGitRevisionError < GitCommandError
|
42
|
-
def initialize(command,
|
42
|
+
def initialize(command, destination_path, ref, repo)
|
43
43
|
msg = "Revision #{ref} does not exist in the repository #{repo}. Maybe you misspelled it?"
|
44
|
-
super command,
|
44
|
+
super command, destination_path, msg
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -132,7 +132,7 @@ module Bundler
|
|
132
132
|
begin
|
133
133
|
git "reset", "--hard", @revision, :dir => destination
|
134
134
|
rescue GitCommandError => e
|
135
|
-
raise MissingGitRevisionError.new(e.command,
|
135
|
+
raise MissingGitRevisionError.new(e.command, destination, @revision, URICredentialsFilter.credential_filtered_uri(uri))
|
136
136
|
end
|
137
137
|
|
138
138
|
if submodules
|
@@ -145,32 +145,36 @@ module Bundler
|
|
145
145
|
|
146
146
|
private
|
147
147
|
|
148
|
-
def git_null(*command, dir:
|
148
|
+
def git_null(*command, dir: nil)
|
149
149
|
check_allowed(command)
|
150
150
|
|
151
151
|
out, status = SharedHelpers.with_clean_git_env do
|
152
|
-
capture_and_ignore_stderr(
|
152
|
+
capture_and_ignore_stderr(*capture3_args_for(command, dir))
|
153
153
|
end
|
154
154
|
|
155
155
|
[URICredentialsFilter.credential_filtered_string(out, uri), status]
|
156
156
|
end
|
157
157
|
|
158
|
-
def git_retry(*command, dir:
|
159
|
-
|
158
|
+
def git_retry(*command, dir: nil)
|
159
|
+
command_with_no_credentials = check_allowed(command)
|
160
|
+
|
161
|
+
Bundler::Retry.new("`#{command_with_no_credentials}` at #{dir || SharedHelpers.pwd}").attempts do
|
160
162
|
git(*command, :dir => dir)
|
161
163
|
end
|
162
164
|
end
|
163
165
|
|
164
|
-
def git(*command, dir:
|
166
|
+
def git(*command, dir: nil)
|
165
167
|
command_with_no_credentials = check_allowed(command)
|
166
168
|
|
167
169
|
out, status = SharedHelpers.with_clean_git_env do
|
168
|
-
capture_and_filter_stderr(
|
170
|
+
capture_and_filter_stderr(*capture3_args_for(command, dir))
|
169
171
|
end
|
170
172
|
|
171
|
-
|
173
|
+
filtered_out = URICredentialsFilter.credential_filtered_string(out, uri)
|
174
|
+
|
175
|
+
raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, filtered_out) unless status.success?
|
172
176
|
|
173
|
-
|
177
|
+
filtered_out
|
174
178
|
end
|
175
179
|
|
176
180
|
def has_revision_cached?
|
@@ -187,10 +191,10 @@ module Bundler
|
|
187
191
|
|
188
192
|
def find_local_revision
|
189
193
|
allowed_with_path do
|
190
|
-
git("rev-parse", "--verify", ref, :dir => path).strip
|
194
|
+
git("rev-parse", "--verify", ref || "HEAD", :dir => path).strip
|
191
195
|
end
|
192
196
|
rescue GitCommandError => e
|
193
|
-
raise MissingGitRevisionError.new(e.command, path,
|
197
|
+
raise MissingGitRevisionError.new(e.command, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
|
194
198
|
end
|
195
199
|
|
196
200
|
# Adds credentials to the URI as Fetcher#configured_uri_for does
|
@@ -220,7 +224,7 @@ module Bundler
|
|
220
224
|
end
|
221
225
|
|
222
226
|
def check_allowed(command)
|
223
|
-
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command.shelljoin, uri)
|
227
|
+
command_with_no_credentials = URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", uri)
|
224
228
|
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
|
225
229
|
command_with_no_credentials
|
226
230
|
end
|
@@ -237,6 +241,20 @@ module Bundler
|
|
237
241
|
return_value, _, status = Open3.capture3(*cmd)
|
238
242
|
[return_value, status]
|
239
243
|
end
|
244
|
+
|
245
|
+
def capture3_args_for(cmd, dir)
|
246
|
+
return ["git", *cmd] unless dir
|
247
|
+
|
248
|
+
if Bundler.feature_flag.bundler_3_mode? || supports_minus_c?
|
249
|
+
["git", "-C", dir.to_s, *cmd]
|
250
|
+
else
|
251
|
+
["git", *cmd, { :chdir => dir.to_s }]
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
def supports_minus_c?
|
256
|
+
@supports_minus_c ||= Gem::Version.new(version) >= Gem::Version.new("1.8.5")
|
257
|
+
end
|
240
258
|
end
|
241
259
|
end
|
242
260
|
end
|
@@ -145,6 +145,8 @@ module Bundler
|
|
145
145
|
|
146
146
|
Bundler.mkdir_p bin_path, :no_sudo => true unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
|
147
147
|
|
148
|
+
require_relative "../rubygems_gem_installer"
|
149
|
+
|
148
150
|
installed_spec = Bundler::RubyGemsGemInstaller.at(
|
149
151
|
path,
|
150
152
|
:install_dir => install_path.to_s,
|
@@ -487,8 +489,15 @@ module Bundler
|
|
487
489
|
uri = spec.remote.uri
|
488
490
|
Bundler.ui.confirm("Fetching #{version_message(spec)}")
|
489
491
|
rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
|
492
|
+
|
493
|
+
# older rubygems return varying file:// variants depending on version
|
494
|
+
rubygems_local_path = rubygems_local_path.gsub(/\Afile:/, "") unless Bundler.rubygems.provides?(">= 3.2.0.rc.2")
|
495
|
+
rubygems_local_path = rubygems_local_path.gsub(%r{\A//}, "") if Bundler.rubygems.provides?("< 3.1.0")
|
496
|
+
|
490
497
|
if rubygems_local_path != local_path
|
491
|
-
|
498
|
+
SharedHelpers.filesystem_access(local_path) do
|
499
|
+
FileUtils.mv(rubygems_local_path, local_path)
|
500
|
+
end
|
492
501
|
end
|
493
502
|
cache_globally(spec, local_path)
|
494
503
|
end
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
<%- if config[:mit] -%>
|
15
15
|
spec.license = "MIT"
|
16
16
|
<%- end -%>
|
17
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new(">= <%= config[:required_ruby_version] %>")
|
18
18
|
|
19
19
|
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
20
20
|
|
data/lib/bundler/version.rb
CHANGED
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.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
@@ -22,7 +22,7 @@ authors:
|
|
22
22
|
autorequire:
|
23
23
|
bindir: exe
|
24
24
|
cert_chain: []
|
25
|
-
date:
|
25
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
26
26
|
dependencies: []
|
27
27
|
description: Bundler manages an application's dependencies through its entire life,
|
28
28
|
across many machines, systematically and repeatably
|