ruby-changes:17266
From: akr <ko1@a...>
Date: Thu, 16 Sep 2010 06:08:26 +0900 (JST)
Subject: [ruby-changes:17266] Ruby:r29267 (trunk): * ext/pathname/pathname.c (path_rmdir): Pathname#rmdir translated
akr 2010-09-16 06:08:19 +0900 (Thu, 16 Sep 2010) New Revision: 29267 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29267 Log: * ext/pathname/pathname.c (path_rmdir): Pathname#rmdir translated from pathname.rb. Modified files: trunk/ChangeLog trunk/ext/pathname/lib/pathname.rb trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 29266) +++ ChangeLog (revision 29267) @@ -1,3 +1,8 @@ +Thu Sep 16 06:07:24 2010 Tanaka Akira <akr@f...> + + * ext/pathname/pathname.c (path_rmdir): Pathname#rmdir translated + from pathname.rb. + Thu Sep 16 00:36:25 2010 NARUSE, Yui <naruse@r...> * ext/readline/extconf.rb: Remove Readline 6 check because Index: ext/pathname/lib/pathname.rb =================================================================== --- ext/pathname/lib/pathname.rb (revision 29266) +++ ext/pathname/lib/pathname.rb (revision 29267) @@ -494,9 +494,6 @@ Dir.foreach(@path) {|f| yield self.class.new(f) } end - # See <tt>Dir.rmdir</tt>. Remove the referenced directory. - def rmdir() Dir.rmdir(@path) end - # See <tt>Dir.open</tt>. def opendir(&block) # :yield: dir Dir.open(@path, &block) Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 29266) +++ ext/pathname/pathname.c (revision 29267) @@ -896,6 +896,15 @@ } /* + * See <tt>Dir.rmdir</tt>. Remove the referenced directory. + */ +static VALUE +path_rmdir(VALUE self) +{ + return rb_funcall(rb_cDir, rb_intern("rmdir"), 1, get_strpath(self)); +} + +/* * == Pathname * * Pathname represents a pathname which locates a file in a filesystem. @@ -1153,4 +1162,5 @@ rb_define_singleton_method(rb_cPathname, "pwd", path_s_getwd, 0); rb_define_method(rb_cPathname, "entries", path_entries, 0); rb_define_method(rb_cPathname, "mkdir", path_mkdir, -1); + rb_define_method(rb_cPathname, "rmdir", path_rmdir, 0); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/