Module: TFSGraph::Behaviors::RelatedRepository::Project
- Defined in:
- lib/tfs_graph/behaviors/related_repository/project.rb
Instance Method Summary collapse
- #active ⇒ Object
- #activity(project) ⇒ Object
- #activity_by_date(project, date) ⇒ Object
- #all ⇒ Object
- #branches_for_root(project, root) ⇒ Object
- #changesets_for_root(project, root) ⇒ Object
- #create(args) ⇒ Object
- #find_by_name(name) ⇒ Object
Instance Method Details
#active ⇒ Object
16 17 18 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 16 def active all.reject &:hidden? end |
#activity(project) ⇒ Object
35 36 37 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 35 def activity(project) project.branches.map {|b| b.changesets }.flatten end |
#activity_by_date(project, date) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 39 def activity_by_date(project, date) activity = activity(project) activity = activity.select {|c| c.created > date } unless date.nil? activity end |
#all ⇒ Object
12 13 14 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 12 def all get_nodes(root, :outgoing, :projects, TFSGraph::Project) end |
#branches_for_root(project, root) ⇒ Object
27 28 29 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 27 def branches_for_root(project, root) project.branches.select {|b| b.root == branch.path || b.original_path == branch.path} end |
#changesets_for_root(project, root) ⇒ Object
31 32 33 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 31 def changesets_for_root(project, root) branches_for_root(project, root).map(&:changesets).flatten.sort end |
#create(args) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 5 def create(args) obj = super relate :projects, root, obj.db_object obj end |
#find_by_name(name) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/tfs_graph/behaviors/related_repository/project.rb', line 20 def find_by_name(name) project = all.detect {|p| p.name == name } raise TFSGraph::Repository::NotFound, "No project found for #{name}" if project.nil? project end |