We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 167c240 + 006f739 commit 5345813Copy full SHA for 5345813
lib/web_console/evaluator.rb
@@ -19,7 +19,12 @@ def initialize(binding = TOPLEVEL_BINDING)
19
end
20
21
def eval(input)
22
- "=> #{@binding.eval(input).inspect}\n"
+ # Binding#source_location is available since Ruby 2.6.
23
+ if @binding.respond_to? :source_location
24
+ "=> #{@binding.eval(input, *@binding.source_location).inspect}\n"
25
+ else
26
+ "=> #{@binding.eval(input).inspect}\n"
27
+ end
28
rescue Exception => exc
29
format_exception(exc)
30
test/web_console/session_test.rb
@@ -51,6 +51,9 @@ def eval(string)
51
52
53
54
+ def source_location
55
56
+
57
self
58
59
0 commit comments