From 5cebcf9a2b06e00771e291d00b3fcdbde5e21394 Mon Sep 17 00:00:00 2001 From: why Date: Tue, 13 Jan 2004 07:57:33 +0000 Subject: [PATCH] * ext/syck/rubyext.c: omission of Date library code caused test suite failure. [ruby-core:2251] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/syck/rubyext.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 93f87bbed8..3458e9396f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 13 16:53:25 2004 why the lucky stiff + + * ext/syck/rubyext.c: omission of Date library code caused + test suite failure. [ruby-core:2251] + Tue Jan 13 16:50:03 2004 Hidetoshi NAGAI * ext/tk/lib/tk.rb: use $0 as the default application class name. diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index 9bce253602..36ef177ae9 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -521,6 +521,14 @@ yaml_org_handler( n, ref ) ptr += 2; while ( !ISDIGIT( *ptr ) ) ptr++; day = INT2FIX(strtol(ptr, NULL, 10)); + + if ( !cDate ) { + /* + * Load Date module + */ + rb_require( "date" ); + cDate = rb_const_get( rb_cObject, rb_intern("Date") ); + } obj = rb_funcall( cDate, s_new, 3, year, mon, day ); }