Method: Codependency::Graph#require

Defined in:
lib/codependency/graph.rb

#require(file) ⇒ Object Also known as: <<

Add the given file to this graph. Creates a new entry in the graph, the key of which is the relative path to this file and the value is the array of relative paths to its dependencies. Any dependent files will also be recursively added to this graph.



12
13
14
15
16
17
18
19
# File 'lib/codependency/graph.rb', line 12

def require( file )
  return if key?( file )

  self[ file ] = deps( file )
  self[ file ].each do |dependency|
    self.require dependency
  end
end