diff options
-rw-r--r-- | lib/fileutils.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb index e5c4086213..b209e74924 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1145,12 +1145,11 @@ module FileUtils 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: |