From: Joel VanderWerf Date: 2008-08-22T03:12:34+09:00 Subject: Re: Lower verbosity in IRB? Kyle Schmitt wrote: > OK, this is probably a very basic question, but how do ou go about > lowering the verbosity of irb? You can set up irb to limit the number of chars it prints. Put the following code in your .irbrc. This was originally written by Stian Haklev. class IRB::Context attr_accessor :max_output_size alias initialize_before_max_output_size initialize def initialize(*args) initialize_before_max_output_size(*args) @max_output_size = (IRB.conf[:MAX_OUTPUT_SIZE] ? IRB.conf[:MAX_OUTPUT_SIZE] : 500) end end class IRB::Irb def output_value text = if @context.inspect? sprintf @context.return_format, @context.last_value.inspect else sprintf @context.return_format, @context.last_value end max = @context.max_output_size if text.size < max puts text else puts text[0..@context.max_output_size-1] + "..." + text[-2..-1] end end end -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407