bundler 2.4.20 → 2.4.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -3
  3. data/lib/bundler/build_metadata.rb +3 -3
  4. data/lib/bundler/cli/check.rb +1 -1
  5. data/lib/bundler/cli/gem.rb +1 -3
  6. data/lib/bundler/cli/install.rb +2 -2
  7. data/lib/bundler/cli/lock.rb +26 -23
  8. data/lib/bundler/cli/open.rb +5 -7
  9. data/lib/bundler/definition.rb +42 -25
  10. data/lib/bundler/env.rb +2 -2
  11. data/lib/bundler/gem_version_promoter.rb +2 -2
  12. data/lib/bundler/injector.rb +1 -1
  13. data/lib/bundler/installer/parallel_installer.rb +0 -26
  14. data/lib/bundler/installer/standalone.rb +13 -6
  15. data/lib/bundler/lockfile_parser.rb +29 -24
  16. data/lib/bundler/man/bundle-add.1 +1 -1
  17. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  18. data/lib/bundler/man/bundle-cache.1 +1 -1
  19. data/lib/bundler/man/bundle-check.1 +1 -1
  20. data/lib/bundler/man/bundle-clean.1 +1 -1
  21. data/lib/bundler/man/bundle-config.1 +1 -1
  22. data/lib/bundler/man/bundle-console.1 +1 -1
  23. data/lib/bundler/man/bundle-doctor.1 +1 -1
  24. data/lib/bundler/man/bundle-exec.1 +2 -2
  25. data/lib/bundler/man/bundle-exec.1.ronn +2 -3
  26. data/lib/bundler/man/bundle-gem.1 +1 -1
  27. data/lib/bundler/man/bundle-help.1 +1 -1
  28. data/lib/bundler/man/bundle-info.1 +1 -1
  29. data/lib/bundler/man/bundle-init.1 +1 -1
  30. data/lib/bundler/man/bundle-inject.1 +1 -1
  31. data/lib/bundler/man/bundle-install.1 +1 -1
  32. data/lib/bundler/man/bundle-list.1 +1 -1
  33. data/lib/bundler/man/bundle-lock.1 +1 -1
  34. data/lib/bundler/man/bundle-open.1 +1 -1
  35. data/lib/bundler/man/bundle-outdated.1 +1 -1
  36. data/lib/bundler/man/bundle-platform.1 +1 -1
  37. data/lib/bundler/man/bundle-plugin.1 +17 -17
  38. data/lib/bundler/man/bundle-plugin.1.ronn +5 -5
  39. data/lib/bundler/man/bundle-pristine.1 +1 -1
  40. data/lib/bundler/man/bundle-remove.1 +1 -1
  41. data/lib/bundler/man/bundle-show.1 +1 -1
  42. data/lib/bundler/man/bundle-update.1 +1 -1
  43. data/lib/bundler/man/bundle-version.1 +1 -1
  44. data/lib/bundler/man/bundle-viz.1 +1 -1
  45. data/lib/bundler/man/bundle.1 +1 -1
  46. data/lib/bundler/man/gemfile.5 +1 -1
  47. data/lib/bundler/resolver/package.rb +5 -0
  48. data/lib/bundler/resolver.rb +27 -7
  49. data/lib/bundler/ruby_version.rb +8 -1
  50. data/lib/bundler/settings.rb +53 -16
  51. data/lib/bundler/shared_helpers.rb +16 -1
  52. data/lib/bundler/source/git/git_proxy.rb +13 -4
  53. data/lib/bundler/spec_set.rb +2 -2
  54. data/lib/bundler/stub_specification.rb +4 -2
  55. data/lib/bundler/templates/newgem/Rakefile.tt +6 -2
  56. data/lib/bundler/version.rb +1 -1
  57. data/lib/bundler/yaml_serializer.rb +6 -7
  58. metadata +3 -3
@@ -130,7 +130,8 @@ module Bundler
130
130
  end
131
131
  end
132
132
 
133
- git "fetch", "--force", "--quiet", *extra_fetch_args, :dir => destination if @commit_ref
133
+ ref = @commit_ref || (locked_to_full_sha? && @revision)
134
+ git "fetch", "--force", "--quiet", *extra_fetch_args(ref), :dir => destination if ref
134
135
 
135
136
  git "reset", "--hard", @revision, :dir => destination
136
137
 
@@ -247,7 +248,15 @@ module Bundler
247
248
  end
248
249
 
249
250
  def pinned_to_full_sha?
250
- ref =~ /\A\h{40}\z/
251
+ full_sha_revision?(ref)
252
+ end
253
+
254
+ def locked_to_full_sha?
255
+ full_sha_revision?(@revision)
256
+ end
257
+
258
+ def full_sha_revision?(ref)
259
+ ref&.match?(/\A\h{40}\z/)
251
260
  end
252
261
 
253
262
  def git_null(*command, dir: nil)
@@ -411,9 +420,9 @@ module Bundler
411
420
  ["--depth", depth.to_s]
412
421
  end
413
422
 
414
- def extra_fetch_args
423
+ def extra_fetch_args(ref)
415
424
  extra_args = [path.to_s, *depth_args]
416
- extra_args.push(@commit_ref)
425
+ extra_args.push(ref)
417
426
  extra_args
418
427
  end
419
428
 
@@ -100,12 +100,12 @@ module Bundler
100
100
  end
101
101
  end
102
102
 
103
- def incomplete_ruby_specs?(deps)
103
+ def incomplete_for_platform?(deps, platform)
104
104
  return false if @specs.empty?
105
105
 
106
106
  @incomplete_specs = []
107
107
 
108
- self.for(deps, true, [Gem::Platform::RUBY])
108
+ self.for(deps, true, [platform])
109
109
 
110
110
  @incomplete_specs.any?
111
111
  end
@@ -16,7 +16,8 @@ module Bundler
16
16
  # Stub has no concept of source, which means that extension_dir may be wrong
17
17
  # This is the case for git-based gems. So, instead manually assign the extension dir
18
18
  return unless source.respond_to?(:extension_dir_name)
19
- path = File.join(stub.extensions_dir, source.extension_dir_name)
19
+ unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
20
+ path = File.join(stub.extensions_dir, unique_extension_dir)
20
21
  stub.extension_dir = File.expand_path(path)
21
22
  end
22
23
 
@@ -56,7 +57,7 @@ module Bundler
56
57
  end
57
58
 
58
59
  def gem_build_complete_path
59
- File.join(extension_dir, "gem.build_complete")
60
+ stub.gem_build_complete_path
60
61
  end
61
62
 
62
63
  def default_gem?
@@ -108,6 +109,7 @@ module Bundler
108
109
  end
109
110
 
110
111
  rs.source = source
112
+ rs.base_dir = stub.base_dir
111
113
 
112
114
  rs
113
115
  end
@@ -46,7 +46,9 @@ require "rb_sys/extensiontask"
46
46
 
47
47
  task build: :compile
48
48
 
49
- RbSys::ExtensionTask.new(<%= config[:name].inspect %>) do |ext|
49
+ GEMSPEC = Gem::Specification.load("<%= config[:underscored_name] %>.gemspec")
50
+
51
+ RbSys::ExtensionTask.new(<%= config[:name].inspect %>, GEMSPEC) do |ext|
50
52
  ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
51
53
  end
52
54
  <% else -%>
@@ -54,7 +56,9 @@ require "rake/extensiontask"
54
56
 
55
57
  task build: :compile
56
58
 
57
- Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
59
+ GEMSPEC = Gem::Specification.load("<%= config[:underscored_name] %>.gemspec")
60
+
61
+ Rake::ExtensionTask.new("<%= config[:underscored_name] %>", GEMSPEC) do |ext|
58
62
  ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
59
63
  end
60
64
  <% end -%>
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.20".freeze
4
+ VERSION = "2.4.21".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -54,8 +54,8 @@ module Bundler
54
54
  str.split(/\r?\n/).each do |line|
55
55
  if match = HASH_REGEX.match(line)
56
56
  indent, key, quote, val = match.captures
57
- key = convert_to_backward_compatible_key(key)
58
- depth = indent.scan(/ /).length
57
+ convert_to_backward_compatible_key!(key)
58
+ depth = indent.size / 2
59
59
  if quote.empty? && val.empty?
60
60
  new_hash = {}
61
61
  stack[depth][key] = new_hash
@@ -76,14 +76,13 @@ module Bundler
76
76
  end
77
77
 
78
78
  # for settings' keys
79
- def convert_to_backward_compatible_key(key)
80
- key = "#{key}/" if key =~ /https?:/i && key !~ %r{/\Z}
81
- key = key.gsub(".", "__") if key.include?(".")
82
- key
79
+ def convert_to_backward_compatible_key!(key)
80
+ key << "/" if /https?:/i.match?(key) && !%r{/\Z}.match?(key)
81
+ key.gsub!(".", "__")
83
82
  end
84
83
 
85
84
  class << self
86
- private :dump_hash, :convert_to_backward_compatible_key
85
+ private :dump_hash, :convert_to_backward_compatible_key!
87
86
  end
88
87
  end
89
88
  end
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.4.20
4
+ version: 2.4.21
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: 2023-09-27 00:00:00.000000000 Z
25
+ date: 2023-10-17 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
@@ -381,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
381
  - !ruby/object:Gem::Version
382
382
  version: 3.0.1
383
383
  requirements: []
384
- rubygems_version: 3.4.20
384
+ rubygems_version: 3.4.21
385
385
  signing_key:
386
386
  specification_version: 4
387
387
  summary: The best way to manage your application's dependencies