gee-forr/whats_new_in_ruby_2.0 — pull request #1 by spider-mario (2013-03-26 21:18:41+00:00)
Title: Fix the example for bsearch

As mentioned in [the documentation for `bsearch`]
(http://www.ruby-doc.org/core-2.0/Range.html#method-i-bsearch), a
boolean-returning block passed to `bsearch` must satisfy the following
condition:

> there must be an index `i` (`0 <= i <= ary.size`) so that:
>
> * the block returns false for any element whose index is less than `i`, and
> * the block returns true for any element whose index is greater than or equal
> to `i`.

That (especially the second item) is not satisfied by the current code
(`i == needle`). Changing it to `i >= needle` solves the problem.