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

ruby-changes:61723

From: David <ko1@a...>
Date: Mon, 15 Jun 2020 21:21:02 +0900 (JST)
Subject: [ruby-changes:61723] 2b4abcff90 (master): Deprecate `Gem::Util.silent_system`

https://git.ruby-lang.org/ruby.git/commit/?id=2b4abcff90

From 2b4abcff90a3c4c4d07e0929e1f99afbfeb57a4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Fri, 12 Jun 2020 11:37:38 +0200
Subject: Deprecate `Gem::Util.silent_system`

There's better tools for this job.

diff --git a/lib/rubygems/util.rb b/lib/rubygems/util.rb
index dcd7fc2..814a407 100644
--- a/lib/rubygems/util.rb
+++ b/lib/rubygems/util.rb
@@ -1,8 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/util.rb#L1
 # frozen_string_literal: true
+require 'rubygems/deprecate'
+
 ##
 # This module contains various utility methods as module methods.
 
 module Gem::Util
+
   ##
   # Zlib::GzipReader wrapper that unzips +data+.
 
@@ -67,6 +70,14 @@ module Gem::Util https://github.com/ruby/ruby/blob/trunk/lib/rubygems/util.rb#L70
     system(*(cmds << opt))
   end
 
+  class << self
+
+    extend Gem::Deprecate
+
+    rubygems_deprecate :silent_system
+
+  end
+
   ##
   # Enumerates the parents of +directory+.
 
diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb
index cf90350..5866aa7 100644
--- a/test/rubygems/test_gem_util.rb
+++ b/test/rubygems/test_gem_util.rb
@@ -15,8 +15,10 @@ class TestGemUtil < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_util.rb#L15
 
   def test_silent_system
     skip if Gem.java_platform?
-    assert_silent do
-      Gem::Util.silent_system(*ruby_with_rubygems_in_load_path, '-e', 'puts "hello"; warn "hello"')
+    Gem::Deprecate.skip_during do
+      assert_silent do
+        Gem::Util.silent_system(*ruby_with_rubygems_in_load_path, '-e', 'puts "hello"; warn "hello"')
+      end
     end
   end
 
-- 
cgit v0.10.2


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

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