bundler 2.4.12 → 2.4.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +88 -0
  3. data/exe/bundle +5 -13
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli/binstubs.rb +1 -1
  6. data/lib/bundler/cli/info.rb +1 -1
  7. data/lib/bundler/cli/install.rb +1 -1
  8. data/lib/bundler/cli/outdated.rb +1 -1
  9. data/lib/bundler/cli/platform.rb +7 -5
  10. data/lib/bundler/definition.rb +97 -59
  11. data/lib/bundler/dsl.rb +1 -1
  12. data/lib/bundler/env.rb +1 -1
  13. data/lib/bundler/feature_flag.rb +0 -1
  14. data/lib/bundler/fetcher/compact_index.rb +3 -3
  15. data/lib/bundler/fetcher/downloader.rb +2 -0
  16. data/lib/bundler/fetcher/index.rb +1 -2
  17. data/lib/bundler/fetcher.rb +11 -1
  18. data/lib/bundler/friendly_errors.rb +1 -1
  19. data/lib/bundler/gem_helper.rb +3 -4
  20. data/lib/bundler/installer/parallel_installer.rb +1 -1
  21. data/lib/bundler/installer.rb +1 -1
  22. data/lib/bundler/lockfile_generator.rb +1 -1
  23. data/lib/bundler/lockfile_parser.rb +1 -0
  24. data/lib/bundler/man/bundle-add.1 +1 -1
  25. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  26. data/lib/bundler/man/bundle-cache.1 +3 -3
  27. data/lib/bundler/man/bundle-cache.1.ronn +2 -2
  28. data/lib/bundler/man/bundle-check.1 +1 -1
  29. data/lib/bundler/man/bundle-clean.1 +1 -1
  30. data/lib/bundler/man/bundle-config.1 +1 -4
  31. data/lib/bundler/man/bundle-config.1.ronn +0 -3
  32. data/lib/bundler/man/bundle-console.1 +1 -1
  33. data/lib/bundler/man/bundle-doctor.1 +1 -1
  34. data/lib/bundler/man/bundle-exec.1 +1 -1
  35. data/lib/bundler/man/bundle-gem.1 +1 -1
  36. data/lib/bundler/man/bundle-help.1 +1 -1
  37. data/lib/bundler/man/bundle-info.1 +3 -3
  38. data/lib/bundler/man/bundle-info.1.ronn +3 -3
  39. data/lib/bundler/man/bundle-init.1 +1 -1
  40. data/lib/bundler/man/bundle-inject.1 +1 -1
  41. data/lib/bundler/man/bundle-install.1 +1 -1
  42. data/lib/bundler/man/bundle-list.1 +1 -1
  43. data/lib/bundler/man/bundle-lock.1 +1 -1
  44. data/lib/bundler/man/bundle-open.1 +1 -1
  45. data/lib/bundler/man/bundle-outdated.1 +13 -9
  46. data/lib/bundler/man/bundle-outdated.1.ronn +12 -9
  47. data/lib/bundler/man/bundle-platform.1 +1 -1
  48. data/lib/bundler/man/bundle-plugin.1 +1 -1
  49. data/lib/bundler/man/bundle-pristine.1 +1 -1
  50. data/lib/bundler/man/bundle-remove.1 +1 -1
  51. data/lib/bundler/man/bundle-show.1 +1 -1
  52. data/lib/bundler/man/bundle-update.1 +1 -1
  53. data/lib/bundler/man/bundle-version.1 +1 -1
  54. data/lib/bundler/man/bundle-viz.1 +1 -1
  55. data/lib/bundler/man/bundle.1 +1 -1
  56. data/lib/bundler/man/gemfile.5 +15 -2
  57. data/lib/bundler/man/gemfile.5.ronn +6 -1
  58. data/lib/bundler/plugin/index.rb +1 -1
  59. data/lib/bundler/resolver.rb +16 -2
  60. data/lib/bundler/ruby_dsl.rb +6 -0
  61. data/lib/bundler/ruby_version.rb +2 -2
  62. data/lib/bundler/rubygems_integration.rb +1 -1
  63. data/lib/bundler/runtime.rb +1 -1
  64. data/lib/bundler/safe_marshal.rb +31 -0
  65. data/lib/bundler/settings.rb +3 -3
  66. data/lib/bundler/source/git/git_proxy.rb +31 -13
  67. data/lib/bundler/source/git.rb +40 -14
  68. data/lib/bundler/source/rubygems.rb +8 -5
  69. data/lib/bundler/source.rb +1 -1
  70. data/lib/bundler/source_list.rb +0 -4
  71. data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
  72. data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +4 -4
  73. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -1
  74. data/lib/bundler/ui/rg_proxy.rb +1 -1
  75. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1 -1
  76. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +9 -4
  77. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +2 -2
  78. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -1
  79. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  80. data/lib/bundler/version.rb +1 -1
  81. data/lib/bundler.rb +7 -15
  82. metadata +4 -3
@@ -160,7 +160,7 @@ module Bundler
160
160
  constraint_string = constraint.constraint_string
161
161
  requirements = constraint_string.split(" OR ").map {|req| Gem::Requirement.new(req.split(",")) }
162
162
 
163
- if name == "bundler"
163
+ if name == "bundler" && bundler_pinned_to_current_version?
164
164
  custom_explanation = "the current Bundler version (#{Bundler::VERSION}) does not satisfy #{constraint}"
165
165
  extended_explanation = bundler_not_found_message(requirements)
166
166
  else
@@ -230,6 +230,12 @@ module Bundler
230
230
  def all_versions_for(package)
231
231
  name = package.name
232
232
  results = (@base[name] + filter_prereleases(@all_specs[name], package)).uniq {|spec| [spec.version.hash, spec.platform] }
233
+
234
+ if name == "bundler" && !bundler_pinned_to_current_version?
235
+ bundler_spec = Gem.loaded_specs["bundler"]
236
+ results << bundler_spec if bundler_spec
237
+ end
238
+
233
239
  locked_requirement = base_requirements[name]
234
240
  results = filter_matching_specs(results, locked_requirement) if locked_requirement
235
241
 
@@ -254,6 +260,14 @@ module Bundler
254
260
  @source_requirements[name] || @source_requirements[:default]
255
261
  end
256
262
 
263
+ def default_bundler_source
264
+ @source_requirements[:default_bundler]
265
+ end
266
+
267
+ def bundler_pinned_to_current_version?
268
+ !default_bundler_source.nil?
269
+ end
270
+
257
271
  def name_for_explicit_dependency_source
258
272
  Bundler.default_gemfile.basename.to_s
259
273
  rescue StandardError
@@ -398,7 +412,7 @@ module Bundler
398
412
  end
399
413
 
400
414
  def bundler_not_found_message(conflict_dependencies)
401
- candidate_specs = filter_matching_specs(source_for(:default_bundler).specs.search("bundler"), conflict_dependencies)
415
+ candidate_specs = filter_matching_specs(default_bundler_source.specs.search("bundler"), conflict_dependencies)
402
416
 
403
417
  if candidate_specs.any?
404
418
  target_version = candidate_specs.last.version
@@ -5,9 +5,15 @@ module Bundler
5
5
  def ruby(*ruby_version)
6
6
  options = ruby_version.last.is_a?(Hash) ? ruby_version.pop : {}
7
7
  ruby_version.flatten!
8
+
8
9
  raise GemfileError, "Please define :engine_version" if options[:engine] && options[:engine_version].nil?
9
10
  raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
10
11
 
12
+ if options[:file]
13
+ raise GemfileError, "Cannot specify version when using the file option" if ruby_version.any?
14
+ ruby_version << Bundler.read_file(options[:file]).strip
15
+ end
16
+
11
17
  if options[:engine] == "ruby" && options[:engine_version] &&
12
18
  ruby_version != Array(options[:engine_version])
13
19
  raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
@@ -28,8 +28,8 @@ module Bundler
28
28
  end
29
29
 
30
30
  @gem_version = Gem::Requirement.create(@versions.first).requirements.first.last
31
- @input_engine = engine && engine.to_s
32
- @engine = engine && engine.to_s || "ruby"
31
+ @input_engine = engine&.to_s
32
+ @engine = engine&.to_s || "ruby"
33
33
  @engine_versions = (engine_version && Array(engine_version)) || @versions
34
34
  @engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
35
35
  @patchlevel = patchlevel || (@gem_version.prerelease? ? "-1" : nil)
@@ -247,7 +247,7 @@ module Bundler
247
247
  kernel = (class << ::Kernel; self; end)
248
248
  [kernel, ::Kernel].each do |kernel_class|
249
249
  redefine_method(kernel_class, :gem) do |dep, *reqs|
250
- if executables && executables.include?(File.basename(caller.first.split(":").first))
250
+ if executables&.include?(File.basename(caller.first.split(":").first))
251
251
  break
252
252
  end
253
253
 
@@ -94,7 +94,7 @@ module Bundler
94
94
  definition_method :requires
95
95
 
96
96
  def lock(opts = {})
97
- return if @definition.nothing_changed? && !@definition.unlocking?
97
+ return if @definition.no_resolve_needed?
98
98
  @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
99
99
  end
100
100
 
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ module SafeMarshal
5
+ ALLOWED_CLASSES = [
6
+ Array,
7
+ FalseClass,
8
+ Gem::Specification,
9
+ Gem::Version,
10
+ Hash,
11
+ String,
12
+ Symbol,
13
+ Time,
14
+ TrueClass,
15
+ ].freeze
16
+
17
+ ERROR = "Unexpected class %s present in marshaled data. Only %s are allowed."
18
+
19
+ PROC = proc do |object|
20
+ object.tap do
21
+ unless ALLOWED_CLASSES.include?(object.class)
22
+ raise TypeError, format(ERROR, object.class, ALLOWED_CLASSES.join(", "))
23
+ end
24
+ end
25
+ end
26
+
27
+ def self.proc
28
+ PROC
29
+ end
30
+ end
31
+ end
@@ -43,7 +43,6 @@ module Bundler
43
43
  setup_makes_kernel_gem_public
44
44
  silence_deprecations
45
45
  silence_root_warning
46
- suppress_install_using_messages
47
46
  update_requires_all_flag
48
47
  ].freeze
49
48
 
@@ -219,7 +218,6 @@ module Bundler
219
218
  def path
220
219
  configs.each do |_level, settings|
221
220
  path = value_for("path", settings)
222
- path = "vendor/bundle" if value_for("deployment", settings) && path.nil?
223
221
  path_system = value_for("path.system", settings)
224
222
  disabled_shared_gems = value_for("disable_shared_gems", settings)
225
223
  next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
@@ -227,7 +225,9 @@ module Bundler
227
225
  return Path.new(path, system_path)
228
226
  end
229
227
 
230
- Path.new(nil, false)
228
+ path = "vendor/bundle" if self[:deployment]
229
+
230
+ Path.new(path, false)
231
231
  end
232
232
 
233
233
  Path = Struct.new(:explicit_path, :system_path) do
@@ -67,8 +67,8 @@ module Bundler
67
67
  end
68
68
 
69
69
  def current_branch
70
- @current_branch ||= allowed_with_path do
71
- git("rev-parse", "--abbrev-ref", "HEAD", :dir => path).strip
70
+ @current_branch ||= with_path do
71
+ git_local("rev-parse", "--abbrev-ref", "HEAD", :dir => path).strip
72
72
  end
73
73
  end
74
74
 
@@ -84,7 +84,7 @@ module Bundler
84
84
  end
85
85
 
86
86
  def full_version
87
- @full_version ||= git("--version").sub(/git version\s*/, "").strip
87
+ @full_version ||= git_local("--version").sub(/git version\s*/, "").strip
88
88
  end
89
89
 
90
90
  def checkout
@@ -253,15 +253,15 @@ module Bundler
253
253
  end
254
254
 
255
255
  def git(*command, dir: nil)
256
- command_with_no_credentials = check_allowed(command)
257
-
258
- out, err, status = capture(command, dir)
259
-
260
- raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, err) unless status.success?
261
-
262
- Bundler.ui.warn err unless err.empty?
256
+ run_command(*command, :dir => dir) do |unredacted_command|
257
+ check_allowed(unredacted_command)
258
+ end
259
+ end
263
260
 
264
- out
261
+ def git_local(*command, dir: nil)
262
+ run_command(*command, :dir => dir) do |unredacted_command|
263
+ redact_and_check_presence(unredacted_command)
264
+ end
265
265
  end
266
266
 
267
267
  def has_revision_cached?
@@ -330,12 +330,30 @@ module Bundler
330
330
  end
331
331
 
332
332
  def check_allowed(command)
333
- require "shellwords"
334
- command_with_no_credentials = URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", uri)
333
+ command_with_no_credentials = redact_and_check_presence(command)
335
334
  raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
336
335
  command_with_no_credentials
337
336
  end
338
337
 
338
+ def redact_and_check_presence(command)
339
+ raise GitNotInstalledError.new unless Bundler.git_present?
340
+
341
+ require "shellwords"
342
+ URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", uri)
343
+ end
344
+
345
+ def run_command(*command, dir: nil)
346
+ command_with_no_credentials = yield(command)
347
+
348
+ out, err, status = capture(command, dir)
349
+
350
+ raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, err) unless status.success?
351
+
352
+ Bundler.ui.warn err unless err.empty?
353
+
354
+ out
355
+ end
356
+
339
357
  def capture(cmd, dir, ignore_err: false)
340
358
  SharedHelpers.with_clean_git_env do
341
359
  require "open3"
@@ -46,6 +46,14 @@ module Bundler
46
46
  out << " specs:\n"
47
47
  end
48
48
 
49
+ def to_gemfile
50
+ specifiers = %w[ref branch tag submodules glob].map do |opt|
51
+ "#{opt}: #{options[opt]}" if options[opt]
52
+ end
53
+
54
+ uri_with_specifiers(specifiers)
55
+ end
56
+
49
57
  def hash
50
58
  [self.class, uri, ref, branch, name, version, glob, submodules].hash
51
59
  end
@@ -59,28 +67,32 @@ module Bundler
59
67
 
60
68
  alias_method :==, :eql?
61
69
 
70
+ def include?(other)
71
+ other.is_a?(Git) && uri == other.uri &&
72
+ name == other.name &&
73
+ glob == other.glob &&
74
+ submodules == other.submodules
75
+ end
76
+
62
77
  def to_s
63
78
  begin
64
- at = if local?
65
- path
66
- elsif user_ref = options["ref"]
67
- if /\A[a-z0-9]{4,}\z/i.match?(ref)
68
- shortref_for_display(user_ref)
69
- else
70
- user_ref
71
- end
72
- elsif ref
73
- ref
74
- else
75
- current_branch
76
- end
79
+ at = humanized_ref || current_branch
77
80
 
78
81
  rev = "at #{at}@#{shortref_for_display(revision)}"
79
82
  rescue GitError
80
83
  ""
81
84
  end
82
85
 
83
- specifiers = [rev, glob_for_display].compact
86
+ uri_with_specifiers([rev, glob_for_display])
87
+ end
88
+
89
+ def identifier
90
+ uri_with_specifiers([humanized_ref, cached_revision, glob_for_display])
91
+ end
92
+
93
+ def uri_with_specifiers(specifiers)
94
+ specifiers.compact!
95
+
84
96
  suffix =
85
97
  if specifiers.any?
86
98
  " (#{specifiers.join(", ")})"
@@ -243,6 +255,20 @@ module Bundler
243
255
 
244
256
  private
245
257
 
258
+ def humanized_ref
259
+ if local?
260
+ path
261
+ elsif user_ref = options["ref"]
262
+ if /\A[a-z0-9]{4,}\z/i.match?(ref)
263
+ shortref_for_display(user_ref)
264
+ else
265
+ user_ref
266
+ end
267
+ elsif ref
268
+ ref
269
+ end
270
+ end
271
+
246
272
  def serialize_gemspecs_in(destination)
247
273
  destination = destination.expand_path(Bundler.root) if destination.relative?
248
274
  Dir["#{destination}/#{@glob}"].each do |spec_path|
@@ -10,7 +10,7 @@ module Bundler
10
10
  # Ask for X gems per API request
11
11
  API_REQUEST_SIZE = 50
12
12
 
13
- attr_reader :remotes, :caches
13
+ attr_reader :remotes
14
14
 
15
15
  def initialize(options = {})
16
16
  @options = options
@@ -19,11 +19,14 @@ module Bundler
19
19
  @allow_remote = false
20
20
  @allow_cached = false
21
21
  @allow_local = options["allow_local"] || false
22
- @caches = [cache_path, *Bundler.rubygems.gem_cache]
23
22
 
24
23
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
25
24
  end
26
25
 
26
+ def caches
27
+ @caches ||= [cache_path, *Bundler.rubygems.gem_cache]
28
+ end
29
+
27
30
  def local_only!
28
31
  @specs = nil
29
32
  @allow_local = true
@@ -120,6 +123,7 @@ module Bundler
120
123
  end
121
124
  end
122
125
  alias_method :name, :identifier
126
+ alias_method :to_gemfile, :identifier
123
127
 
124
128
  def specs
125
129
  @specs ||= begin
@@ -324,9 +328,9 @@ module Bundler
324
328
 
325
329
  def cached_path(spec)
326
330
  global_cache_path = download_cache_path(spec)
327
- @caches << global_cache_path if global_cache_path
331
+ caches << global_cache_path if global_cache_path
328
332
 
329
- possibilities = @caches.map {|p| package_path(p, spec) }
333
+ possibilities = caches.map {|p| package_path(p, spec) }
330
334
  possibilities.find {|p| File.exist?(p) }
331
335
  end
332
336
 
@@ -378,7 +382,6 @@ module Bundler
378
382
  idx = @allow_local ? installed_specs.dup : Index.new
379
383
 
380
384
  Dir["#{cache_path}/*.gem"].each do |gemfile|
381
- next if /^bundler\-[\d\.]+?\.gem/.match?(gemfile)
382
385
  s ||= Bundler.rubygems.spec_from_gem(gemfile)
383
386
  s.source = self
384
387
  idx << s
@@ -100,7 +100,7 @@ module Bundler
100
100
  end
101
101
 
102
102
  def print_using_message(message)
103
- if !message.include?("(was ") && Bundler.feature_flag.suppress_install_using_messages?
103
+ if !message.include?("(was ")
104
104
  Bundler.ui.debug message
105
105
  else
106
106
  Bundler.ui.info message
@@ -101,10 +101,6 @@ module Bundler
101
101
  source_list_for(source).find {|s| equivalent_source?(source, s) }
102
102
  end
103
103
 
104
- def get_with_fallback(source)
105
- get(source) || default_source
106
- end
107
-
108
104
  def lock_sources
109
105
  lock_other_sources + lock_rubygems_sources
110
106
  end
@@ -12,4 +12,4 @@ publish = false
12
12
  crate-type = ["cdylib"]
13
13
 
14
14
  [dependencies]
15
- magnus = { version = "0.4" }
15
+ magnus = { version = "0.6" }
@@ -1,12 +1,12 @@
1
- use magnus::{define_module, function, prelude::*, Error};
1
+ use magnus::{function, prelude::*, Error, Ruby};
2
2
 
3
3
  fn hello(subject: String) -> String {
4
- format!("Hello from Rust, {}!", subject)
4
+ format!("Hello from Rust, {subject}!")
5
5
  }
6
6
 
7
7
  #[magnus::init]
8
- fn init() -> Result<(), Error> {
9
- let module = <%= config[:constant_array].map {|c| "define_module(#{c.dump})?"}.join(".") %>;
8
+ fn init(ruby: &Ruby) -> Result<(), Error> {
9
+ let module = ruby.<%= config[:constant_array].map {|c| "define_module(#{c.dump})?"}.join(".") %>;
10
10
  module.define_singleton_method("hello", function!(hello, 1))?;
11
11
  Ok(())
12
12
  }
@@ -29,7 +29,8 @@ Gem::Specification.new do |spec|
29
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
30
  spec.files = Dir.chdir(__dir__) do
31
31
  `git ls-files -z`.split("\x0").reject do |f|
32
- (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
32
+ (File.expand_path(f) == __FILE__) ||
33
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
33
34
  end
34
35
  end
35
36
  spec.bindir = "exe"
@@ -12,7 +12,7 @@ module Bundler
12
12
  end
13
13
 
14
14
  def say(message)
15
- @ui && @ui.debug(message)
15
+ @ui&.debug(message)
16
16
  end
17
17
  end
18
18
  end
@@ -3,7 +3,7 @@
3
3
  begin
4
4
  require 'rbconfig'
5
5
  rescue LoadError
6
- # for make mjit-headers
6
+ # for make rjit-headers
7
7
  end
8
8
 
9
9
  # Namespace for file utility methods for copying, moving, removing, etc.
@@ -162,7 +162,7 @@ module Bundler::PubGrub
162
162
  def resolve_conflict(incompatibility)
163
163
  logger.info { "conflict: #{incompatibility}" }
164
164
 
165
- new_incompatibility = false
165
+ new_incompatibility = nil
166
166
 
167
167
  while !incompatibility.failure?
168
168
  most_recent_term = nil
@@ -204,7 +204,7 @@ module Bundler::PubGrub
204
204
  solution.backtrack(previous_level)
205
205
 
206
206
  if new_incompatibility
207
- add_incompatibility(incompatibility)
207
+ add_incompatibility(new_incompatibility)
208
208
  end
209
209
 
210
210
  return incompatibility
@@ -219,9 +219,14 @@ module Bundler::PubGrub
219
219
  new_terms << difference.invert
220
220
  end
221
221
 
222
- incompatibility = Incompatibility.new(new_terms, cause: Incompatibility::ConflictCause.new(incompatibility, most_recent_satisfier.cause))
222
+ new_incompatibility = Incompatibility.new(new_terms, cause: Incompatibility::ConflictCause.new(incompatibility, most_recent_satisfier.cause))
223
223
 
224
- new_incompatibility = true
224
+ if incompatibility.to_s == new_incompatibility.to_s
225
+ logger.info { "!! failed to resolve conflicts, this shouldn't have happened" }
226
+ break
227
+ end
228
+
229
+ incompatibility = new_incompatibility
225
230
 
226
231
  partially = difference ? " partially" : ""
227
232
  logger.info { "! #{most_recent_term} is#{partially} satisfied by #{most_recent_satisfier.term}" }
@@ -497,8 +497,8 @@ module Bundler::URI
497
497
  ret = {}
498
498
 
499
499
  # for Bundler::URI::split
500
- ret[:ABS_URI] = Regexp.new('\A\s*' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED)
501
- ret[:REL_URI] = Regexp.new('\A\s*' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED)
500
+ ret[:ABS_URI] = Regexp.new('\A\s*+' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED)
501
+ ret[:REL_URI] = Regexp.new('\A\s*+' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED)
502
502
 
503
503
  # for Bundler::URI::extract
504
504
  ret[:URI_REF] = Regexp.new(pattern[:URI_REF])
@@ -100,7 +100,7 @@ module Bundler::URI
100
100
  QUERY: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*\z/,
101
101
  FRAGMENT: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*\z/,
102
102
  OPAQUE: /\A(?:[^\/].*)?\z/,
103
- PORT: /\A[\x09\x0a\x0c\x0d ]*\d*[\x09\x0a\x0c\x0d ]*\z/,
103
+ PORT: /\A[\x09\x0a\x0c\x0d ]*+\d*[\x09\x0a\x0c\x0d ]*\z/,
104
104
  }
105
105
  end
106
106
 
@@ -1,6 +1,6 @@
1
1
  module Bundler::URI
2
2
  # :stopdoc:
3
- VERSION_CODE = '001201'.freeze
3
+ VERSION_CODE = '001202'.freeze
4
4
  VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
5
5
  # :startdoc:
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.12".freeze
4
+ VERSION = "2.4.19".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/bundler.rb CHANGED
@@ -39,16 +39,6 @@ module Bundler
39
39
  environment_preserver.replace_with_backup
40
40
  SUDO_MUTEX = Thread::Mutex.new
41
41
 
42
- SAFE_MARSHAL_CLASSES = [Symbol, TrueClass, String, Array, Hash, Gem::Version, Gem::Specification].freeze
43
- SAFE_MARSHAL_ERROR = "Unexpected class %s present in marshaled data. Only %s are allowed."
44
- SAFE_MARSHAL_PROC = proc do |object|
45
- object.tap do
46
- unless SAFE_MARSHAL_CLASSES.include?(object.class)
47
- raise TypeError, format(SAFE_MARSHAL_ERROR, object.class, SAFE_MARSHAL_CLASSES.join(", "))
48
- end
49
- end
50
- end
51
-
52
42
  autoload :Definition, File.expand_path("bundler/definition", __dir__)
53
43
  autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
54
44
  autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
@@ -86,6 +76,7 @@ module Bundler
86
76
  autoload :UI, File.expand_path("bundler/ui", __dir__)
87
77
  autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
88
78
  autoload :URINormalizer, File.expand_path("bundler/uri_normalizer", __dir__)
79
+ autoload :SafeMarshal, File.expand_path("bundler/safe_marshal", __dir__)
89
80
 
90
81
  class << self
91
82
  def configure
@@ -219,9 +210,10 @@ module Bundler
219
210
  end
220
211
 
221
212
  def frozen_bundle?
222
- frozen = settings[:deployment]
223
- frozen ||= settings[:frozen]
224
- frozen
213
+ frozen = settings[:frozen]
214
+ return frozen unless frozen.nil?
215
+
216
+ settings[:deployment]
225
217
  end
226
218
 
227
219
  def locked_gems
@@ -523,7 +515,7 @@ EOF
523
515
  end
524
516
 
525
517
  def safe_load_marshal(data)
526
- load_marshal(data, :marshal_proc => SAFE_MARSHAL_PROC)
518
+ load_marshal(data, :marshal_proc => SafeMarshal.proc)
527
519
  end
528
520
 
529
521
  def load_gemspec(file, validate = false)
@@ -532,7 +524,7 @@ EOF
532
524
  @gemspec_cache[key] ||= load_gemspec_uncached(file, validate)
533
525
  # Protect against caching side-effected gemspecs by returning a
534
526
  # new instance each time.
535
- @gemspec_cache[key].dup if @gemspec_cache[key]
527
+ @gemspec_cache[key]&.dup
536
528
  end
537
529
 
538
530
  def load_gemspec_uncached(file, validate = false)
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.12
4
+ version: 2.4.19
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-04-11 00:00:00.000000000 Z
25
+ date: 2023-08-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
@@ -203,6 +203,7 @@ files:
203
203
  - lib/bundler/rubygems_gem_installer.rb
204
204
  - lib/bundler/rubygems_integration.rb
205
205
  - lib/bundler/runtime.rb
206
+ - lib/bundler/safe_marshal.rb
206
207
  - lib/bundler/self_manager.rb
207
208
  - lib/bundler/settings.rb
208
209
  - lib/bundler/settings/validator.rb
@@ -380,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
380
381
  - !ruby/object:Gem::Version
381
382
  version: 3.0.1
382
383
  requirements: []
383
- rubygems_version: 3.4.12
384
+ rubygems_version: 3.4.19
384
385
  signing_key:
385
386
  specification_version: 4
386
387
  summary: The best way to manage your application's dependencies