iruby
iruby copied to clipboard
Limit output if it gets out of hand
If you try to put something like NMatrix.new([1600,1600], [1]*1600*1600)
into iruby, it usually crashes on my computer.
Limiting the output of exponentially large to print objects might prove beneficial. We can have some kind of an option with which users can toggle this behavior.
Could we wrap NMatrix
output in an IRuby::Table
? By default, a table will only display the first and last n
rows.
I'm not really sure how to limit output in a general way. My only thought is to wrap all output in a Javascript that hides output after n
bytes or lines with a "More output" button that displays a further n
bytes or lines when you click it. That might help a lot since your browser can usually hold all the output in memory no problem, it just struggles to render it.
Ah if it's just a rendering issue then I'd go with the 'more output' option. That way it can universally apply to all sorts of objects.