зеркало из https://github.com/github/ruby.git
Родитель
d34303ad10
Коммит
d77b84ca82
1
load.c
1
load.c
|
@ -1238,6 +1238,7 @@ Init_load(void)
|
|||
vm->expanded_load_path = rb_ary_tmp_new(0);
|
||||
vm->load_path_snapshot = rb_ary_tmp_new(0);
|
||||
vm->load_path_check_cache = 0;
|
||||
rb_define_singleton_method(vm->load_path, "resolve_feature_path", rb_resolve_feature_path, 1);
|
||||
|
||||
rb_define_virtual_variable("$\"", get_loaded_features, 0);
|
||||
rb_define_virtual_variable("$LOADED_FEATURES", get_loaded_features, 0);
|
||||
|
|
|
@ -898,7 +898,7 @@ class TestRequire < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
if defined?(RubyVM.resolve_feature_path)
|
||||
if defined?($LOAD_PATH.resolve_feature_path)
|
||||
def test_resolve_feature_path
|
||||
paths, loaded = $:.dup, $".dup
|
||||
Dir.mktmpdir do |tmp|
|
||||
|
@ -907,9 +907,9 @@ class TestRequire < Test::Unit::TestCase
|
|||
path = File.realpath(file.path)
|
||||
dir, base = File.split(path)
|
||||
$:.unshift(dir)
|
||||
assert_equal([:rb, path], RubyVM.resolve_feature_path(base))
|
||||
assert_equal([:rb, path], $LOAD_PATH.resolve_feature_path(base))
|
||||
$".push(path)
|
||||
assert_equal([:rb, path], RubyVM.resolve_feature_path(base))
|
||||
assert_equal([:rb, path], $LOAD_PATH.resolve_feature_path(base))
|
||||
end
|
||||
end
|
||||
ensure
|
||||
|
|
4
vm.c
4
vm.c
|
@ -2949,8 +2949,6 @@ static VALUE usage_analysis_register_stop(VALUE self);
|
|||
* #=> [:rb, "/path/to/set.rb"]
|
||||
*/
|
||||
|
||||
VALUE rb_resolve_feature_path(VALUE klass, VALUE fname);
|
||||
|
||||
void
|
||||
Init_VM(void)
|
||||
{
|
||||
|
@ -3255,8 +3253,6 @@ Init_VM(void)
|
|||
|
||||
/* vm_backtrace.c */
|
||||
Init_vm_backtrace();
|
||||
|
||||
rb_define_singleton_method(rb_cRubyVM, "resolve_feature_path", rb_resolve_feature_path, 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче