Skip to content

Commit 25414cc

Browse files
nobuhsbt
authored andcommitted
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 524419d commit 25414cc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/fileutils.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,12 +1145,11 @@ def touch(list, noop: nil, verbose: nil, mtime: nil, nocreate: nil)
11451145
module StreamUtils_
11461146
private
11471147

1148-
def fu_windows?
1149-
if defined?(RbConfig)
1150-
/mswin|mingw|bccwin|emx/ =~ RbConfig::CONFIG['host_os']
1151-
else
1152-
/mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
1153-
end
1148+
case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
1149+
when /mswin|mingw/
1150+
def fu_windows?; true end
1151+
else
1152+
def fu_windows?; false end
11541153
end
11551154

11561155
def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:

0 commit comments

Comments
 (0)