diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-27 23:19:30 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-27 23:19:30 +0000 |
commit | b6595225c1a68f212eb2d11f35de7732b9114fd7 (patch) | |
tree | ac94fac6bdc9d0e8e01798540bf5b03f1b1f8623 /ext/pathname/pathname.c | |
parent | 55c2e00d6503365e7140cc2e8fc5cb854f420553 (diff) | |
download | ruby-b6595225c1a68f212eb2d11f35de7732b9114fd7.tar.gz |
* 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
Diffstat (limited to 'ext/pathname/pathname.c')
-rw-r--r-- | ext/pathname/pathname.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index f5ba6dc1ae..68ff682b2e 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -598,6 +598,15 @@ path_split(VALUE self) } /* + * 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 @@ 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); } |