зеркало из https://github.com/github/ruby.git
* ext/pathname/pathname.c (path_blockdev_p): Pathname#blockdev?
translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
55c2e00d65
Коммит
b6595225c1
|
@ -1,3 +1,8 @@
|
|||
Sat Aug 28 08:11:05 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_blockdev_p): Pathname#blockdev?
|
||||
translated from pathname.rb.
|
||||
|
||||
Fri Aug 27 16:20:01 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_prepend): new method by Shota Fukumori (sora_h)
|
||||
|
|
|
@ -486,9 +486,6 @@ end
|
|||
|
||||
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
|
||||
|
||||
|
|
|
@ -597,6 +597,15 @@ path_split(VALUE self)
|
|||
return rb_ary_new3(2, dirname, basename);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
|
@ -826,4 +835,5 @@ Init_pathname()
|
|||
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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче