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

ruby-changes:51259

From: nobu <ko1@a...>
Date: Sat, 19 May 2018 09:22:45 +0900 (JST)
Subject: [ruby-changes:51259] nobu:r63465 (trunk): fileutils.rb: split fu_windows?

nobu	2018-05-19 09:22:39 +0900 (Sat, 19 May 2018)

  New Revision: 63465

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

  Log:
    fileutils.rb: split fu_windows?
    
    * lib/fileutils.rb (FileUtils::StreamUtils_#fu_windows?): select
      the method definition for each platforms, and dropped supports
      for deprecated platforms.

  Modified files:
    trunk/lib/fileutils.rb
Index: lib/fileutils.rb
===================================================================
--- lib/fileutils.rb	(revision 63464)
+++ lib/fileutils.rb	(revision 63465)
@@ -1145,12 +1145,11 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1145
   module StreamUtils_
     private
 
-    def fu_windows?
-      if defined?(RbConfig)
-        /mswin|mingw|bccwin|emx/ =~ RbConfig::CONFIG['host_os']
-      else
-        /mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
-      end
+    case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
+    when /mswin|mingw/
+      def fu_windows?; true end
+    else
+      def fu_windows?; false end
     end
 
     def fu_copy_stream0(src, dest, blksize = nil)   #:nodoc:

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

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