bundler 2.6.5 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1172 -1024
  3. data/README.md +7 -7
  4. data/bundler.gemspec +2 -2
  5. data/lib/bundler/build_metadata.rb +10 -11
  6. data/lib/bundler/checksum.rb +22 -12
  7. data/lib/bundler/cli/common.rb +1 -1
  8. data/lib/bundler/cli/config.rb +2 -2
  9. data/lib/bundler/cli/doctor/diagnose.rb +167 -0
  10. data/lib/bundler/cli/doctor/ssl.rb +249 -0
  11. data/lib/bundler/cli/doctor.rb +27 -155
  12. data/lib/bundler/cli/gem.rb +62 -30
  13. data/lib/bundler/cli/inject.rb +2 -2
  14. data/lib/bundler/cli/install.rb +5 -5
  15. data/lib/bundler/cli/issue.rb +2 -2
  16. data/lib/bundler/cli/lock.rb +2 -1
  17. data/lib/bundler/cli/outdated.rb +1 -1
  18. data/lib/bundler/cli/update.rb +3 -3
  19. data/lib/bundler/cli.rb +26 -49
  20. data/lib/bundler/compact_index_client/cache.rb +1 -1
  21. data/lib/bundler/compact_index_client/parser.rb +1 -1
  22. data/lib/bundler/compact_index_client/updater.rb +2 -1
  23. data/lib/bundler/compact_index_client.rb +1 -5
  24. data/lib/bundler/current_ruby.rb +27 -3
  25. data/lib/bundler/definition.rb +184 -151
  26. data/lib/bundler/dependency.rb +1 -1
  27. data/lib/bundler/dsl.rb +35 -26
  28. data/lib/bundler/errors.rb +18 -0
  29. data/lib/bundler/feature_flag.rb +15 -12
  30. data/lib/bundler/fetcher/dependency.rb +2 -1
  31. data/lib/bundler/fetcher/downloader.rb +33 -7
  32. data/lib/bundler/fetcher.rb +49 -19
  33. data/lib/bundler/friendly_errors.rb +3 -2
  34. data/lib/bundler/index.rb +7 -2
  35. data/lib/bundler/injector.rb +9 -9
  36. data/lib/bundler/installer.rb +6 -5
  37. data/lib/bundler/lazy_specification.rb +38 -19
  38. data/lib/bundler/lockfile_parser.rb +29 -10
  39. data/lib/bundler/man/bundle-add.1 +1 -1
  40. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  41. data/lib/bundler/man/bundle-cache.1 +1 -1
  42. data/lib/bundler/man/bundle-check.1 +1 -1
  43. data/lib/bundler/man/bundle-clean.1 +1 -1
  44. data/lib/bundler/man/bundle-config.1 +175 -129
  45. data/lib/bundler/man/bundle-config.1.ronn +93 -88
  46. data/lib/bundler/man/bundle-console.1 +1 -1
  47. data/lib/bundler/man/bundle-doctor.1 +43 -4
  48. data/lib/bundler/man/bundle-doctor.1.ronn +48 -4
  49. data/lib/bundler/man/bundle-env.1 +1 -1
  50. data/lib/bundler/man/bundle-exec.1 +3 -3
  51. data/lib/bundler/man/bundle-exec.1.ronn +2 -2
  52. data/lib/bundler/man/bundle-fund.1 +1 -1
  53. data/lib/bundler/man/bundle-gem.1 +67 -44
  54. data/lib/bundler/man/bundle-gem.1.ronn +8 -4
  55. data/lib/bundler/man/bundle-help.1 +1 -1
  56. data/lib/bundler/man/bundle-info.1 +1 -1
  57. data/lib/bundler/man/bundle-init.1 +1 -1
  58. data/lib/bundler/man/bundle-inject.1 +2 -2
  59. data/lib/bundler/man/bundle-inject.1.ronn +1 -1
  60. data/lib/bundler/man/bundle-install.1 +4 -4
  61. data/lib/bundler/man/bundle-install.1.ronn +3 -4
  62. data/lib/bundler/man/bundle-issue.1 +1 -1
  63. data/lib/bundler/man/bundle-licenses.1 +1 -1
  64. data/lib/bundler/man/bundle-list.1 +1 -1
  65. data/lib/bundler/man/bundle-lock.1 +1 -1
  66. data/lib/bundler/man/bundle-open.1 +1 -1
  67. data/lib/bundler/man/bundle-outdated.1 +1 -1
  68. data/lib/bundler/man/bundle-platform.1 +1 -1
  69. data/lib/bundler/man/bundle-plugin.1 +1 -1
  70. data/lib/bundler/man/bundle-pristine.1 +1 -1
  71. data/lib/bundler/man/bundle-remove.1 +1 -1
  72. data/lib/bundler/man/bundle-show.1 +1 -1
  73. data/lib/bundler/man/bundle-update.1 +5 -5
  74. data/lib/bundler/man/bundle-update.1.ronn +4 -4
  75. data/lib/bundler/man/bundle-version.1 +1 -1
  76. data/lib/bundler/man/bundle-viz.1 +1 -1
  77. data/lib/bundler/man/bundle.1 +1 -1
  78. data/lib/bundler/man/gemfile.5 +1 -1
  79. data/lib/bundler/match_platform.rb +31 -12
  80. data/lib/bundler/materialization.rb +2 -2
  81. data/lib/bundler/plugin/api/source.rb +1 -1
  82. data/lib/bundler/plugin/index.rb +1 -1
  83. data/lib/bundler/plugin/installer/path.rb +8 -0
  84. data/lib/bundler/plugin.rb +1 -1
  85. data/lib/bundler/resolver/candidate.rb +12 -9
  86. data/lib/bundler/resolver/package.rb +1 -1
  87. data/lib/bundler/resolver/strategy.rb +40 -0
  88. data/lib/bundler/resolver.rb +18 -27
  89. data/lib/bundler/rubygems_ext.rb +131 -120
  90. data/lib/bundler/rubygems_integration.rb +11 -6
  91. data/lib/bundler/runtime.rb +9 -6
  92. data/lib/bundler/self_manager.rb +32 -42
  93. data/lib/bundler/settings/validator.rb +0 -23
  94. data/lib/bundler/settings.rb +4 -6
  95. data/lib/bundler/shared_helpers.rb +10 -4
  96. data/lib/bundler/source/gemspec.rb +1 -4
  97. data/lib/bundler/source/git/git_proxy.rb +17 -6
  98. data/lib/bundler/source/git.rb +5 -1
  99. data/lib/bundler/source/path.rb +9 -2
  100. data/lib/bundler/source/rubygems/remote.rb +11 -3
  101. data/lib/bundler/source_list.rb +30 -16
  102. data/lib/bundler/source_map.rb +1 -1
  103. data/lib/bundler/spec_set.rb +55 -16
  104. data/lib/bundler/templates/Executable +0 -11
  105. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -0
  106. data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -5
  107. data/lib/bundler/ui/shell.rb +2 -2
  108. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
  109. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  110. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
  111. data/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  112. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
  113. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +81 -42
  114. data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
  115. data/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
  116. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
  117. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
  118. data/lib/bundler/vendor/uri/lib/uri/common.rb +7 -3
  119. data/lib/bundler/vendor/uri/lib/uri/generic.rb +12 -11
  120. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +6 -6
  121. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  122. data/lib/bundler/version.rb +10 -2
  123. data/lib/bundler/worker.rb +1 -1
  124. data/lib/bundler.rb +14 -12
  125. metadata +9 -16
  126. data/lib/bundler/compact_index_client/gem_parser.rb +0 -32
  127. data/lib/bundler/gem_helpers.rb +0 -144
  128. data/lib/bundler/templates/Executable.bundler +0 -109
  129. data/lib/bundler/vendor/connection_pool/.document +0 -1
  130. data/lib/bundler/vendor/fileutils/.document +0 -1
  131. data/lib/bundler/vendor/net-http-persistent/.document +0 -1
  132. data/lib/bundler/vendor/pub_grub/.document +0 -1
  133. data/lib/bundler/vendor/securerandom/.document +0 -1
  134. data/lib/bundler/vendor/thor/.document +0 -1
  135. data/lib/bundler/vendor/tsort/.document +0 -1
  136. data/lib/bundler/vendor/uri/.document +0 -1
data/lib/bundler/cli.rb CHANGED
@@ -77,7 +77,7 @@ module Bundler
77
77
  self.options ||= {}
78
78
  unprinted_warnings = Bundler.ui.unprinted_warnings
79
79
  Bundler.ui = UI::Shell.new(options)
80
- Bundler.ui.level = "debug" if options["verbose"]
80
+ Bundler.ui.level = "debug" if options[:verbose] || Bundler.settings[:verbose]
81
81
  unprinted_warnings.each {|w| Bundler.ui.warn(w) }
82
82
  end
83
83
 
@@ -130,7 +130,7 @@ module Bundler
130
130
 
131
131
  if man_pages.include?(command)
132
132
  man_page = man_pages[command]
133
- if Bundler.which("man") && !man_path.match?(%r{^file:/.+!/META-INF/jruby.home/.+})
133
+ if Bundler.which("man") && !man_path.match?(%r{^(?:file:/.+!|uri:classloader:)/META-INF/jruby.home/.+})
134
134
  Kernel.exec("man", man_page)
135
135
  else
136
136
  puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
@@ -220,7 +220,7 @@ module Bundler
220
220
  method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
221
221
  method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
222
222
  method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
223
- method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
223
+ method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
224
224
  method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
225
225
  method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
226
226
  method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
@@ -232,15 +232,13 @@ module Bundler
232
232
  method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
233
233
  method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
234
234
  def install
235
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
236
-
237
235
  %w[clean deployment frozen no-prune path shebang without with].each do |option|
238
236
  remembered_flag_deprecation(option)
239
237
  end
240
238
 
241
239
  print_remembered_flag_deprecation("--system", "path.system", "true") if ARGV.include?("--system")
242
240
 
243
- remembered_negative_flag_deprecation("no-deployment")
241
+ remembered_flag_deprecation("deployment", negative: true)
244
242
 
245
243
  require_relative "cli/install"
246
244
  Bundler.settings.temporary(no_install: false) do
@@ -263,7 +261,7 @@ module Bundler
263
261
  method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
264
262
  method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
265
263
  method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
266
- method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
264
+ method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
267
265
  method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
268
266
  method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
269
267
  method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
@@ -274,7 +272,6 @@ module Bundler
274
272
  method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
275
273
  method_option "all", type: :boolean, banner: "Update everything."
276
274
  def update(*gems)
277
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
278
275
  require_relative "cli/update"
279
276
  Bundler.settings.temporary(no_install: false) do
280
277
  Update.new(options, gems).run
@@ -331,6 +328,8 @@ module Bundler
331
328
  method_option "all", type: :boolean, banner: "Install binstubs for all gems"
332
329
  method_option "all-platforms", type: :boolean, default: false, banner: "Install binstubs for all platforms"
333
330
  def binstubs(*gems)
331
+ remembered_flag_deprecation("path", option_name: "bin")
332
+
334
333
  require_relative "cli/binstubs"
335
334
  Binstubs.new(options, gems).run
336
335
  end
@@ -414,7 +413,7 @@ module Bundler
414
413
  def cache
415
414
  print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
416
415
 
417
- if ARGV.include?("--path")
416
+ if flag_passed?("--path")
418
417
  message =
419
418
  "The `--path` flag is deprecated because its semantics are unclear. " \
420
419
  "Use `bundle config cache_path` to configure the path of your cache of gems, " \
@@ -486,13 +485,13 @@ module Bundler
486
485
  def version
487
486
  cli_help = current_command.name == "cli_help"
488
487
  if cli_help || ARGV.include?("version")
489
- build_info = " (#{BuildMetadata.built_at} commit #{BuildMetadata.git_commit_sha})"
488
+ build_info = " (#{BuildMetadata.timestamp} commit #{BuildMetadata.git_commit_sha})"
490
489
  end
491
490
 
492
- if !cli_help && Bundler.feature_flag.print_only_version_number?
493
- Bundler.ui.info "#{Bundler::VERSION}#{build_info}"
491
+ if !cli_help && Bundler.feature_flag.bundler_4_mode?
492
+ Bundler.ui.info "#{Bundler.verbose_version}#{build_info}"
494
493
  else
495
- Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
494
+ Bundler.ui.info "Bundler version #{Bundler.verbose_version}#{build_info}"
496
495
  end
497
496
  end
498
497
 
@@ -512,7 +511,7 @@ module Bundler
512
511
  end
513
512
  end
514
513
 
515
- unless Bundler.feature_flag.bundler_3_mode?
514
+ unless Bundler.feature_flag.bundler_4_mode?
516
515
  desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
517
516
  long_desc <<-D
518
517
  Viz generates a PNG file of the current Gemfile as a dependency graph.
@@ -544,6 +543,7 @@ module Bundler
544
543
  method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
545
544
  method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
546
545
  method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
546
+ method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], desc: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
547
547
 
548
548
  def gem(name)
549
549
  require_relative "cli/gem"
@@ -610,17 +610,8 @@ module Bundler
610
610
  end
611
611
 
612
612
  desc "doctor [OPTIONS]", "Checks the bundle for common problems"
613
- long_desc <<-D
614
- Doctor scans the OS dependencies of each of the gems requested in the Gemfile. If
615
- missing dependencies are detected, Bundler prints them and exits status 1.
616
- Otherwise, Bundler prints a success message and exits with a status of 0.
617
- D
618
- method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
619
- method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
620
- def doctor
621
- require_relative "cli/doctor"
622
- Doctor.new(options).run
623
- end
613
+ require_relative "cli/doctor"
614
+ subcommand("doctor", Doctor)
624
615
 
625
616
  desc "issue", "Learn how to report an issue in Bundler"
626
617
  def issue
@@ -722,14 +713,9 @@ module Bundler
722
713
  command_name = cmd.name
723
714
  return if PARSEABLE_COMMANDS.include?(command_name)
724
715
  command = ["bundle", command_name] + args
725
- options_to_print = options.dup
726
- options_to_print.delete_if do |k, v|
727
- next unless o = cmd.options[k]
728
- o.default == v
729
- end
730
- command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
716
+ command << Thor::Options.to_switches(options.sort_by(&:first)).strip
731
717
  command.reject!(&:empty?)
732
- Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}"
718
+ Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler.verbose_version}"
733
719
  end
734
720
 
735
721
  def warn_on_outdated_bundler
@@ -756,30 +742,17 @@ module Bundler
756
742
  nil
757
743
  end
758
744
 
759
- def remembered_negative_flag_deprecation(name)
760
- positive_name = name.gsub(/\Ano-/, "")
761
- option = current_command.options[positive_name]
762
- flag_name = "--no-" + option.switch_name.gsub(/\A--/, "")
763
-
764
- flag_deprecation(positive_name, flag_name, option)
765
- end
766
-
767
- def remembered_flag_deprecation(name)
745
+ def remembered_flag_deprecation(name, negative: false, option_name: nil)
768
746
  option = current_command.options[name]
769
747
  flag_name = option.switch_name
770
-
771
- flag_deprecation(name, flag_name, option)
772
- end
773
-
774
- def flag_deprecation(name, flag_name, option)
775
- name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
776
- return unless name_index
748
+ flag_name = "--no-" + flag_name.gsub(/\A--/, "") if negative
749
+ return unless flag_passed?(flag_name)
777
750
 
778
751
  value = options[name]
779
752
  value = value.join(" ").to_s if option.type == :array
780
753
  value = "'#{value}'" unless option.type == :boolean
781
754
 
782
- print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
755
+ print_remembered_flag_deprecation(flag_name, option_name || name.tr("-", "_"), value)
783
756
  end
784
757
 
785
758
  def print_remembered_flag_deprecation(flag_name, option_name, option_value)
@@ -795,5 +768,9 @@ module Bundler
795
768
  "#{option_value}`, and stop using this flag"
796
769
  Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
797
770
  end
771
+
772
+ def flag_passed?(name)
773
+ ARGV.any? {|arg| name == arg.split("=")[0] }
774
+ end
798
775
  end
799
776
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "gem_parser"
3
+ require "rubygems/resolver/api_set/gem_parser"
4
4
 
5
5
  module Bundler
6
6
  class CompactIndexClient
@@ -64,7 +64,7 @@ module Bundler
64
64
  end
65
65
 
66
66
  def gem_parser
67
- @gem_parser ||= GemParser.new
67
+ @gem_parser ||= Gem::Resolver::APISet::GemParser.new
68
68
  end
69
69
 
70
70
  # This is mostly the same as `split(" ", 3)` but it avoids allocating extra objects.
@@ -37,7 +37,8 @@ module Bundler
37
37
  file.digests = parse_digests(response)
38
38
  # server may ignore Range and return the full response
39
39
  if response.is_a?(Gem::Net::HTTPPartialContent)
40
- break false unless file.append(response.body.byteslice(1..-1))
40
+ tail = response.body.byteslice(1..-1)
41
+ break false unless tail && file.append(tail)
41
42
  else
42
43
  file.write(response.body)
43
44
  end
@@ -28,11 +28,7 @@ module Bundler
28
28
  # It may be called concurrently without global interpreter lock in some Rubies.
29
29
  # As a result, some methods may look more complex than necessary to save memory or time.
30
30
  class CompactIndexClient
31
- # NOTE: MD5 is here not because we expect a server to respond with it, but
32
- # because we use it to generate the etag on first request during the upgrade
33
- # to the compact index client that uses opaque etags saved to files.
34
- # Remove once 2.5.0 has been out for a while.
35
- SUPPORTED_DIGESTS = { "sha-256" => :SHA256, "md5" => :MD5 }.freeze
31
+ SUPPORTED_DIGESTS = { "sha-256" => :SHA256 }.freeze
36
32
  DEBUG_MUTEX = Thread::Mutex.new
37
33
 
38
34
  # info returns an Array of INFO Arrays. Each INFO Array has the following indices:
@@ -32,7 +32,7 @@ module Bundler
32
32
  end.freeze
33
33
 
34
34
  def ruby?
35
- return true if Bundler::GemHelpers.generic_local_platform_is_ruby?
35
+ return true if Bundler::MatchPlatform.generic_local_platform_is_ruby?
36
36
 
37
37
  !windows? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
38
38
  end
@@ -50,6 +50,18 @@ module Bundler
50
50
  end
51
51
 
52
52
  def maglev?
53
+ message =
54
+ "`CurrentRuby#maglev?` is deprecated with no replacement. Please use the " \
55
+ "built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on."
56
+ removed_message =
57
+ "`CurrentRuby#maglev?` was removed with no replacement. Please use the " \
58
+ "built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on."
59
+ internally_exempted = caller_locations(1, 1).first.path == __FILE__
60
+
61
+ unless internally_exempted
62
+ SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
63
+ end
64
+
53
65
  RUBY_ENGINE == "maglev"
54
66
  end
55
67
 
@@ -71,12 +83,24 @@ module Bundler
71
83
  RUBY_VERSION.start_with?("#{version}.")
72
84
  end
73
85
 
74
- all_platforms = PLATFORM_MAP.keys << "maglev"
75
- all_platforms.each do |platform|
86
+ PLATFORM_MAP.keys.each do |platform|
76
87
  define_method(:"#{platform}_#{trimmed_version}?") do
77
88
  send(:"#{platform}?") && send(:"on_#{trimmed_version}?")
78
89
  end
79
90
  end
91
+
92
+ define_method(:"maglev_#{trimmed_version}?") do
93
+ message =
94
+ "`CurrentRuby##{__method__}` is deprecated with no replacement. Please use the " \
95
+ "built-in Ruby `RUBY_ENGINE` and `RUBY_VERSION` constants to perform a similar check."
96
+ removed_message =
97
+ "`CurrentRuby##{__method__}` was removed with no replacement. Please use the " \
98
+ "built-in Ruby `RUBY_ENGINE` and `RUBY_VERSION` constants to perform a similar check."
99
+
100
+ SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
101
+
102
+ send(:"maglev?") && send(:"on_#{trimmed_version}?")
103
+ end
80
104
  end
81
105
  end
82
106
  end