Ruby ObjectGraph will output Graphviz dot files of your Ruby objects in memory.
The project will ferret out your instance variables and enumerate over your enumerables to give you a graph of your object and its relationships.
For sample output and more sample code see:
* http://flickr.com/photos/aaronp/tags/graphviz/
* http://tenderlovemaking.com/2007/01/13/graphing-objects-in-memory-with-ruby/
PROBLEMS
The output graph kind of lies when displaying Hashes. A Hash will point to an Array with a key and value. If the hash contains 7 pairs, it will point to 7 Arrays.
SYNOPSYS
list = %w{ hello world how are you? }
hash = { :list => list, :string => "tenderlovemaking.com" }
puts ObjectGraph.graph(hash)
INSTALL
sudo gem install ograph
Product's homepage
Download Ruby ObjectGraph 0.0.1 Free
Tags: output Graphviz , Ruby objects , memory objects , Ruby , ObjectGraph , output ,
hash, output, ruby, graph, point, sample, list, puts, homepage, 7 arrayssynopsyslist, objectgraphgraphhashinstallsudo, point 7 arrayssynopsyslist, ographproduct's, arrayssynopsyslist =, pairs point, point 7, value, key, pairs, contains, array, arrayssynopsyslist, gem, world, install
Hiç yorum yok:
Yorum Gönder