irb icon indicating copy to clipboard operation
irb copied to clipboard

Measure command without ruby arg

Open tompng opened this issue 1 year ago • 0 comments

To align with other command usage, and to reduce use of ruby_args, this pull request adds

measure on
measure foo
measure off time

and deprecates

measure :on
measure :foo
measure :off, :time

and also adds missing test for measure proc arguments.

Other changes

Type of arg will change to string | nil. Previously, any object was possible.

measure :custom_measure_method, Object.new
# ↓
measure custom_measure_method string_args

I think this does not break existing code because I couldn't find any code using custom MEASURE_PROC. https://github.com/search?q=%22IRB.conf%5B%3AMEASURE_PROC%5D%22+NOT+is%3Afork+language%3ARuby&type=code

tompng avatar May 26 '24 07:05 tompng