module TFSGraph::Behaviors::Neo4jRepository::Branch
Public Instance Methods
absolute_root_for(branch)
click to toggle source
# File lib/tfs_graph/behaviors/neo4j_repository/branch.rb, line 17 def absolute_root_for(branch) root = branch proj = project_for_branch branch until(root.master?) do root = proj.branches.detect {|b| b.path == root.root } end root end
find_by_path(path)
click to toggle source
# File lib/tfs_graph/behaviors/neo4j_repository/branch.rb, line 10 def find_by_path(path) branch = Neo4j::Label.query(:branch, conditions: {path: path}).first raise TFSGraph::Repository::NotFound, "No branch found for #{path}" if branch.nil? rebuild branch end
find_in_project(project, path)
click to toggle source
# File lib/tfs_graph/behaviors/neo4j_repository/branch.rb, line 5 def find_in_project(project, path) # project.branches.detect {|b| b.path == path } rebuild Neo4j::Label.query(:branch, conditions: {path: path, project: project.name }).first end
project_for_branch(branch)
click to toggle source
# File lib/tfs_graph/behaviors/neo4j_repository/branch.rb, line 28 def project_for_branch(branch) RepositoryRegistry.instance.project_repository.find_by_name branch.project end
Private Instance Methods
fetch_existing_record(obj)
click to toggle source
# File lib/tfs_graph/behaviors/neo4j_repository/branch.rb, line 33 def fetch_existing_record(obj) find_by_path(obj.path).db_object end