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

ruby-changes:57533

From: Nobuyoshi <ko1@a...>
Date: Thu, 5 Sep 2019 08:33:01 +0900 (JST)
Subject: [ruby-changes:57533] 9f59d30daa (master): Separate VCS::DEBUG_OUT

https://git.ruby-lang.org/ruby.git/commit/?id=9f59d30daa

From 9f59d30daa0d2fba5c98a9b6148b935baaae67da Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 4 Sep 2019 23:54:41 +0900
Subject: Separate VCS::DEBUG_OUT


diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb
index 65eb774..d04ce28 100644
--- a/tool/lib/vcs.rb
+++ b/tool/lib/vcs.rb
@@ -7,6 +7,10 @@ require 'optparse' https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L7
 
 ENV.delete('PWD')
 
+class VCS
+  DEBUG_OUT = STDERR.dup
+end
+
 unless File.respond_to? :realpath
   require 'pathname'
   def File.realpath(arg)
@@ -15,7 +19,7 @@ unless File.respond_to? :realpath https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L19
 end
 
 def IO.pread(*args)
-  STDERR.puts(args.inspect) if $DEBUG
+  VCS::DEBUG_OUT.puts(args.inspect) if $DEBUG
   popen(*args) {|f|f.read}
 end
 
@@ -85,7 +89,7 @@ else https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L89
     verbose, $VERBOSE = $VERBOSE, nil if RUBY_VERSION < "2.1"
     refine IO.singleton_class do
       def popen(*args)
-        STDERR.puts args.inspect if $DEBUG
+        VCS::DEBUG_OUT.puts args.inspect if $DEBUG
         super
       end
     end
@@ -95,7 +99,7 @@ else https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L99
   using DebugPOpen
   module DebugSystem
     def system(*args)
-      STDERR.puts args.inspect if $DEBUG
+      VCS::DEBUG_OUT.puts args.inspect if $DEBUG
       exception = false
       opts = Hash.try_convert(args[-1])
       if RUBY_VERSION >= "2.6"
@@ -417,7 +421,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L421
     def commit
       args = %W"#{COMMAND} commit"
       if dryrun?
-        STDERR.puts(args.inspect)
+        VCS::DEBUG_OUT.puts(args.inspect)
         return true
       end
       system(*args)
@@ -434,7 +438,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L438
       if srcdir and self.class.local_path?(srcdir)
         opts[:chdir] ||= srcdir
       end
-      STDERR.puts cmds.inspect if debug?
+      VCS::DEBUG_OUT.puts cmds.inspect if debug?
       cmds
     end
 
@@ -649,7 +653,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L653
       branches = %W[refs/notes/commits:refs/notes/commits HEAD:#{branch}]
       if dryrun?
         branches.each do |b|
-          STDERR.puts((args + [b]).inspect)
+          VCS::DEBUG_OUT.puts((args + [b]).inspect)
         end
         return true
       end
-- 
cgit v0.10.2


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

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