diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-19 00:22:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-19 00:22:39 +0000 |
commit | 36b183ce8c80eb46942c2078fc016a4204f28889 (patch) | |
tree | d6fe36aea8bc4eb57dbe41250d6cb88bbcdd6661 /lib | |
parent | f633d282a48f20e7cf8c87d66469b15e3bed8f9e (diff) |
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
Diffstat (limited to 'lib')
-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: |