From: "mame (Yusuke Endoh)" Date: 2012-11-24T11:09:28+09:00 Subject: [ruby-core:49966] [ruby-trunk - Feature #7394] Enumerable#find ifnone parameter could be non-callable Issue #7394 has been updated by mame (Yusuke Endoh). Oh, I didn't realized that this ticket was from github pull reqeust. Thank you for your importing work! But, the fact remains that this proposal was not accepted by the 2.0.0 deadline. Sorry. It is unfortunate that people misunderstands that github pullreq is the right way to request a feature to Ruby. Is it impossible to stop (or automatically reject) pullreq? -- Yusuke Endoh ---------------------------------------- Feature #7394: Enumerable#find ifnone parameter could be non-callable https://bugs.ruby-lang.org/issues/7394#change-33732 Author: zzak (Zachary Scott) Status: Assigned Priority: Normal Assignee: nobu (Nobuyoshi Nakada) Category: core Target version: next minor =begin from github: https://github.com/ruby/ruby/pull/186 In trunk the Enumerable #find method ifnone parameter has to be callable or nil. I found that sometimes I want to return a simple value without wrapping it in a proc. This pull request adds support for non-callable defaults when no items match. (({a = [1, 2, 3]})) The current behavior (({a.find(proc { :foo }) { |x| x > 3 } #=> :foo})) With patch (({a.find(0) { |x| x > 3 } #=> 0})) =end -- http://bugs.ruby-lang.org/