2000-05-01 05:42:38 -04:00
|
|
|
/**********************************************************************
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
version.c -
|
|
|
|
|
|
|
|
$Author$
|
|
|
|
$Date$
|
|
|
|
created at: Thu Sep 30 20:08:01 JST 1993
|
|
|
|
|
2003-01-16 02:34:03 -05:00
|
|
|
Copyright (C) 1993-2003 Yukihiro Matsumoto
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2000-05-01 05:42:38 -04:00
|
|
|
**********************************************************************/
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
#include "ruby.h"
|
|
|
|
#include "version.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
Init_version()
|
|
|
|
{
|
2001-10-29 00:07:26 -05:00
|
|
|
VALUE v = rb_obj_freeze(rb_str_new2(RUBY_VERSION));
|
|
|
|
VALUE d = rb_obj_freeze(rb_str_new2(RUBY_RELEASE_DATE));
|
|
|
|
VALUE p = rb_obj_freeze(rb_str_new2(RUBY_PLATFORM));
|
1999-08-13 01:45:20 -04:00
|
|
|
|
|
|
|
rb_define_global_const("RUBY_VERSION", v);
|
|
|
|
rb_define_global_const("RUBY_RELEASE_DATE", d);
|
|
|
|
rb_define_global_const("RUBY_PLATFORM", p);
|
|
|
|
|
|
|
|
/* obsolete constants */
|
|
|
|
rb_define_global_const("VERSION", v);
|
|
|
|
rb_define_global_const("RELEASE_DATE", d);
|
|
|
|
rb_define_global_const("PLATFORM", p);
|
1998-01-16 07:13:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-01-19 23:59:39 -05:00
|
|
|
ruby_show_version()
|
1998-01-16 07:13:05 -05:00
|
|
|
{
|
1999-08-13 01:45:20 -04:00
|
|
|
printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
|
1998-01-16 07:13:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-01-19 23:59:39 -05:00
|
|
|
ruby_show_copyright()
|
1998-01-16 07:13:05 -05:00
|
|
|
{
|
2003-01-16 02:34:03 -05:00
|
|
|
printf("ruby - Copyright (C) 1993-2003 Yukihiro Matsumoto\n");
|
1998-01-16 07:13:05 -05:00
|
|
|
exit(0);
|
|
|
|
}
|