module constants should be looked up at top-level by default
This commit is contained in:
parent
dc0e15cf47
commit
77387b3e5c
|
@ -25,8 +25,8 @@ class Pry
|
||||||
# @return [Module, nil] The module or `nil` (if conversion failed).
|
# @return [Module, nil] The module or `nil` (if conversion failed).
|
||||||
# @example
|
# @example
|
||||||
# Pry::WrappedModule.from_str("Pry::Code")
|
# Pry::WrappedModule.from_str("Pry::Code")
|
||||||
def self.from_str(mod_name)
|
def self.from_str(mod_name, binding=TOPLEVEL_BINDING)
|
||||||
Pry::WrappedModule.new(eval(mod_name))
|
Pry::WrappedModule.new(binding.eval(mod_name))
|
||||||
rescue RescuableException
|
rescue RescuableException
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue