Class: DependenciesGraph
- Inherits:
-
Object
- Object
- DependenciesGraph
- Defined in:
- lib/cocoapods-binary-artifactory-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(options) ⇒ DependenciesGraph
constructor
A new instance of DependenciesGraph.
- #write_graphic_file(options) ⇒ Object
Constructor Details
#initialize(options) ⇒ DependenciesGraph
Returns a new instance of DependenciesGraph.
13 14 15 16 17 18 19 |
# File 'lib/cocoapods-binary-artifactory-cache/dependencies_graph/dependencies_graph.rb', line 13 def initialize() @lockfile = [:lockfile] @devpod_only = [:devpod_only] @max_deps = [:max_deps].to_i if [:max_deps] # A normal edge is an edge (one direction) from library A to library B which is a dependency of A. @invert_edge = [:invert_edge] || false 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.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cocoapods-binary-artifactory-cache/dependencies_graph/dependencies_graph.rb', line 23 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
35 36 37 |
# File 'lib/cocoapods-binary-artifactory-cache/dependencies_graph/dependencies_graph.rb', line 35 def write_graphic_file() graph.write_to_graphic_file() end |