[前][次][番号順一覧][スレッド一覧]

ruby-changes:27936

From: akr <ko1@a...>
Date: Thu, 28 Mar 2013 23:11:47 +0900 (JST)
Subject: [ruby-changes:27936] akr:r39988 (trunk): * lib/resolv.rb: Test Windows platform by detecting LoadError when

akr	2013-03-28 23:11:35 +0900 (Thu, 28 Mar 2013)

  New Revision: 39988

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39988

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/lib/resolv.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39987)
+++ ChangeLog	(revision 39988)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Mar 28 23:11:25 2013  Tanaka Akira  <akr@f...>
+
+	* 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@r...>
 
 	* include/ruby/io.h: rename SVR3,4 member names as POSIX compliants,
Index: lib/resolv.rb
===================================================================
--- lib/resolv.rb	(revision 39987)
+++ lib/resolv.rb	(revision 39988)
@@ -165,10 +165,10 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L165
   # 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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]