ruby-changes:54141
From: nobu <ko1@a...>
Date: Wed, 12 Dec 2018 20:43:20 +0900 (JST)
Subject: [ruby-changes:54141] nobu:r66362 (trunk): Revise Date#hour, #min, #sec
nobu 2018-12-12 20:43:14 +0900 (Wed, 12 Dec 2018) New Revision: 66362 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66362 Log: Revise Date#hour, #min, #sec For ActiveSupport. [ruby-core:90443] [Bug #15403] Modified files: trunk/ext/date/date_core.c Index: ext/date/date_core.c =================================================================== --- ext/date/date_core.c (revision 66361) +++ ext/date/date_core.c (revision 66362) @@ -9032,6 +9032,12 @@ mk_ary_of_str(long len, const char *a[]) https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L9032 return o; } +static VALUE +d_lite_zero(VALUE x) +{ + return INT2FIX(0); +} + void Init_date_core(void) { @@ -9374,6 +9380,12 @@ Init_date_core(void) https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L9380 rb_define_method(cDate, "nth_kday?", d_lite_nth_kday_p, 2); #endif + rb_define_private_method(cDate, "hour", d_lite_zero, 0); + rb_define_private_method(cDate, "min", d_lite_zero, 0); + rb_define_private_method(cDate, "minute", d_lite_zero, 0); + rb_define_private_method(cDate, "sec", d_lite_zero, 0); + rb_define_private_method(cDate, "second", d_lite_zero, 0); + rb_define_method(cDate, "julian?", d_lite_julian_p, 0); rb_define_method(cDate, "gregorian?", d_lite_gregorian_p, 0); rb_define_method(cDate, "leap?", d_lite_leap_p, 0); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/