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

ruby-changes:49940

From: nobu <ko1@a...>
Date: Fri, 26 Jan 2018 22:28:04 +0900 (JST)
Subject: [ruby-changes:49940] nobu:r62058 (trunk): vcs.rb: debug print in system method

nobu	2018-01-26 22:27:56 +0900 (Fri, 26 Jan 2018)

  New Revision: 62058

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62058

  Log:
    vcs.rb: debug print in system method

  Modified files:
    trunk/tool/vcs.rb
Index: tool/vcs.rb
===================================================================
--- tool/vcs.rb	(revision 62057)
+++ tool/vcs.rb	(revision 62058)
@@ -86,6 +86,14 @@ else https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L86
         super
       end
     end
+    refine Kernel do
+      def system(*args, exception: true, **opts)
+        STDERR.puts [*args, **opts].inspect if $DEBUG
+        ret = super(*args, **opts, exception: exception)
+        raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
+        ret
+      end
+    end
   ensure
     $VERBOSE = verbose unless verbose.nil?
   end

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

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