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:
parent
9ec55d0841
commit
696a2f1a82
2 changed files with 2 additions and 1 deletions
|
@ -210,6 +210,7 @@ class Pry
|
||||||
# @return [Code]
|
# @return [Code]
|
||||||
def grep(pattern)
|
def grep(pattern)
|
||||||
return self unless pattern
|
return self unless pattern
|
||||||
|
pattern = Regexp.new(pattern)
|
||||||
|
|
||||||
select do |l, ln|
|
select do |l, ln|
|
||||||
l =~ pattern
|
l =~ pattern
|
||||||
|
|
|
@ -189,7 +189,7 @@ class Pry
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts.present?(:grep)
|
if opts.present?(:grep)
|
||||||
@history = @history.grep(Regexp.new(opts[:grep]))
|
@history = @history.grep(opts[:grep])
|
||||||
end
|
end
|
||||||
|
|
||||||
unless opts.present?(:'no-numbers')
|
unless opts.present?(:'no-numbers')
|
||||||
|
|
Loading…
Add table
Reference in a new issue