From 21d4c1ddf9d05d336819668aaa07f194cac31d60 Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 1 Apr 2014 19:20:41 +0200 Subject: [PATCH] support BasicObject instance's as value in Pry#inject_local before: [6] pry(main)> _pry_.inject_local :foo, BasicObject.new, Pry.toplevel_binding NoMethodError: undefined method `is_a?' for # from /Users/giorgio/code/pry/lib/pry/pry_instance.rb:151:in `inject_local' [7] pry(main)> exit after: [3] pry(main)> _pry_.inject_local :foo, BasicObject.new, Pry.toplevel_binding => # [4] pry(main)> foo => # --- lib/pry/pry_instance.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 26599fde..bf510b13 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -148,7 +148,7 @@ class Pry # The value the local was set to. # def inject_local(name, value, b) - value = value.is_a?(Proc) ? value.call : value + value = Proc === value ? value.call : value if b.respond_to?(:local_variable_set) b.local_variable_set name, value else # < 2.1