summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-27 02:26:03 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-27 02:26:03 +0000
commitd6a38b6824c3766a63c865630cdcbbd67d49729a (patch)
tree2f6996c233f1549355656dfdf2fd67116f7a22d3
parentece7e2a595a54345f31a630aefd42f1e8093ceaa (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--NEWS5
-rw-r--r--range.c1
3 files changed, 12 insertions, 0 deletions
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 <[email protected]>
+
+ * 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 <[email protected]>
* 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");