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

ruby-changes:12165

From: akr <ko1@a...>
Date: Wed, 24 Jun 2009 20:20:15 +0900 (JST)
Subject: [ruby-changes:12165] Ruby:r23840 (trunk): * time.c (time_s_now): new function. Time.now don't take arguments.

akr	2009-06-24 20:19:58 +0900 (Wed, 24 Jun 2009)

  New Revision: 23840

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

  Log:
    * time.c (time_s_now): new function.  Time.now don't take arguments.

  Modified files:
    trunk/ChangeLog
    trunk/time.c

Index: time.c
===================================================================
--- time.c	(revision 23839)
+++ time.c	(revision 23840)
@@ -1619,6 +1619,21 @@
 
 /*
  *  call-seq:
+ *     Time.now => time
+ *
+ *  Creates a new time object for the current time.
+ *
+ *     Time.now            #=> 2009-06-24 12:39:54 +0900
+ */
+
+static VALUE
+time_s_now(VALUE klass)
+{
+    return rb_class_new_instance(0, NULL, klass);
+}
+
+/*
+ *  call-seq:
  *     Time.at(time) => time
  *     Time.at(seconds_with_frac) => time
  *     Time.at(seconds, microseconds_with_frac) => time
@@ -3728,7 +3743,7 @@
     rb_include_module(rb_cTime, rb_mComparable);
 
     rb_define_alloc_func(rb_cTime, time_s_alloc);
-    rb_define_singleton_method(rb_cTime, "now", rb_class_new_instance, -1);
+    rb_define_singleton_method(rb_cTime, "now", time_s_now, 0);
     rb_define_singleton_method(rb_cTime, "at", time_s_at, -1);
     rb_define_singleton_method(rb_cTime, "utc", time_s_mkutc, -1);
     rb_define_singleton_method(rb_cTime, "gm", time_s_mkutc, -1);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23839)
+++ ChangeLog	(revision 23840)
@@ -1,3 +1,7 @@
+Wed Jun 24 20:19:11 2009  Tanaka Akira  <akr@f...>
+
+	* time.c (time_s_now): new function.  Time.now don't take arguments.
+
 Wed Jun 24 16:08:03 2009  NAKAMURA Usaku  <usa@r...>
 
 	* win32/resource.rb: CONFIG["TEENY"] is not ruby's version but API's

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

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