mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (rb_provide_feature): should not tweak extension used for
loading. * io.c (io_fread): use fread(3) if PENDING_COUND is available. * class.c (rb_mod_include_p): Module#include? added. [new] * re.c (ignorecase_setter): give warning on modifying $=. * string.c (rb_str_casecmp): new method. [new] * string.c (rb_str_eql): separated from rb_str_equal(), make it always be case sensitive. [new] * string.c (rb_str_hash): made it always be case sensitive. * eval.c (rb_f_require): should not include path in $" value * file.c (rb_find_file): should return 0 explicitly on failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9e214f30c4
commit
15ffbb1f82
12 changed files with 151 additions and 57 deletions
16
class.c
16
class.c
|
@ -343,6 +343,22 @@ rb_mod_included_modules(mod)
|
|||
return ary;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_mod_include_p(mod, mod2)
|
||||
VALUE mod;
|
||||
VALUE mod2;
|
||||
{
|
||||
VALUE p;
|
||||
|
||||
Check_Type(mod2, T_MODULE);
|
||||
for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
|
||||
if (BUILTIN_TYPE(p) == T_ICLASS) {
|
||||
if (RBASIC(p)->klass == mod2) return Qtrue;
|
||||
}
|
||||
}
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_mod_ancestors(mod)
|
||||
VALUE mod;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue