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

ruby-changes:17155

From: akr <ko1@a...>
Date: Tue, 31 Aug 2010 21:11:14 +0900 (JST)
Subject: [ruby-changes:17155] Ruby:r29154 (trunk): * ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated

akr	2010-08-31 21:11:02 +0900 (Tue, 31 Aug 2010)

  New Revision: 29154

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

  Log:
    * ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated
      from pathname.rb.

  Modified files:
    trunk/ChangeLog
    trunk/doc/ChangeLog-1.9.3
    trunk/ext/pathname/lib/pathname.rb
    trunk/ext/pathname/pathname.c

Index: doc/ChangeLog-1.9.3
===================================================================
--- doc/ChangeLog-1.9.3	(revision 29153)
+++ doc/ChangeLog-1.9.3	(revision 29154)
@@ -524,7 +524,7 @@
 
 Sun Aug  8 00:41:42 2010  Tanaka Akira  <akr@f...>
 
-	* include/ruby/subst.h: new file for substitute standard functions..
+	* include/ruby/subst.h: new file for substitute standard functions.
 
 	* include/ruby/missing.h: don't substitute "close", etc. here.
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29153)
+++ ChangeLog	(revision 29154)
@@ -1,3 +1,8 @@
+Tue Aug 31 21:10:23 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated
+	  from pathname.rb.
+
 Tue Aug 31 17:32:34 2010  Hidetoshi NAGAI  <nagai@a...>
 
 	* ext/tk/stubs.c: fix [Bug #3771] "VC++ can't make ext/tk with enabling
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 29153)
+++ ext/pathname/lib/pathname.rb	(revision 29154)
@@ -486,9 +486,6 @@
 
 class Pathname    # * FileTest *
 
-  # See <tt>FileTest.exist?</tt>.
-  def exist?() FileTest.exist?(@path) end
-
   # See <tt>FileTest.grpowned?</tt>.
   def grpowned?() FileTest.grpowned?(@path) end
 
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 29153)
+++ ext/pathname/pathname.c	(revision 29154)
@@ -634,6 +634,15 @@
 }
 
 /*
+ * See <tt>FileTest.exist?</tt>.
+ */
+static VALUE
+path_exist_p(VALUE self)
+{
+    return rb_funcall(rb_mFileTest, rb_intern("exist?"), 1, get_strpath(self));
+}
+
+/*
  * == Pathname
  *
  * Pathname represents a pathname which locates a file in a filesystem.
@@ -866,4 +875,5 @@
     rb_define_method(rb_cPathname, "chardev?", path_chardev_p, 0);
     rb_define_method(rb_cPathname, "executable?", path_executable_p, 0);
     rb_define_method(rb_cPathname, "executable_real?", path_executable_real_p, 0);
+    rb_define_method(rb_cPathname, "exist?", path_exist_p, 0);
 }

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

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