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.



283
284
285
286
287
288
289
290
291
292
# File 'lib/codegraph.rb', line 283

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.



282
283
284
# File 'lib/codegraph.rb', line 282

def files
  @files
end

#funxObject (readonly)

Returns the value of attribute funx.



282
283
284
# File 'lib/codegraph.rb', line 282

def funx
  @funx
end

Instance Method Details

#scanObject



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

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