Version 0.0.2

This commit is contained in:
Denis Knauf 2010-05-20 14:48:42 +02:00
parent bf67c1752f
commit 8e883065ca
2 changed files with 26 additions and 1 deletions

View file

@ -1 +1 @@
0.0.1
0.0.2

View file

@ -1,4 +1,25 @@
class NotRegexp
def initialize r
@rx = r
end
def match l
! @rx.match( l)
end
def =~ l
! @rx =~ l
end
def -@
@rx
end
end
class Regexp
def -@
NotRegexp.new self
end
end
class Functional
include Enumerable
@ -33,6 +54,10 @@ class Functional
push_method :select, &exe
end
def grep r
push_method :select, &r.method( :match)
end
def delete_if &exe
push_method :delete_if, &exe
end