From: Hongli Lai Date: 2008-07-28T05:21:11+09:00 Subject: [ruby-core:18001] Re: RUBY_ENGINE? This is a multi-part message in MIME format. --------------030504090408040508040505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi all. I don't think it's really productive to be discussing about this constant. After all, it's only a single constant. Implementing it won't have any negative impacts on the MRI core developers, but it does make lifes for a lot of people a whole lot easier. So here's a patch which defines RUBY_ENGINE as "ruby". I've already committed this patch to Ruby Enterprise Edition's repository, and it will be bundled with the next release. With kind regards, Hongli Lai -- Phusion | The Computer Science Company Web: http://www.phusion.nl/ E-mail: info@phusion.nl Chamber of commerce no: 08173483 (The Netherlands) --------------030504090408040508040505 Content-Type: text/x-diff; name="ruby_engine.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ruby_engine.diff" diff --git a/version.c b/version.c index b235673..a23ee9c 100644 --- a/version.c +++ b/version.c @@ -14,6 +14,7 @@ #include "version.h" #include +const char ruby_engine[] = RUBY_ENGINE; const char ruby_version[] = RUBY_VERSION; const char ruby_release_date[] = RUBY_RELEASE_DATE; const char ruby_platform[] = RUBY_PLATFORM; @@ -22,10 +23,12 @@ const int ruby_patchlevel = RUBY_PATCHLEVEL; void Init_version() { + VALUE e = rb_obj_freeze(rb_str_new2(ruby_engine)); 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)); + rb_define_global_const("RUBY_ENGINE", e); rb_define_global_const("RUBY_VERSION", v); rb_define_global_const("RUBY_RELEASE_DATE", d); rb_define_global_const("RUBY_PLATFORM", p); diff --git a/version.h b/version.h index 7bc9e2c..05ce8c8 100644 --- a/version.h +++ b/version.h @@ -1,3 +1,4 @@ +#define RUBY_ENGINE "ruby" #define RUBY_VERSION "1.8.6" #define RUBY_RELEASE_DATE "2008-03-03" #define RUBY_VERSION_CODE 186 --------------030504090408040508040505--