Ruby Objects Graph

puts 'strict graph { rankdir="LR"'
puts ObjectSpace.each_object(Module).
      select { |o| o.name unless o.to_s[/^Errno/] }.
      map { |o| o.ancestors.map { |a| %'"#{a}"' }.reverse * '--' }
puts '}'
$ ./test.rb > test.dot
$ dot -Tjpg test.dot > test.jpg

Ruby object graph