1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/resolv.rb (Resolv::Config.default_config_hash): requires

win32/resolv to use Win32::Resolv.  [ruby-dev:34138]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-03-31 16:55:54 +00:00
parent 597179bb95
commit 29b538fa71
5 changed files with 21 additions and 10 deletions

View file

@ -1,3 +1,8 @@
Tue Apr 1 01:55:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/resolv.rb (Resolv::Config.default_config_hash): requires
win32/resolv to use Win32::Resolv. [ruby-dev:34138]
Tue Apr 1 01:40:58 2008 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c: adopted the ruby's style.

View file

@ -337,9 +337,10 @@ module Win32
FormatMessageA = Win32API.new('kernel32.dll', 'FormatMessageA', 'LPLLPLP', 'L')
def initialize(code)
@code = code
msg = "\0" * 1024
msg = "\0".force_encoding(Encoding::ASCII_8BIT) * 1024
len = FormatMessageA.call(0x1200, 0, code, 0, msg, 1024, 0)
super msg[0, len].tr("\r", '').chomp
msg = msg[0, len].force_encoding(Encoding.find(Encoding.locale_charmap))
super msg.tr("\r", '').chomp
end
attr_reader :code
end

View file

@ -82,10 +82,14 @@ if info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
reg.open(iface) do |regif|
begin
[ 'NameServer', 'DhcpNameServer' ].each do |key|
ns = regif.read_s(key)
unless ns.empty?
nameserver.concat(ns.split(/[,\s]\s*/))
break
begin
ns = regif.read_s(key)
rescue
else
unless ns.empty?
nameserver.concat(ns.split(/[,\s]\s*/))
break
end
end
end
rescue Registry::Error

View file

@ -777,6 +777,7 @@ class Resolv
config_hash = Config.parse_resolv_conf(filename)
else
if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
require 'win32/resolv'
search, nameserver = Win32::Resolv.get_resolv_info
config_hash = {}
config_hash[:nameserver] = nameserver if nameserver

View file

@ -1,15 +1,15 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2008-03-31"
#define RUBY_RELEASE_DATE "2008-04-01"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20080331
#define RUBY_RELEASE_CODE 20080401
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 3
#define RUBY_RELEASE_DAY 31
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 1
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];