1 # gestalt.rb written by Mitchell Foral. mitchell<att>caladbolg.net.
2 # See COPYING for license information.
3 # Ohcount module tweaked for use by Gestalts.
5 $: << File.expand_path(File.dirname(__FILE__))
9 require "gestalt/trigger"
10 require "gestalt/definition"
11 require "gestalt/base"
12 require "gestalt/definitions"
13 require "gestalt/gestalt_engine"
18 gestalt_engine = Gestalt::GestaltEngine.new
19 gestalt_engine.process(self)
20 gestalt_engine.calc_gestalts
21 gestalt_engine.gestalts
27 @gestalt_engine = Gestalt::GestaltEngine.new
30 @gestalt_engine.process(iter.sf)
33 @gestalt_engine.calc_gestalts
37 @gestalt_engine.gestalts if @gestalt_engine
48 sourcefile_list = Ohcount::SourceFileList.new()
49 sourcefile_list.add_directory('.') if ARGV.size == 0
50 ARGV.each do |file_or_path|
51 if File.directory?(file_or_path)
52 sourcefile_list.add_directory(file_or_path)
54 sourcefile_list.add_file(file_or_path)
57 sourcefile_list.analyze_gestalt()
58 sourcefile_list.gestalts.sort.each do |gestalt|
59 puts "#{gestalt.type}\t#{gestalt.count.to_s.rjust(8)}\t#{gestalt.name}"