Merge pull request #46009 from johnnyshields/bundler-use-windows-platform

Bundler should use platform :windows instead of :mingw, etc.
This commit is contained in:
Rafael Mendonça França 2022-09-14 22:35:59 -04:00 committed by GitHub
commit e6d4ac0e50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 8 deletions

View File

@ -128,7 +128,7 @@ group :test do
gem "benchmark-ips"
end
platforms :ruby, :mswin, :mswin64, :mingw, :x64_mingw do
platforms :ruby, :windows do
gem "nokogiri", ">= 1.8.1", "!= 1.11.0"
# Needed for compiling the ActionDispatch::Journey parser.
@ -173,8 +173,8 @@ if ENV["ORACLE_ENHANCED"]
gem "activerecord-oracle_enhanced-adapter", github: "rsim/oracle-enhanced", branch: "master"
end
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "wdm", ">= 0.1.0", platforms: [:mingw, :mswin, :x64_mingw, :mswin64]
gem "tzinfo-data", platforms: [:windows, :jruby]
gem "wdm", ">= 0.1.0", platforms: [:windows]
# The error_highlight gem only works on CRuby 3.1 or later.
# Also, Rails depends on a new API available since error_highlight 0.4.0.

View File

@ -631,4 +631,4 @@ DEPENDENCIES
websocket-client-simple!
BUNDLED WITH
2.3.17
2.3.22

View File

@ -479,6 +479,10 @@ module Rails
!(options[:skip_bundle] || options[:pretend])
end
def bundler_windows_platforms
Gem.rubygems_version >= Gem::Version.new("3.3.22") ? "windows" : "mswin mswin64 mingw x64_mingw"
end
def depends_on_system_test?
!(options[:skip_system_test] || options[:skip_test] || options[:api])
end

View File

@ -16,7 +16,7 @@ ruby <%= "\"#{Gem.ruby_version}\"" -%>
<% end -%>
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
gem "tzinfo-data", platforms: %i[ <%= bundler_windows_platforms %> jruby ]
<% if depend_on_bootsnap? -%>
# Reduces boot times through caching; required in config/boot.rb
@ -41,7 +41,7 @@ gem "bootsnap", require: false
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
gem "debug", platforms: %i[ mri <%= bundler_windows_platforms %> ]
end
<% end -%>

View File

@ -13,7 +13,7 @@ gemspec
# Start debugger with binding.b [https://github.com/ruby/debug]
# gem "debug", ">= 1.0.0"
<% end -%>
<% if RUBY_PLATFORM.match?(/bccwin|cygwin|emx|mingw|mswin|wince|java/) -%>
<% if RUBY_PLATFORM.match?(/mingw|mswin|java/) -%>
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
gem "tzinfo-data", platforms: %i[ <%= bundler_windows_platforms %> jruby ]
<% end -%>

View File

@ -92,6 +92,7 @@ module GeneratorsTestHelper
depends_on_system_test: false,
options: ActiveSupport::OrderedOptions.new,
skip_sprockets: false,
bundler_windows_platforms: "windows",
}
end
end