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

ruby-changes:17306

From: akr <ko1@a...>
Date: Wed, 22 Sep 2010 00:03:49 +0900 (JST)
Subject: [ruby-changes:17306] Ruby:r29310 (trunk): * ext/pathname/pathname.c (path_f_pathname): Pathname() translated

akr	2010-09-22 00:01:11 +0900 (Wed, 22 Sep 2010)

  New Revision: 29310

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

  Log:
    * ext/pathname/pathname.c (path_f_pathname): Pathname() translated
      from pathname.rb.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29309)
+++ ChangeLog	(revision 29310)
@@ -1,3 +1,8 @@
+Wed Sep 22 00:00:05 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_f_pathname): Pathname() translated
+	  from pathname.rb.
+
 Tue Sep 21 22:18:30 2010  NAKAMURA Usaku  <usa@r...>
 
 	* tool/mkconfig.rb: fixed build problem on mswin64 introduced in r29278.
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 29309)
+++ ext/pathname/lib/pathname.rb	(revision 29310)
@@ -525,13 +525,3 @@
   end
 end
 
-
-module Kernel
-  # create a pathname object.
-  #
-  # This method is available since 1.8.5.
-  def Pathname(path) # :doc:
-    Pathname.new(path)
-  end
-  private :Pathname
-end
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 29309)
+++ ext/pathname/pathname.c	(revision 29310)
@@ -962,6 +962,17 @@
 }
 
 /*
+ * 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 @@
     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);
 }

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

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