Project

General

Profile

Feature #7363 ยป 7363.patch

zzak (zzak _), 11/19/2012 07:12 AM

View differences:

ext/pathname/pathname.c
}
/*
* Returns a new instance of Pathname initialized with string
*/
static VALUE
path_s_square_brackets(VALUE self, VALUE string)
{
return rb_class_new_instance(1, &string, rb_cPathname);
}
/*
* Return the entries (files and subdirectories) in the directory, each as a
* Pathname object.
*
......
static VALUE
path_f_pathname(VALUE self, VALUE str)
{
rb_warn("Kernel#Pathname is deprecated; use Pathname.[] instead");
return rb_class_new_instance(1, &str, rb_cPathname);
}
......
rb_define_method(rb_cPathname, "world_writable?", path_world_writable_p, 0);
rb_define_method(rb_cPathname, "writable_real?", path_writable_real_p, 0);
rb_define_method(rb_cPathname, "zero?", path_zero_p, 0);
rb_define_singleton_method(rb_cPathname, "[]", path_s_square_brackets, 1);
rb_define_singleton_method(rb_cPathname, "glob", path_s_glob, -1);
rb_define_singleton_method(rb_cPathname, "getwd", path_s_getwd, 0);
rb_define_singleton_method(rb_cPathname, "pwd", path_s_getwd, 0);
    (1-1/1)