Class: FileGraph

Inherits:
Graph show all
Defined in:
lib/codegraph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Graph

#empty?

Constructor Details

#initialize(config) ⇒ FileGraph

Returns a new instance of FileGraph.



292
293
294
295
296
297
298
299
300
301
# File 'lib/codegraph.rb', line 292

def initialize(config)
  super(self.class.to_s)
  @config      = config
  @debug       = @config[:debug]
  @parser      = CodeParser.new
  @parser.read(*@config[:filelist])
  @funx,@files = @parser.funx, @parser.files

  scan
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



291
292
293
# File 'lib/codegraph.rb', line 291

def files
  @files
end

#funxObject (readonly)

Returns the value of attribute funx.



291
292
293
# File 'lib/codegraph.rb', line 291

def funx
  @funx
end

Instance Method Details

#scanObject



303
304
305
306
307
308
309
310
311
312
# File 'lib/codegraph.rb', line 303

def scan
  leaf_node = white + filled
  @files.each {|file,myfunx|
    subgraph "cluster_#{rand(1000)}_#{file}" do
      label file
      graph_attribs << blue << filled << lightgray
      myfunx.each {|func| node(func)}
    end
  }
end