Class: DependenciesGraph
- Inherits:
-
Object
- Object
- DependenciesGraph
- Defined in:
- lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb
Overview
Using RGL graph because GraphViz doesn’t store adjacent of a node/vertex but we need to traverse a substree from any node github.com/monora/rgl/blob/master/lib/rgl/adjacency.rb
Instance Method Summary collapse
-
#get_clients(libnames) ⇒ Object
Input : a list of library names.
-
#initialize(lockfile) ⇒ DependenciesGraph
constructor
A new instance of DependenciesGraph.
- #write_graphic_file(options) ⇒ Object
Constructor Details
#initialize(lockfile) ⇒ DependenciesGraph
Returns a new instance of DependenciesGraph.
13 14 15 16 17 |
# File 'lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb', line 13 def initialize(lockfile) @lockfile = lockfile # A normal edge is an edge (one direction) from library A to library B which is a dependency of A. @invert_edge = true end |
Instance Method Details
#get_clients(libnames) ⇒ Object
Input : a list of library names. Output: a set of library names which are clients (directly and indirectly) of those input libraries.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb', line 21 def get_clients(libnames) result = Set.new libnames.each do |lib| if graph.has_vertex?(lib) result.merge(traverse_sub_tree(graph, lib)) else Pod::UI.puts "Warning: cannot find lib: #{lib}" end end result end |
#write_graphic_file(options) ⇒ Object
33 34 35 |
# File 'lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb', line 33 def write_graphic_file() graph.write_to_graphic_file() end |