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

ruby-changes:17124

From: akr <ko1@a...>
Date: Sat, 28 Aug 2010 08:19:38 +0900 (JST)
Subject: [ruby-changes:17124] Ruby:r29124 (trunk): * ext/pathname/pathname.c (path_blockdev_p): Pathname#blockdev?

akr	2010-08-28 08:19:30 +0900 (Sat, 28 Aug 2010)

  New Revision: 29124

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

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

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29123)
+++ ChangeLog	(revision 29124)
@@ -1,3 +1,8 @@
+Sat Aug 28 08:11:05 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_blockdev_p): Pathname#blockdev?
+	  translated from pathname.rb.
+
 Fri Aug 27 16:20:01 2010  URABE Shyouhei  <shyouhei@r...>
 
 	* string.c (rb_str_prepend): new method by Shota Fukumori (sora_h)
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 29123)
+++ ext/pathname/lib/pathname.rb	(revision 29124)
@@ -486,9 +486,6 @@
 
 class Pathname    # * FileTest *
 
-  # See <tt>FileTest.blockdev?</tt>.
-  def blockdev?() FileTest.blockdev?(@path) end
-
   # See <tt>FileTest.chardev?</tt>.
   def chardev?() FileTest.chardev?(@path) end
 
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 29123)
+++ ext/pathname/pathname.c	(revision 29124)
@@ -598,6 +598,15 @@
 }
 
 /*
+ * See <tt>FileTest.blockdev?</tt>.
+ */
+static VALUE
+path_blockdev_p(VALUE self)
+{
+    return rb_funcall(rb_mFileTest, rb_intern("blockdev?"), 1, get_strpath(self));
+}
+
+/*
  * == Pathname
  *
  * Pathname represents a pathname which locates a file in a filesystem.
@@ -826,4 +835,5 @@
     rb_define_method(rb_cPathname, "extname", path_extname, 0);
     rb_define_method(rb_cPathname, "expand_path", path_expand_path, -1);
     rb_define_method(rb_cPathname, "split", path_split, 0);
+    rb_define_method(rb_cPathname, "blockdev?", path_blockdev_p, 0);
 }

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

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