1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

very minor api tweak

This commit is contained in:
Ryan Fitzgerald 2012-01-14 23:03:41 -08:00
parent 9ec55d0841
commit 696a2f1a82
2 changed files with 2 additions and 1 deletions

View file

@ -210,6 +210,7 @@ class Pry
# @return [Code]
def grep(pattern)
return self unless pattern
pattern = Regexp.new(pattern)
select do |l, ln|
l =~ pattern

View file

@ -189,7 +189,7 @@ class Pry
end
if opts.present?(:grep)
@history = @history.grep(Regexp.new(opts[:grep]))
@history = @history.grep(opts[:grep])
end
unless opts.present?(:'no-numbers')