From: "mame (Yusuke Endoh)" <mame@...>
Date: 2012-03-30T02:11:08+09:00
Subject: [ruby-core:43892] [ruby-trunk - Feature #6150][Assigned] add Enumerable#grep_v


Issue #6150 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to matz (Yukihiro Matsumoto)
Target version set to 2.0.0


----------------------------------------
Feature #6150: add Enumerable#grep_v
https://bugs.ruby-lang.org/issues/6150#change-25403

Author: sunaku (Suraj Kurapati)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: 
Target version: 2.0.0


Please add a grep_v() method to Enumerable that behaves like the opposite of grep().

For example, if Enumerable#grep() was implemented like this:

module Enumerable
  def grep pattern
    select {|x| pattern =~ x }
  end
end

then Enumerable#grep_v() would be implemented like this (select becomes reject):

module Enumerable
  def grep_v pattern
    reject {|x| pattern =~ x }
  end
end


The method name "grep_v" comes from the "-v" option passed to grep(1).

Thanks for your consideration.


-- 
http://bugs.ruby-lang.org/