Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate JRuby changes #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/resolv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,14 @@ class ResolvError < StandardError; end

class ResolvTimeout < Timeout::Error; end

WINDOWS = /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM || ::RbConfig::CONFIG['host_os'] =~ /mswin/
private_constant :WINDOWS

##
# Resolv::Hosts is a hostname resolver that uses the system hosts file.

class Hosts
if /mswin|mingw|cygwin/ =~ RUBY_PLATFORM and
if WINDOWS
begin
require 'win32/resolv'
DefaultFileName = Win32::Resolv.get_hosts_path || IO::NULL
Expand Down Expand Up @@ -994,7 +997,7 @@ def Config.default_config_hash(filename="/etc/resolv.conf")
if File.exist? filename
config_hash = Config.parse_resolv_conf(filename)
else
if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
if WINDOWS
require 'win32/resolv'
search, nameserver = Win32::Resolv.get_resolv_info
config_hash = {}
Expand Down
Loading