Please sign in to comment.
Support to_path and to_str method of load path
* file.c (rb_get_path_check_to_string): extract from rb_get_path_check(). Add an argument to check to have to_path method. * file.c (rb_get_path_check_convert): extract from rb_get_path_check(). * file.c (rb_get_path_check_to_string): move from rb_get_path_check(). * file.c (rb_file_expand_path_fast): remove check_expand_path_args(). Instead we call it in load.c. * internal.h (rb_get_path_check_to_string, rb_get_path_check_convert): add declarations. * load.c (rb_construct_expanded_load_path): add checks in rb_get_path_check(). We don't freeze non string object and expand it every times. We expand string object which has to_path method every times. * load.c (rb_get_expanded_load_path): expand non-cacheable objects every times. * load.c (rb_feature_provided): call rb_get_path() since we changed rb_file_expand_path_fast() not to call it. * load.c (Init_load): rename to load_path_check_cache for changed usage. * vm.c (rb_vm_mark): ditto. * vm_core.h (rb_vm_struct): ditto. * test/ruby/test_require.rb (TestRequire): add tests for compatibility of to_path and to_str in $LOAD_PATH.
- Loading branch information...
Showing with 168 additions and 40 deletions.