PrettyPrint that comes with Ruby will do this for you:
require 'pp' x = [ [1, 2, 3], [4, 5, 6]] pp x
However, the output in Ruby 1.9.2 (which you should try to use if possible) does this automatically:
ruby-1.9.2-p290 :001 > x = [ [1, 2, 3], [4, 5, 6]] => [[1, 2, 3], [4, 5, 6]] ruby-1.9.2-p290 :002 > px [[1, 2, 3], [4, 5, 6]] => [[1, 2, 3], [4, 5, 6]]
source share