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

ruby-changes:49942

From: nobu <ko1@a...>
Date: Fri, 26 Jan 2018 22:38:06 +0900 (JST)
Subject: [ruby-changes:49942] nobu:r62060 (trunk): vcs.rb: old version cannot refine modules

nobu	2018-01-26 22:38:00 +0900 (Fri, 26 Jan 2018)

  New Revision: 62060

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

  Log:
    vcs.rb: old version cannot refine modules

  Modified files:
    trunk/tool/vcs.rb
Index: tool/vcs.rb
===================================================================
--- tool/vcs.rb	(revision 62059)
+++ tool/vcs.rb	(revision 62060)
@@ -86,18 +86,21 @@ 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
   using DebugPOpen
+  module DebugSystem
+    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
+  module Kernel
+    prepend(DebugSystem)
+  end
 end
 
 class VCS

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

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