aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
authorjohnnyshields <johnny.shields@gmail.com>2023-02-18 22:46:35 +0900
committergit <svn-admin@ruby-lang.org>2023-03-03 09:50:29 +0000
commit79ede4ae9911fdb180406b1a8adc7ee02e187a50 (patch)
tree6599a55817081ad1180902023daaf00cf1a49879 /lib/bundler
parent6b46057e5c9524e11c004a541bb17a5871767d44 (diff)
downloadruby-79ede4ae9911fdb180406b1a8adc7ee02e187a50.tar.gz
[rubygems/rubygems] Alias CurrentRuby#mswin?, mswin64?, mingw?, x64_mingw? to #windows?. (This is done instead of logging a deprecation warning.)
https://github.com/rubygems/rubygems/commit/b9fcc7c0ab
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/current_ruby.rb24
-rw-r--r--lib/bundler/dependency.rb3
-rw-r--r--lib/bundler/man/gemfile.58
-rw-r--r--lib/bundler/man/gemfile.5.ronn4
4 files changed, 18 insertions, 21 deletions
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
index f009b07ad7..7a5426748c 100644
--- a/lib/bundler/current_ruby.rb
+++ b/lib/bundler/current_ruby.rb
@@ -71,26 +71,10 @@ module Bundler
def windows?
Gem.win_platform?
end
-
- def mswin?
- # For backwards compatibility
- windows?
-
- # TODO: This should correctly be:
- # windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin32" && Bundler.local_platform.cpu == "x86"
- end
-
- def mswin64?
- windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
- end
-
- def mingw?
- windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
- end
-
- def x64_mingw?
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os.start_with?("mingw") && Bundler.local_platform.cpu == "x64"
- end
+ alias mswin? windows?
+ alias mswin64? windows?
+ alias mingw? windows?
+ alias x64_mingw? windows?
(KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
trimmed_version = version.tr(".", "")
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index 5f17943629..21a4564dcc 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -17,7 +17,8 @@ module Bundler
:truffleruby => [Gem::Platform::RUBY],
:jruby => [Gem::Platform::JAVA, [18, 19]],
:windows => [Gem::Platform::WINDOWS, ALL_RUBY_VERSIONS],
- :mswin => [Gem::Platform::MSWIN, ALL_RUBY_VERSIONS],
+ # deprecated
+ :mswin => [Gem::Platform::MSWIN, ALL_RUBY_VERSIONS],
:mswin64 => [Gem::Platform::MSWIN64, ALL_RUBY_VERSIONS - [18]],
:mingw => [Gem::Platform::MINGW, ALL_RUBY_VERSIONS],
:x64_mingw => [Gem::Platform::X64_MINGW, ALL_RUBY_VERSIONS - [18, 19]],
diff --git a/lib/bundler/man/gemfile.5 b/lib/bundler/man/gemfile.5
index a9124d26ea..8e56506c88 100644
--- a/lib/bundler/man/gemfile.5
+++ b/lib/bundler/man/gemfile.5
@@ -318,6 +318,14 @@ gem "nokogiri", platforms: [:windows_31, :jruby]
.P
All operations involving groups (\fBbundle install\fR \fIbundle\-install\.1\.html\fR, \fBBundler\.setup\fR, \fBBundler\.require\fR) behave exactly the same as if any groups not matching the current platform were explicitly excluded\.
.
+.P
+The following platform values are deprecated and should be replaced with \fBwindows\fR:
+.
+.IP "\(bu" 4
+\fBmswin\fR, \fBmswin64\fR, \fBmingw32\fR, \fBx64_mingw\fR
+.
+.IP "" 0
+.
.SS "FORCE_RUBY_PLATFORM"
If you always want the pure ruby variant of a gem to be chosen over platform specific variants, you can use the \fBforce_ruby_platform\fR option:
.
diff --git a/lib/bundler/man/gemfile.5.ronn b/lib/bundler/man/gemfile.5.ronn
index a3affc30cc..a5d2288b96 100644
--- a/lib/bundler/man/gemfile.5.ronn
+++ b/lib/bundler/man/gemfile.5.ronn
@@ -228,6 +228,10 @@ All operations involving groups ([`bundle install`](bundle-install.1.html), `Bun
`Bundler.require`) behave exactly the same as if any groups not
matching the current platform were explicitly excluded.
+The following platform values are deprecated and should be replaced with `windows`:
+
+ * `mswin`, `mswin64`, `mingw32`, `x64_mingw`
+
### FORCE_RUBY_PLATFORM
If you always want the pure ruby variant of a gem to be chosen over platform