Entries from 2007-05-01 to 1 month
RGL provides easy manipulation of graph: require 'rgl/adjacency' g = RGL::DirectedAdjacencyGraph.new IO.foreach(ARGV.shift) {|line| if line =~ /\s*([^\"]+)[\"\s]*->[\"\s]*([^\"\[\;]+)/ g.add_edge $1, $2 end } p "vertices: #{g.num_vertices}…
The visualization tool "dot" turns file dependency in a diagram. Given root file(s) , a ruby script below visits dependency files to put directed edges in a "dot" form: out = Array.new while path = ARGV.shift File::open(path) {|file| while…
My old Windows Me does not like the installed "irb.bat" script. Work around is to copy it to "irb" and edit to remove several top and bottom lines as below: 1,4d0 < @echo off < goto endofruby < #!/bin/ruby < # 24,26d19 < __END__ < :endofru…