Skip to content

Commit

Permalink
* array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.
Browse files Browse the repository at this point in the history
  documentation from Thomas Leitner <t_leitner AT gmx.at> in
  [ruby-core:41616].  [Bug ruby#5752]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Dec 15, 2011
1 parent f281353 commit 15f26af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Thu Dec 15 10:44:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>

* array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.
documentation from Thomas Leitner <t_leitner AT gmx.at> in
[ruby-core:41616]. [Bug #5752]

Thu Dec 15 10:10:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>

* test/ruby/test_require.rb (test_race_exception): get rid of
Expand Down
4 changes: 4 additions & 0 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,8 @@ ary_reject_bang(VALUE ary)
* Equivalent to Array#delete_if, deleting elements from
* +self+ for which the block evaluates to true, but returns
* <code>nil</code> if no changes were made.
* The array is changed instantly every time the block is called and
* not after the iteration is over.
* See also Enumerable#reject and Array#delete_if.
*
* If no block is given, an enumerator is returned instead.
Expand Down Expand Up @@ -2687,6 +2689,8 @@ rb_ary_reject(VALUE ary)
*
* Deletes every element of +self+ for which +block+ evaluates
* to true.
* The array is changed instantly every time the block is called and
* not after the iteration is over.
* See also Array#reject!
*
* If no block is given, an enumerator is returned instead.
Expand Down
4 changes: 2 additions & 2 deletions test/ruby/test_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def test_delete_if

bug2545 = '[ruby-core:27366]'
a = @cls[ 5, 6, 7, 8, 9, 10 ]
assert_equal(9, a.delete_if {|i| break i if i > 8; i < 7})
assert_equal(9, a.delete_if {|i| break i if i > 8; assert_equal(a[0], i) || true if i < 7})
assert_equal(@cls[7, 8, 9, 10], a, bug2545)
end

Expand Down Expand Up @@ -1098,7 +1098,7 @@ def test_reject!

bug2545 = '[ruby-core:27366]'
a = @cls[ 5, 6, 7, 8, 9, 10 ]
assert_equal(9, a.reject! {|i| break i if i > 8; i < 7})
assert_equal(9, a.reject! {|i| break i if i > 8; assert_equal(a[0], i) || true if i < 7})
assert_equal(@cls[7, 8, 9, 10], a, bug2545)
end

Expand Down

0 comments on commit 15f26af

Please sign in to comment.