From 77387b3e5cf9c8eb057eb0e7d8a3e74fa784fd53 Mon Sep 17 00:00:00 2001 From: John Mair Date: Tue, 17 Apr 2012 22:50:39 +1200 Subject: [PATCH] module constants should be looked up at top-level by default --- lib/pry/wrapped_module.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pry/wrapped_module.rb b/lib/pry/wrapped_module.rb index bd6b5a28..c7090a49 100644 --- a/lib/pry/wrapped_module.rb +++ b/lib/pry/wrapped_module.rb @@ -25,8 +25,8 @@ class Pry # @return [Module, nil] The module or `nil` (if conversion failed). # @example # Pry::WrappedModule.from_str("Pry::Code") - def self.from_str(mod_name) - Pry::WrappedModule.new(eval(mod_name)) + def self.from_str(mod_name, binding=TOPLEVEL_BINDING) + Pry::WrappedModule.new(binding.eval(mod_name)) rescue RescuableException nil end