Sha256: 844536dcbbdd2fbf41a0436501a29176d32aba52bb033f08d7713f53a2d7222f

Contents?: true

Size: 703 Bytes

Versions: 3

Compression:

Stored size: 703 Bytes

Contents

require 'node'

module DepGraph
  module NodeFinders
    
    #This is a simple example of a custom node finder with a hard coded graph.
    #Note that the file must be named [nodetype]_node_finder.rb containing a class named [Nodetype]NodeFinder
    #To use this example do: depgraph -type test
    class TestNodeFinder
      def location=(loc)
        #we will ignore location in this example
      end
      
      def get_nodes
        #let's return a hardcoded graph with 2 nodes and one dependency between them
        
        node1 = Node.new('node1')
        node2 = Node.new('node2')
        
        node1.depends_on(node2)
        
        return [node1, node2] 
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
depgraph-0.11.0 lib/nodefinders/test_node_finder.rb
DepGraph-0.10.0 lib/nodefinders/test_node_finder.rb
DepGraph-0.9.0 lib/nodefinders/test_node_finder.rb