From 892c013e17d6d59e5618a145a8e594111ba6469d Mon Sep 17 00:00:00 2001 From: "Yuya.Nishida" Date: Sat, 2 Nov 2013 04:07:53 +0900 Subject: [PATCH 1/2] output Ruby version at ruby_startup on Ruby 2.x. --- mod_ruby.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod_ruby.c b/mod_ruby.c index ebe4190..849825b 100644 --- a/mod_ruby.c +++ b/mod_ruby.c @@ -604,7 +604,7 @@ static void ruby_add_path(const char *path) static int ruby_startup(pool *p, pool *plog, pool *ptemp, server_rec *s) { ap_add_version_component(p, MOD_RUBY_STRING_VERSION); -#if RUBY_RELEASE_CODE > 20040624 +#if RUBY_VM || RUBY_RELEASE_CODE > 20040624 { char *version = apr_pstrcat(p, "Ruby/", ruby_version, "(", ruby_release_date, ")", From ee0c70d6c458f4b2bde28bd40fdbf90a4c7d31e1 Mon Sep 17 00:00:00 2001 From: "Yuya.Nishida" Date: Sat, 2 Nov 2013 04:41:14 +0900 Subject: [PATCH 2/2] output ruby_patchlevel at ruby_startup. --- mod_ruby.c | 4 ++++ mod_ruby.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/mod_ruby.c b/mod_ruby.c index 849825b..e77eff3 100644 --- a/mod_ruby.c +++ b/mod_ruby.c @@ -607,6 +607,10 @@ static int ruby_startup(pool *p, pool *plog, pool *ptemp, server_rec *s) #if RUBY_VM || RUBY_RELEASE_CODE > 20040624 { char *version = apr_pstrcat(p, "Ruby/", ruby_version, +#if HAVE_RUBY_VERSION_H + apr_psprintf(ptemp, "p%d", + ruby_patchlevel), +#endif "(", ruby_release_date, ")", (char *) NULL); ap_add_version_component(p, version); diff --git a/mod_ruby.h b/mod_ruby.h index 779a4c4..3ccf6fa 100644 --- a/mod_ruby.h +++ b/mod_ruby.h @@ -38,6 +38,9 @@ #include "ruby/io.h" #include "ruby/util.h" #include "ruby/intern.h" +#ifdef HAVE_RUBY_VERSION_H +#include "ruby/version.h" +#endif void rb_thread_stop_timer_thread(void); void rb_thread_start_timer_thread(void);