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

ruby-changes:61691

From: Nobuyoshi <ko1@a...>
Date: Fri, 12 Jun 2020 19:03:23 +0900 (JST)
Subject: [ruby-changes:61691] 510df47f5f (master): Revert "[ruby/fileutils] Make verbose output go to stdout instead of stderr"

https://git.ruby-lang.org/ruby.git/commit/?id=510df47f5f

From 510df47f5f7f83918d3aa00316c8a5b959d80d7c Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 12 Jun 2020 19:00:27 +0900
Subject: Revert "[ruby/fileutils] Make verbose output go to stdout instead of
 stderr"

This reverts commit 7cddb844e6d51f954c6669341b9cc656bd7d3492,
because the test of rake 13.0.1 is depending on the previous
behavior.

diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index fea954e..438f321 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1612,7 +1612,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1612
 
   def fu_output_message(msg)   #:nodoc:
     output = @fileutils_output if defined?(@fileutils_output)
-    output ||= $stdout
+    output ||= $stderr
     if defined?(@fileutils_label)
       msg = @fileutils_label + msg
     end
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index d785de4..f99d5f6 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -1722,16 +1722,16 @@ class TestFileUtils < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L1722
     o.extend(FileUtils)
     o.singleton_class.send(:public, :chdir)
     o.freeze
-    orig_stdout = $stdout
-    $stdout = StringIO.new
+    orig_stderr = $stderr
+    $stderr = StringIO.new
     o.chdir('.', verbose: true){}
-    $stdout.rewind
-    assert_equal(<<-END, $stdout.read)
+    $stderr.rewind
+    assert_equal(<<-END, $stderr.read)
 cd .
 cd -
     END
   ensure
-    $stdout = orig_stdout if orig_stdout
+    $stderr = orig_stderr if orig_stderr
   end
 
   def test_getwd
-- 
cgit v0.10.2


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

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