summaryrefslogtreecommitdiff
path: root/lib/irb.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-12-22 04:56:03 +0900
committeraycabta <aycabta@gmail.com>2020-12-22 23:45:43 +0900
commit4131cd05be4c00e2d6740d1619711e574cd731af (patch)
treec209c4fdcc5879b7f74b6680c0a5ad1ef30d1bde /lib/irb.rb
parent47b26795d06ea13d646edddd51470d9a6cd377b4 (diff)
[ruby/irb] Support arg for measure command
https://github.com/ruby/irb/commit/b43f35d8f3
Diffstat (limited to 'lib/irb.rb')
-rw-r--r--lib/irb.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index 26c5d2e..4eef8be 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -544,9 +544,10 @@ module IRB
if IRB.conf[:MEASURE] && !IRB.conf[:MEASURE_CALLBACKS].empty?
result = nil
last_proc = proc{ result = @context.evaluate(line, line_no, exception: exc) }
- IRB.conf[:MEASURE_CALLBACKS].map{ |s| s.last }.inject(last_proc) { |chain, item|
+ IRB.conf[:MEASURE_CALLBACKS].inject(last_proc) { |chain, item|
+ _name, callback, arg = item
proc {
- item.(@context, line, line_no, exception: exc) do
+ callback.(@context, line, line_no, arg, exception: exc) do
chain.call
end
}