mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/resolv.rb: Test Windows platform by detecting LoadError when
require 'win32/resolv' suggested by Nobuyoshi Nakada [ruby-core:53389]. [ruby-core:53388] [Feature #8090] Reported by Charles Nutter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
05f5cbeb75
commit
80466df690
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Mar 28 23:11:25 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/resolv.rb: Test Windows platform by detecting LoadError when
|
||||
require 'win32/resolv' suggested by Nobuyoshi Nakada [ruby-core:53389].
|
||||
[ruby-core:53388] [Feature #8090] Reported by Charles Nutter.
|
||||
|
||||
Thu Mar 28 23:10:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/io.h: rename SVR3,4 member names as POSIX compliants,
|
||||
|
|
|
@ -165,10 +165,10 @@ class Resolv
|
|||
# Resolv::Hosts is a hostname resolver that uses the system hosts file.
|
||||
|
||||
class Hosts
|
||||
if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM
|
||||
begin
|
||||
require 'win32/resolv'
|
||||
DefaultFileName = Win32::Resolv.get_hosts_path
|
||||
else
|
||||
rescue LoadError
|
||||
DefaultFileName = '/etc/hosts'
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue