* ext/syck/rubyext.c (yaml_org_handler): lazy-load Date for
static-ext. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2f7ebefa94
commit
a68aa547a1
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 8 08:46:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/syck/rubyext.c (yaml_org_handler): lazy-load Date for
|
||||||
|
static-ext.
|
||||||
|
|
||||||
Thu Jan 8 07:06:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Jan 8 07:06:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/extmk.rb: preserve order in Setup. [ruby-dev:22503]
|
* ext/extmk.rb: preserve order in Setup. [ruby-dev:22503]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* -*- indent-tabs-mode: nil -*-
|
||||||
/*
|
/*
|
||||||
* rubyext.c
|
* rubyext.c
|
||||||
*
|
*
|
||||||
@ -494,6 +495,14 @@ yaml_org_handler( n, ref )
|
|||||||
while ( !ISDIGIT( *ptr ) ) ptr++;
|
while ( !ISDIGIT( *ptr ) ) ptr++;
|
||||||
day = INT2FIX(strtol(ptr, NULL, 10));
|
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 );
|
obj = rb_funcall( cDate, s_new, 3, year, mon, day );
|
||||||
}
|
}
|
||||||
else if ( strncmp( type_id, "timestamp", 9 ) == 0 )
|
else if ( strncmp( type_id, "timestamp", 9 ) == 0 )
|
||||||
@ -1383,12 +1392,6 @@ Init_syck()
|
|||||||
sym_scalar = ID2SYM(rb_intern("scalar"));
|
sym_scalar = ID2SYM(rb_intern("scalar"));
|
||||||
sym_seq = ID2SYM(rb_intern("seq"));
|
sym_seq = ID2SYM(rb_intern("seq"));
|
||||||
|
|
||||||
/*
|
|
||||||
* Load Date module
|
|
||||||
*/
|
|
||||||
rb_require( "date" );
|
|
||||||
cDate = rb_funcall( rb_cObject, rb_intern("const_get"), 1, rb_str_new2("Date") );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define YAML::Syck::Loader class
|
* Define YAML::Syck::Loader class
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user