[前][次][番号順一覧][スレッド一覧]

ruby-changes:71010

From: Ngan <ko1@a...>
Date: Wed, 26 Jan 2022 02:24:45 +0900 (JST)
Subject: [ruby-changes:71010] 42ef3fcaef (master): [rubygems/rubygems] Use Gem::Platform.local instead of RUBY_PLATFORM

https://git.ruby-lang.org/ruby.git/commit/?id=42ef3fcaef

From 42ef3fcaef5e181d80393084b65af5a28a7b1a01 Mon Sep 17 00:00:00 2001
From: Ngan Pham <ngan@u...>
Date: Mon, 24 Jan 2022 21:01:21 -0800
Subject: [rubygems/rubygems] Use Gem::Platform.local instead of RUBY_PLATFORM

In certain places, we want to display the platform name with
`Gem::Platform.local` instead of `RUBY_PLATFORM`.

Fixes https://github.com/rubygems/rubygems/issues/5264

https://github.com/rubygems/rubygems/commit/bdd1848ae8
---
 lib/bundler/cli/platform.rb         | 2 +-
 lib/bundler/env.rb                  | 2 +-
 spec/bundler/other/platform_spec.rb | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/bundler/cli/platform.rb b/lib/bundler/cli/platform.rb
index e97cad49a4c..068c765aad4 100644
--- a/lib/bundler/cli/platform.rb
+++ b/lib/bundler/cli/platform.rb
@@ -23,7 +23,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/platform.rb#L23
           output << "No ruby version specified"
         end
       else
-        output << "Your platform is: #{RUBY_PLATFORM}"
+        output << "Your platform is: #{Gem::Platform.local}"
         output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
 
         if ruby_version
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 00d4ef21964..1763035a8a9 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -71,7 +71,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/env.rb#L71
     def self.ruby_version
       str = String.new(RUBY_VERSION)
       str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
-      str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
+      str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{Gem::Platform.local}]"
     end
 
     def self.git_version
diff --git a/spec/bundler/other/platform_spec.rb b/spec/bundler/other/platform_spec.rb
index 5693d6bce67..bf38a056465 100644
--- a/spec/bundler/other/platform_spec.rb
+++ b/spec/bundler/other/platform_spec.rb
@@ -17,7 +17,7 @@ RSpec.describe "bundle platform" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/platform_spec.rb#L17
 
       bundle "platform"
       expect(out).to eq(<<-G.chomp)
-Your platform is: #{RUBY_PLATFORM}
+Your platform is: #{Gem::Platform.local}
 
 Your app has gems that work on these platforms:
 #{bundle_platform_platforms_string}
@@ -40,7 +40,7 @@ G https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/platform_spec.rb#L40
 
       bundle "platform"
       expect(out).to eq(<<-G.chomp)
-Your platform is: #{RUBY_PLATFORM}
+Your platform is: #{Gem::Platform.local}
 
 Your app has gems that work on these platforms:
 #{bundle_platform_platforms_string}
@@ -61,7 +61,7 @@ G https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/platform_spec.rb#L61
 
       bundle "platform"
       expect(out).to eq(<<-G.chomp)
-Your platform is: #{RUBY_PLATFORM}
+Your platform is: #{Gem::Platform.local}
 
 Your app has gems that work on these platforms:
 #{bundle_platform_platforms_string}
@@ -81,7 +81,7 @@ G https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/platform_spec.rb#L81
 
       bundle "platform"
       expect(out).to eq(<<-G.chomp)
-Your platform is: #{RUBY_PLATFORM}
+Your platform is: #{Gem::Platform.local}
 
 Your app has gems that work on these platforms:
 #{bundle_platform_platforms_string}
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]