Extend Pry.start :quiet into Object#pry adds fixes: 502.

This commit is contained in:
Jordon Bedwell 2012-04-01 03:51:55 -05:00
parent bd8f3ea613
commit 8f50bc3112
1 changed files with 13 additions and 2 deletions

View File

@ -10,14 +10,25 @@ class Object
# explicit receiver and one parameter; this will start a Pry
# session on the parameter.
# @param [Object, Binding] target The receiver of the Pry session.
# @param [Symbol, Symbol] :quiet silences, anything else allows whereami.
# @example First form
# "dummy".pry
# @example Second form
# pry "dummy"
# @example Start a Pry session on current self (whatever that is)
# pry
def pry(target=self)
Pry.start(target)
# @example Start a Pry session on a binding without whereami
# binding.pry :quiet
def pry(target=self, quiet = nil)
if target == :quiet
quiet, target = true, self
else
# Only :quiet makes it quiet, okay....
quiet = quiet == :quiet ? true : false
end
Pry.start(target, :quiet => quiet)
end
# Return a binding object for the receiver.