#!/usr/bin/env ruby -ws $o ||= false $d ||= false type = ARGV.shift unless type then require "rubygems" hits = Gem.find_files("*_analyzer.rb").map { |s| File.basename s, "_analyzer.rb" } - %w(dep) abort "#{File.basename $0}: Need a type: #{hits.join(", ")}" end require "#{type}_analyzer" name = "#{type.capitalize}Analyzer" klass = Object.const_get name analyzer = klass.new graph = analyzer.run graph.save name, $d ? nil : "png" system "open #{name}.#{$d ? "dot" : "png"}" if $o