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

ruby-changes:10263

From: akr <ko1@a...>
Date: Tue, 27 Jan 2009 20:26:53 +0900 (JST)
Subject: [ruby-changes:10263] Ruby:r21807 (ruby_1_8): * lib/pathname.rb (Pathname#world_readable?): define only if

akr	2009-01-27 20:26:37 +0900 (Tue, 27 Jan 2009)

  New Revision: 21807

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

  Log:
    * lib/pathname.rb (Pathname#world_readable?): define only if
      FileTest.world_readable? is available.
      (Pathname#world_writable?): ditto.
      [ruby-core:21566]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/pathname.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 21806)
+++ ruby_1_8/ChangeLog	(revision 21807)
@@ -1,3 +1,10 @@
+Tue Jan 27 20:25:09 2009  Tanaka Akira  <akr@f...>
+
+	* lib/pathname.rb (Pathname#world_readable?): define only if
+	  FileTest.world_readable? is available.
+	  (Pathname#world_writable?): ditto.
+	  [ruby-core:21566]
+
 Mon Jan 26 18:03:52 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* eval.c (Init_Cont): separated from Init_Thread() since
Index: ruby_1_8/lib/pathname.rb
===================================================================
--- ruby_1_8/lib/pathname.rb	(revision 21806)
+++ ruby_1_8/lib/pathname.rb	(revision 21807)
@@ -889,8 +889,10 @@
   # See <tt>FileTest.readable?</tt>.
   def readable?() FileTest.readable?(@path) end
 
-  # See <tt>FileTest.world_readable?</tt>.
-  def world_readable?() FileTest.world_readable?(@path) end
+  if FileTest.respond_to? :world_readable?
+    # See <tt>FileTest.world_readable?</tt>.
+    def world_readable?() FileTest.world_readable?(@path) end
+  end
 
   # See <tt>FileTest.readable_real?</tt>.
   def readable_real?() FileTest.readable_real?(@path) end
@@ -916,8 +918,10 @@
   # See <tt>FileTest.writable?</tt>.
   def writable?() FileTest.writable?(@path) end
 
-  # See <tt>FileTest.world_writable?</tt>.
-  def world_writable?() FileTest.world_writable?(@path) end
+  if FileTest.respond_to? :world_writable?
+    # See <tt>FileTest.world_writable?</tt>.
+    def world_writable?() FileTest.world_writable?(@path) end
+  end
 
   # See <tt>FileTest.writable_real?</tt>.
   def writable_real?() FileTest.writable_real?(@path) end

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

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