diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-21 15:01:11 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-21 15:01:11 +0000 |
commit | a5a51abfc5dbe8f29fee38ba34a275063d01b548 (patch) | |
tree | 076492299d0d8cad9512af6b43833238c4656464 /ext/pathname/pathname.c | |
parent | e7381db962823f3d6f6e746b5bfedefd897d32d0 (diff) |
* ext/pathname/pathname.c (path_f_pathname): Pathname() translated
from pathname.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname/pathname.c')
-rw-r--r-- | ext/pathname/pathname.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index b3fe3af9ca..74efc996dc 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -962,6 +962,17 @@ path_unlink(VALUE self) } /* + * create a pathname object. + * + * This method is available since 1.8.5. + */ +static VALUE +path_f_pathname(VALUE self, VALUE str) +{ + return rb_class_new_instance(1, &str, rb_cPathname); +} + +/* * == Pathname * * Pathname represents a pathname which locates a file in a filesystem. @@ -1225,4 +1236,5 @@ Init_pathname() rb_define_method(rb_cPathname, "unlink", path_unlink, 0); rb_define_method(rb_cPathname, "delete", path_unlink, 0); rb_undef_method(rb_cPathname, "=~"); + rb_define_global_function("Pathname", path_f_pathname, 1); } |