ruby-changes:61690
From: Jeremy <ko1@a...>
Date: Fri, 12 Jun 2020 18:46:29 +0900 (JST)
Subject: [ruby-changes:61690] 7cddb844e6 (master): [ruby/fileutils] Make verbose output go to stdout instead of stderr
https://git.ruby-lang.org/ruby.git/commit/?id=7cddb844e6 From 7cddb844e6d51f954c6669341b9cc656bd7d3492 Mon Sep 17 00:00:00 2001 From: Jeremy Evans <code@j...> Date: Mon, 9 Mar 2020 09:42:40 -0700 Subject: [ruby/fileutils] Make verbose output go to stdout instead of stderr Verbose output is not error output, and should be sent to stdout and not stderr. Fixes Ruby bug 4436 https://github.com/ruby/fileutils/commit/563a383025 diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 64f3ae6..56b0c1a 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1615,7 +1615,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1615 def fu_output_message(msg) #:nodoc: output = @fileutils_output if defined?(@fileutils_output) - output ||= $stderr + output ||= $stdout if defined?(@fileutils_label) msg = @fileutils_label + msg end diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 4951ca4..e9a21be 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -1720,16 +1720,16 @@ class TestFileUtils < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L1720 o.extend(FileUtils) o.singleton_class.send(:public, :chdir) o.freeze - orig_stderr = $stderr - $stderr = StringIO.new + orig_stdout = $stdout + $stdout = StringIO.new o.chdir('.', verbose: true){} - $stderr.rewind - assert_equal(<<-END, $stderr.read) + $stdout.rewind + assert_equal(<<-END, $stdout.read) cd . cd - END ensure - $stderr = orig_stderr if orig_stderr + $stdout = orig_stdout if orig_stdout end def test_getwd -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/