From 4131cd05be4c00e2d6740d1619711e574cd731af Mon Sep 17 00:00:00 2001 From: aycabta Date: Tue, 22 Dec 2020 04:56:03 +0900 Subject: [ruby/irb] Support arg for measure command https://github.com/ruby/irb/commit/b43f35d8f3 --- lib/irb.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/irb.rb') diff --git a/lib/irb.rb b/lib/irb.rb index 26c5d2ebe9..4eef8be613 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 } -- cgit v1.2.3