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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb5e62df5ac6ec81289223672d91b6b7a1229fc348a7d7d3dba5a200e87293af
4
- data.tar.gz: 8ef6f15e230d10fd4fce8918ffd0bbeff4df1d65e9921d46e0d246cc316fe79d
3
+ metadata.gz: 9014f3bd2d636c4436c097ca7320f15602fe63d151839c3e0304dcd90f28d62f
4
+ data.tar.gz: 7eb224ffa516b5f29d11a35de89b64943fb9dea34c60ccdf51fa031ca81d7dbc
5
5
  SHA512:
6
- metadata.gz: 4da8e14312ce09705a4c23999a27d0cf268809ce6dbb01da190a3f93218fb68c98c21f5ef13ead345e2a46be89dacdc3c87c91e2369bc4b69e0f2a36efa8c6b4
7
- data.tar.gz: f48e22dabd54c2a4e3b87b2644ace759777a2f949fcd47322534804272314b655435dbda1aadfcbb4f7a96e2b52b0ee3666595d8a56384e51720feb17ba28a53
6
+ metadata.gz: 62c02abf9d6d7b4f5e8e28bbeebc364c1154b48ebcfefa7f7f13a2d16b09fa8c14c8f293fb80887666a9e2533d2effc29d6516c10d7433a92a7a953ec3f5a94b
7
+ data.tar.gz: 7db47841661df295e9db0c8861a0fe07129d0e7b5750efd4f987bbe1e223dae8f83733765df2d8f076a18166a624aae1c0361d268a00f9474e81c92c9533e4ac
@@ -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 depedencies present in the Gemfile when rubygems 3.0+ was used and path involved a symlink ([#7211](https://github.com/rubygems/bundler/pull/7211))
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 specifiy error type (@utilum)
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)
@@ -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 = "2020-12-31".freeze
8
- @git_commit_sha = "529e536f28".freeze
7
+ @built_at = "2021-01-11".freeze
8
+ @git_commit_sha = "ba867aed7f".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -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?
@@ -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} #{version_tag}"
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
- current_branch = sh(%w[git rev-parse --abbrev-ref HEAD]).strip
126
- return "origin" if current_branch.empty?
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?
@@ -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
- selected_sgs.insert(-2, sg_ruby) if sg_ruby
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
@@ -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"] || "master"
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
- at = if local?
64
- path
65
- elsif user_ref = options["ref"]
66
- if ref =~ /\A[a-z0-9]{4,}\z/i
67
- shortref_for_display(user_ref)
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
- user_ref
75
+ git_proxy.branch
70
76
  end
71
- else
72
- ref
73
- end
74
77
 
75
- rev = begin
76
- "@#{shortref_for_display(revision)}"
77
- rescue GitError
78
- nil
79
- end
78
+ rev = " (at #{at}@#{shortref_for_display(revision)})"
79
+ rescue GitError
80
+ ""
81
+ end
80
82
 
81
- "#{@safe_uri} (at #{at}#{rev})"
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 a `git #{command}` at runtime. You probably need to run `bundle install`. However, "
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, destination_path, extra_info = nil)
30
+ def initialize(command, path, extra_info = nil)
31
31
  @command = command
32
32
 
33
33
  msg = String.new
34
- msg << "Git error: command `git #{command}` in directory #{destination_path} has failed."
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, path, destination_path, ref, repo)
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, path, destination_path, msg
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, path, destination, @revision, URICredentialsFilter.credential_filtered_uri(uri))
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: SharedHelpers.pwd)
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("git", "-C", dir.to_s, *command)
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: SharedHelpers.pwd)
159
- Bundler::Retry.new("`git -C #{dir} #{URICredentialsFilter.credential_filtered_string(command.shelljoin, uri)}`", GitNotAllowedError).attempts do
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: SharedHelpers.pwd)
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("git", "-C", dir.to_s, *command)
170
+ capture_and_filter_stderr(*capture3_args_for(command, dir))
169
171
  end
170
172
 
171
- raise GitCommandError.new(command_with_no_credentials, path, dir) unless status.success?
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
- URICredentialsFilter.credential_filtered_string(out, uri)
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, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
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
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../../rubygems_gem_installer"
4
+
3
5
  module Bundler
4
6
  class Source
5
7
  class Path
@@ -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
- FileUtils.mv(rubygems_local_path, local_path)
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
@@ -16,5 +16,5 @@ gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
16
16
  <%- end -%>
17
17
  <%- if config[:rubocop] -%>
18
18
 
19
- gem "rubocop", "~> 0.80"
19
+ gem "rubocop", "~> <%= config[:rubocop_version] %>"
20
20
  <%- 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(">= 2.3.0")
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
 
@@ -1,3 +1,6 @@
1
+ AllCops:
2
+ TargetRubyVersion: <%= ::Gem::Version.new(config[:required_ruby_version]).segments[0..1].join(".") %>
3
+
1
4
  Style/StringLiterals:
2
5
  Enabled: true
3
6
  EnforcedStyle: double_quotes
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.4".freeze
4
+ VERSION = "2.2.5".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
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
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: 2020-12-31 00:00:00.000000000 Z
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