about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-04-21 15:31:58 -0700
committerEric Wong <normalperson@yhbt.net>2010-04-21 16:23:09 -0700
commita0ee3ba2d08acb423a1cbc4a5ae862bd40c4b914 (patch)
treeca4268918acaaed138291de6a6363748b59e3adb /ext
parent9c6fd3814b6bed2772fc540e7824febe85e9b046 (diff)
downloadclogger-a0ee3ba2d08acb423a1cbc4a5ae862bd40c4b914.tar.gz
This quiets down warnings when used with RubyGems loaders such
as Isolate and Bundler where the HTTP server already loaded
Rack.
Diffstat (limited to 'ext')
-rw-r--r--ext/clogger_ext/clogger.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c
index 93c609d..453ff48 100644
--- a/ext/clogger_ext/clogger.c
+++ b/ext/clogger_ext/clogger.c
@@ -776,21 +776,10 @@ static VALUE clogger_init_copy(VALUE clone, VALUE orig)
 
 #define CONST_GLOBAL_STR(val) CONST_GLOBAL_STR2(val, #val)
 
-static void init_rack_utils_header_hash(void)
-{
-        VALUE mRack, mUtils;
-#if 0
-  extra double quotes below are to disable rdoc (and so is avoiding comments)
-  let me know if there is a better way...
-#endif
-        rb_require("rack");
-        mRack = rb_define_module("Rack""");
-        mUtils = rb_define_module_under(mRack, "Utils""");
-        cHeaderHash = rb_define_class_under(mUtils, "HeaderHash""", rb_cHash);
-}
-
 void Init_clogger_ext(void)
 {
+        VALUE tmp;
+
         ltlt_id = rb_intern("<<");
         call_id = rb_intern("call");
         each_id = rb_intern("each");
@@ -826,5 +815,8 @@ void Init_clogger_ext(void)
         CONST_GLOBAL_STR2(space, " ");
         CONST_GLOBAL_STR2(question_mark, "?");
         CONST_GLOBAL_STR2(rack_request_cookie_hash, "rack.request.cookie_hash");
-        init_rack_utils_header_hash();
+
+        tmp = rb_const_get(rb_cObject, rb_intern("Rack"));
+        tmp = rb_const_get(tmp, rb_intern("Utils"));
+        cHeaderHash = rb_const_get(tmp, rb_intern("HeaderHash"));
 }