Get rid of LoadError with $DEBUG
This commit is contained in:
parent
af07e07ac9
commit
cd372f8db2
@ -166,13 +166,14 @@ class Resolv
|
||||
# Resolv::Hosts is a hostname resolver that uses the system hosts file.
|
||||
|
||||
class Hosts
|
||||
if /mswin|mingw|cygwin/ =~ RUBY_PLATFORM and
|
||||
begin
|
||||
raise LoadError unless /mswin|mingw|cygwin/ =~ RUBY_PLATFORM
|
||||
require 'win32/resolv'
|
||||
DefaultFileName = Win32::Resolv.get_hosts_path || IO::NULL
|
||||
rescue LoadError
|
||||
DefaultFileName = '/etc/hosts'
|
||||
end
|
||||
end
|
||||
DefaultFileName ||= '/etc/hosts'
|
||||
|
||||
##
|
||||
# Creates a new Resolv::Hosts, using +filename+ for its data source.
|
||||
|
Loading…
x
Reference in New Issue
Block a user