diff --git a/ChangeLog b/ChangeLog index 47df9fd6a2..3f4f7888b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Nov 27 11:25:04 2008 Akinori MUSHA + + * range.c: Add Range#cover? as a new alias to #include? for the + forward compatibility with 1.9, in which the behavior of + Range#include? has changed. + Wed Nov 26 13:31:07 2008 Kazuhiro NISHIYAMA * ext/gdbm/gdbm.c: do not set members of RSTRING(str) directly. diff --git a/NEWS b/NEWS index 8d06ee8117..131523a291 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,11 @@ with all sufficient information, see the ChangeLog file. Renamed from ENV.index. + * Range#cover? + + New alias to #include? for the forward compatibility with 1.9, in + which the behavior of Range#include? has changed. + * dbm DBM#key diff --git a/range.c b/range.c index 7526324da7..f85f3b759b 100644 --- a/range.c +++ b/range.c @@ -695,6 +695,7 @@ Init_Range() rb_define_method(rb_cRange, "member?", range_include, 1); rb_define_method(rb_cRange, "include?", range_include, 1); + rb_define_method(rb_cRange, "cover?", range_include, 1); id_cmp = rb_intern("<=>"); id_succ = rb_intern("succ");