diff options
-rw-r--r-- | namespace.c | 30 |
1 files changed, 10 insertions, 20 deletions
@@ -47,29 +47,10 @@ static bool tmp_dir_has_dirsep; # define DIRSEP "/" #endif -static int namespace_availability = 0; VALUE rb_resolve_feature_path(VALUE klass, VALUE fname); static VALUE rb_namespace_inspect(VALUE obj); - -int -rb_namespace_available(void) -{ - const char *env; - if (namespace_availability) { - return namespace_availability > 0 ? 1 : 0; - } - env = getenv("RUBY_NAMESPACE"); - if (env && strlen(env) > 0) { - if (strcmp(env, "1") == 0) { - namespace_availability = 1; - return 1; - } - } - namespace_availability = -1; - return 0; -} - static void namespace_push(rb_thread_t *th, VALUE namespace); static VALUE namespace_pop(VALUE th_value); @@ -1032,6 +1013,15 @@ namespace_define_loader_method(const char *name) } void Init_Namespace(void) { tmp_dir = system_tmpdir(); |