mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
support old Pry#hooks= API (argument as a Hash) on Pry::Config.
This commit is contained in:
parent
0f8afdd010
commit
bc9c75e546
1 changed files with 14 additions and 0 deletions
|
@ -58,6 +58,20 @@ class Pry::Config
|
|||
@lookup
|
||||
end
|
||||
|
||||
#
|
||||
# FIXME
|
||||
# @param [Pry::Hooks] hooks
|
||||
#
|
||||
def hooks=(hooks)
|
||||
if hooks.is_a?(Hash)
|
||||
warn "Hash-based hooks are now deprecated! Use a `Pry::Hooks` object " \
|
||||
"instead! http://rubydoc.info/github/pry/pry/master/Pry/Hooks"
|
||||
self["hooks"] = Pry::Hooks.from_hash(hooks)
|
||||
else
|
||||
self["hooks"] = hooks
|
||||
end
|
||||
end
|
||||
|
||||
def quiet?
|
||||
quiet
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue