static VALUE
path_s_glob(int argc, VALUE *argv, VALUE klass)
{
VALUE args[2];
int n;
n = rb_scan_args(argc, argv, "11", &args[0], &args[1]);
if (rb_block_given_p()) {
return rb_block_call(rb_cDir, rb_intern("glob"), n, args, glob_i, klass);
}
else {
VALUE ary;
long i;
ary = rb_funcall2(rb_cDir, rb_intern("glob"), n, args);
ary = rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
for (i = 0; i < RARRAY_LEN(ary); i++) {
VALUE elt = RARRAY_AREF(ary, i);
elt = rb_class_new_instance(1, &elt, klass);
rb_ary_store(ary, i, elt);
}
return ary;
}
}