($B:FAw(B) Cygwin $B$G(B Resolv.getaddress $B$,<:GT$9$k(B

e$B$3$s$K$A$O!#LxED$G$9!#e(B

e$B0JA0!“e(B
[ruby-dev:29945] Cygwin e$B$Ge(B Resolv.getaddress e$B$,<:GT$9$ke(B
e$B$H$$$&$N$rJs9p$7$^$7$?$,!”$=$N8e!“FC$K%j%”%/%7%g%s$,$J$+$C$?$N$G!"e(B
e$B$b$&0lEY%a!<%k$r=P$7$F$_$^$9!#e(B
(1.8.6 e$B$G$be(B ruby_1_8 branch
[email protected],$G$b!"LdBj$O0JA0$HF1MM$G$9e(B)

e$B2<$N$h$&$JJQ99$G!"<j85$G$OLdBj$O2r7h$7$F$$$^$9!#e(B

Index: lib/resolv.rb

— lib/resolv.rb (e$B%j%S%8%g%se(B 15811)
+++ lib/resolv.rb (e$B:n6H%3%T!<e(B)
@@ -162,7 +162,7 @@
class Hosts
if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
require ‘win32/resolv’

  •  DefaultFileName = Win32::Resolv.get_hosts_path
    
  •  DefaultFileName = /cygwin/ =~ RUBY_PLATFORM ? '/etc/hosts' : 
    

Win32::Resolv.get_hosts_path
else
DefaultFileName = ‘/etc/hosts’
end

e$B$3$s$P$s$O!"?"ED$H?=$7$^$9!#e(B

e$B$3$s$K$A$O!#LxED$G$9!#e(B
;

— lib/resolv.rb (e$B%j%S%8%g%se(B 15811)
+++ lib/resolv.rb (e$B:n6H%3%T!<e(B)
@@ -162,7 +162,7 @@
class Hosts
if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
require ‘win32/resolv’

  •  DefaultFileName = Win32::Resolv.get_hosts_path
    
  •  DefaultFileName = /cygwin/ =~ RUBY_PLATFORM ? '/etc/hosts' : Win32::Resolv.get_hosts_path
    

cygwin
e$B4D6-$O;H$C$F$J$$$N$G$4;XE&$NLdBj$KAx6x$7$?$3$H$,L5$$$N$G$9$,!“e(B
win32/resolv.rb e$B$Ne(B Win32::Resolv.get_hosts_path
e$B$r0J2<$N$h$&$KD>$9e(B
e$B<j$b$”$j$=$&$G$9!#e(B

def self.get_hosts_path
  if /cygwin/ =~ RUBY_PLATFORM
    path = '/etc/hosts'
  else
    path = get_hosts_dir
    path = File.join(path.gsub(/\\/, File::SEPARATOR), 'hosts')
  end
  File.exist?(path) ? path : nil
end

diff e$BI=5-$8$c$J$/$F$9$$$^$;$s!#e(B

e$B$I$s$J$b$s$G$7$g$&$+!)e(B

e$BLxED$G$9!#e(B

cygwin e$B4D6-$O;H$C$F$J$$$N$G$4;XE&$NLdBj$KAx6x$7$?$3$H$,L5$$$N$G$9$,!“e(B
win32/resolv.rb e$B$Ne(B Win32::Resolv.get_hosts_path e$B$r0J2<$N$h$&$KD>$9e(B
e$B<j$b$”$j$=$&$G$9!#e(B

e$B$"$!$J$k$[$I!#e(B

e$B3N$+$K$*$C$7$c$kDL$j!"e(BWin32::Resolv.get_hosts_path
e$B$,2u$l$F$$$k$N$,LdBj$J$N$G!"e(B
e$B$=$A$i$NJ}$rD>$9$Y$-$G$7$g$&$M!#e(B

e$B?"ED$G$9!#e(B

e$B!!e(BWindows e$B4D6-$Ge(B ruby_1_8 e$B$re(B svn co e$B$7$?$i!“e(BPC
e$B$,$*$+$7$/$J$C$F$7$^$$$^e(B
e$B$7$?e(B ^^;)e$B!#$”$-$i$a$F2q<R$N4D6-e(B(CentOS)e$B$Ke(B svn co
e$B$7$F$_$^$7$?!#e(B

e$BLxED$G$9!#e(B
;
e$B3N$+$K$*$C$7$c$kDL$j!"e(BWin32::Resolv.get_hosts_path e$B$,2u$l$F$$$k$N$,LdBj$J$N$G!"e(B
e$B$=$A$i$NJ}$rD>$9$Y$-$G$7$g$&$M!#e(B

e$B$H$$$&$3$H$G$3$s$J46$8$G$7$g$&$+!)e(B ruby_1_8 e$B$G$N:9J,$G$9!#e(B

$ /opt/CollabNet_Subversion/bin/svn diff
Index: resolv.rb

— resolv.rb (revision 15813)
+++ resolv.rb (working copy)
@@ -10,8 +10,12 @@
API = Registry::API

 def self.get_hosts_path
  •  path = get_hosts_dir
    
  •  path = File.join(path.gsub(/\\/, File::SEPARATOR), 'hosts')
    
  •  if /cygwin/ =~ RUBY_PLATFORM
    
  •    path = '/etc/hosts'
    
  •  else
    
  •    path = get_hosts_dir
    
  •    path = File.join(path.gsub(/\\/, File::SEPARATOR), 'hosts')
    
  •  end
     File.exist?(path) ? path : nil
    
    end

e$B$b$C$H$-$l$$$K=q$1$k$H;W$$$^$9$,!"$H$j$"$($:$?$?$-Bf$H$$$&$3$H$G!#e(B

[email protected]$G$9!#e(B

At Thu, 20 Mar 2008 22:34:36 +0900,
e$B?"EDe(B e$BM5G7e(B wrote in [ruby-dev:34098]:

e$BLxED$G$9!#e(B
;
e$B3N$+$K$*$C$7$c$kDL$j!"e(BWin32::Resolv.get_hosts_path e$B$,2u$l$F$$$k$N$,LdBj$J$N$G!"e(B
e$B$=$A$i$NJ}$rD>$9$Y$-$G$7$g$&$M!#e(B

e$B$H$$$&$3$H$G$3$s$J46$8$G$7$g$&$+!)e(B ruby_1_8 e$B$G$N:9J,$G$9!#e(B

e$B$I$A$i$+$H$$$&$H!"e(Bcygwine$B$Ge(Bwin32/resolv.rbe$B$r;H$C$F$$$k$3$H$,5?Lde(B
e$B$G$9!#e(B

Index: lib/resolv.rb

— lib/resolv.rb (revision 15813)
+++ lib/resolv.rb (working copy)
@@ -161,5 +161,5 @@ class Resolv

class Hosts

  • if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
  • if /mswin32|mingw|bccwin/ =~ RUBY_PLATFORM
    require ‘win32/resolv’
    DefaultFileName = Win32::Resolv.get_hosts_path
    Index: ext/dl/win32/lib/win32/registry.rb
    ===================================================================
    — ext/dl/win32/lib/win32/registry.rb (revision 15813)
    +++ ext/dl/win32/lib/win32/registry.rb (working copy)
    @@ -494,5 +494,5 @@ module Win32

    def self.expand_environ(str)
  •  str.gsub(/%([^%]+)%/) { ENV[$1] || $& }
    
  •  str.gsub(/%([^%]+)%/) { ENV[$1] || ENV[$1.upcase] || $& }
    
    end

Index: ext/dl/win32/lib/win32/resolv.rb

— ext/dl/win32/lib/win32/resolv.rb (revision 15813)
+++ ext/dl/win32/lib/win32/resolv.rb (working copy)
@@ -12,5 +12,5 @@ module Win32
def self.get_hosts_path
path = get_hosts_dir

  •  path = File.join(path.gsub(/\\/, File::SEPARATOR), 'hosts')
    
  •  path = File.expand_path('hosts', path)
     File.exist?(path) ? path : nil
    
    end

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:34099] Re: (e$B:FAwe(B) Cygwin e$B$Ge(B
Resolv.getaddress e$B$,<:GT$9$ke(B”
on Mar.20,2008 23:45:09, [email protected] wrote:
| e$B$I$A$i$+$H$$$&$H!"e(Bcygwine$B$Ge(Bwin32/resolv.rbe$B$r;H$C$F$$$k$3$H$,5?Lde(B
| e$B$G$9!#e(B

e$B;d$bF146$G$9!#e(B

e$B$G!"[email protected]$5$s$N%Q%C%A$G$9$,!"e(Bwin32/registry.rbe$B$NE[$O!"e(Bupcase
[email protected]$1$G$$$$$b$s$J$s$G$7$g$&$+e(B?

cygwine$B$,e(BWindowse$B$N4D6-JQ?t$r;}$C$F$$$/;~$KBgJ8;z2=$7$F$k$N$+e(B

e$B$Je(B?

e$B$=$l$G$$$$$J$i!"e(Bwin32/registry.rb(e$B$He(Bwin32/resolv.rb)e$B$OF~$l$Fe(B
e$B$/[email protected]$5$$!#e(B
win32e$B$G$J$$e(Bresolv.rbe$B$K$D$$$F$O!"e(Bcygwine$B;H$C$F$k?M$NH=CG$K$*$^e(B
e$B$+$;$7$^$9!#e(B

e$B$=$l$G$O!#e(B

e$BLxED$G$9!#e(B

08/03/20 e$B$Ke(B Nobuyoshi N.[email protected]
e$B$5$s$O=q$-$^$7$?e(B:

e$B$I$A$i$+$H$$$&$H!"e(Bcygwine$B$Ge(Bwin32/resolv.rbe$B$r;H$C$F$$$k$3$H$,5?Lde(B
e$B$G$9!#e(B

[email protected]$H!":#EY$O<!$N$h$&$J%(%i!<$K$J$C$F$7$^$$$^$9!#e(B

irb(main):002:0> Resolv.getaddress(“www.ruby-lang.org”)
NameError: uninitialized constant Resolv::DNS::Config::Win32
from /usr/local/lib/ruby/1.8/resolv.rb:788:in
default_config_hash' from /usr/local/lib/ruby/1.8/resolv.rb:805:inlazy_initialize’
from /usr/local/lib/ruby/1.8/resolv.rb:798:in synchronize' from /usr/local/lib/ruby/1.8/resolv.rb:798:inlazy_initialize’
from /usr/local/lib/ruby/1.8/resolv.rb:332:in lazy_initialize' from /usr/local/lib/ruby/1.8/resolv.rb:330:insynchronize’
from /usr/local/lib/ruby/1.8/resolv.rb:330:in lazy_initialize' from /usr/local/lib/ruby/1.8/resolv.rb:489:ineach_resource’
from /usr/local/lib/ruby/1.8/resolv.rb:391:in each_address' from /usr/local/lib/ruby/1.8/resolv.rb:110:ineach_address’
from /usr/local/lib/ruby/1.8/resolv.rb:109:in each' from /usr/local/lib/ruby/1.8/resolv.rb:109:ineach_address’
from /usr/local/lib/ruby/1.8/resolv.rb:87:in getaddress' from /usr/local/lib/ruby/1.8/resolv.rb:38:ingetaddress’
from (irb):2
from /usr/local/lib/ruby/1.8/resolv.rb:1703

e$B$3$l$Oe(B Config.default_config_hash e$B$Ge(B Win32::Resolv
e$B$r;2>H$7$F$$$k$+$i$J$N$G$9$,!"e(B
e$B$3$3$Ne(B cygwin e$B%A%’%C%/$r$O$:$9$H:#EY$O<!$N$h$&$K$J$j$^$9!#e(B

% ruby -rresolv -e ‘p Resolv.getaddress(“www.ruby-lang.org”)’
/usr/local/lib/ruby/1.8/resolv.rb:819:in lazy_initialize': undefined methodinclude?’ for nil:NilClass (NoMethodError)
from /usr/local/lib/ruby/1.8/resolv.rb:798:in synchronize' from /usr/local/lib/ruby/1.8/resolv.rb:798:inlazy_initialize’
from /usr/local/lib/ruby/1.8/resolv.rb:332:in lazy_initialize' from /usr/local/lib/ruby/1.8/resolv.rb:330:insynchronize’
from /usr/local/lib/ruby/1.8/resolv.rb:330:in lazy_initialize' from /usr/local/lib/ruby/1.8/resolv.rb:489:ineach_resource’
from /usr/local/lib/ruby/1.8/resolv.rb:391:in each_address' from /usr/local/lib/ruby/1.8/resolv.rb:110:ineach_address’
from /usr/local/lib/ruby/1.8/resolv.rb:109:in each' from /usr/local/lib/ruby/1.8/resolv.rb:109:ineach_address’
from /usr/local/lib/ruby/1.8/resolv.rb:87:in getaddress' from /usr/local/lib/ruby/1.8/resolv.rb:38:ingetaddress’
from -e:1

e$B$3$l$O!"e(BCygwin e$B$G$Oe(B(e$B%G%U%)%k%H$G$Oe(B) /etc/resolv.conf
e$B$,B8:_$7$J$$$?$a$K5/$3$k$h$&$G$9!#e(B

Cygwin e$B$G$O!"FC$K<+J,$G:[email protected]$7$F$$$J$1$l$Pe(B

  • /etc/hosts e$B$OB8:_$9$ke(B (C:\WINDOWS\system32\drivers\etc\hosts
    e$B$X$N%7%s%%j%C%/%j%s%/$K$J$C$F$$$ke(B)
  • /etc/resolv.conf e$B$OB8:_$7$J$$e(B (e$B%M%C%H%o!<%/@_Dj$Oe(B Windows
    e$B$N$b$N$,;H$o$l$F$$$k$h$&$G$9e(B)
    e$B$H$$$&$3$H$N$h$&$G$9!#e(B

e$B$3$l$O!"<+J,$Ge(B /etc/resolv.conf
e$B$r:[email protected]$9$k$N$,6Z$J$N$G$7$g$&$+!#e(B

e$BLxED$G$9!#e(B

08/03/26 e$B$Ke(B Nobuyoshi N.[email protected]
e$B$5$s$O=q$-$^$7$?e(B:

Win32::Resolve$B$r;H$&$H$3$m$Ge(B require ‘win32/resolv’ e$B$9$k$N$,$$$$e(B
e$B$s$8$c$J$$$G$7$g$&$+!#e(B

e$B$3$l$rE,MQ$7$?7k2L!“JL$N%(%i!<$K$J$C$?$N$G$9$,e(B
e$B:#EY$N%(%i!<$Oe(B Cygwin
e$B0J30$G$b5/$3$k$h$&$J$N$G!”%a!<%k$r2~$a$FJs9p$7$^$9!#e(B

e$B$"$j$,$H$&$4$6$$$^$7$?!#e(B

[email protected]$G$9!#e(B

At Wed, 26 Mar 2008 13:38:34 +0900,
Kouhei Y. wrote in [ruby-dev:34138]:

Cygwin e$B$G$O!"FC$K<+J,$G:[email protected]$7$F$$$J$1$l$Pe(B

  • /etc/hosts e$B$OB8:_$9$ke(B (C:\WINDOWS\system32\drivers\etc\hosts e$B$X$N%7%s%%j%C%/%j%s%/$K$J$C$F$$$ke(B)
  • /etc/resolv.conf e$B$OB8:_$7$J$$e(B (e$B%M%C%H%o!<%/@_Dj$Oe(B Windows e$B$N$b$N$,;H$o$l$F$$$k$h$&$G$9e(B)
    e$B$H$$$&$3$H$N$h$&$G$9!#e(B

Win32::Resolve$B$r;H$&$H$3$m$Ge(B require ‘win32/resolv’
e$B$9$k$N$,$$$$e(B
e$B$s$8$c$J$$$G$7$g$&$+!#e(B

Index: lib/resolv.rb

— lib/resolv.rb (revision 15830)
+++ lib/resolv.rb (working copy)
@@ -778,4 +778,5 @@ class Resolv
else
if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM

  •        require 'win32/resolv'
           search, nameserver = Win32::Resolv.get_resolv_info
           config_hash = {}
    

Index: ext/dl/win32/lib/win32/registry.rb

— ext/dl/win32/lib/win32/registry.rb (revision 15830)
+++ ext/dl/win32/lib/win32/registry.rb (working copy)
@@ -338,7 +338,8 @@ module Win32
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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs