ruby/ruby — pull request #186 by mrmargolis (2012-09-21 04:21:05+00:00)
Title: enum #find ifnone parameter can now be non-callable

Previously the Enumerable `#find` method `ifnone` parameter had to be callable or `nil`. I found that sometimes I wanted to return a simple value. This pull request adds support for non-callable defaults when no items match.

```ruby
a = [1, 2, 3]

#The current behavior
a.find(proc { :foo }) { |x| x > 3 }
=> :foo

#Possible with my branch
a.find(0) { |x| x > 3 }
=> 0