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

return an instance of Pry::Config from Pry.current.

This commit is contained in:
Robert Gleeson 2014-02-01 14:03:11 +01:00
parent 4d39a53e61
commit fe54ff7ca0

View file

@ -34,9 +34,12 @@ class Pry
@main ||= TOPLEVEL_BINDING.eval "self"
end
# @return [Hash] Pry's `Thread.current` hash
#
# @return [Pry::Config]
# Returns a value store for an instance of Pry running on the current thread.
#
def self.current
Thread.current[:__pry__] ||= {}
Thread.current[:__pry__] ||= Pry::Config.from_hash({}, nil)
end
# Load the given file in the context of `Pry.toplevel_binding`