End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Pathname#expand_path
expand_path(p1 = v1)
ext/pathname/pathname.c
View on GitHub ↗
static VALUE
path_expand_path(int argc, VALUE *argv, VALUE self)
{
VALUE str = get_strpath(self);
VALUE dname;
if (rb_scan_args(argc, argv, "01", &dname) == 0)
str = rb_funcall(rb_cFile, id_expand_path, 1, str);
else
str = rb_funcall(rb_cFile, id_expand_path, 2, str, dname);
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
Returns the absolute path for the file.
See File.expand_path.