Class: TFSGraph::Project

Inherits:
Entity
  • Object
show all
Extended by:
Comparable
Defined in:
lib/tfs_graph/project.rb

Constant Summary collapse

SCHEMA =
{
  name: {key: "Name"}
}

Instance Method Summary collapse

Methods inherited from Entity

inherited

Instance Method Details

#<=>(other) ⇒ Object



12
13
14
# File 'lib/tfs_graph/project.rb', line 12

def <=>(other)
  name <=> other.name
end

#active_branchesObject



33
34
35
# File 'lib/tfs_graph/project.rb', line 33

def active_branches
  branches.reject(&:archived?)
end

#all_activityObject



20
21
22
# File 'lib/tfs_graph/project.rb', line 20

def all_activity
  branches.map {|b| b.changesets }.flatten
end

#all_activity_by_date(limiter = nil) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/tfs_graph/project.rb', line 24

def all_activity_by_date(limiter=nil)
  raise InvalidArgument("parameter must be a Date") unless limiter.nil? || limiter.is_a?(Time)

  activity = all_activity
  activity = activity.select {|c| c.created > limiter } unless limiter.nil?

  activity.group_by(&:formatted_created)
end

#branchesObject



37
38
39
# File 'lib/tfs_graph/project.rb', line 37

def branches
  branches_with_hidden.reject(&:hidden?)
end

#branches_with_hiddenObject



41
42
43
# File 'lib/tfs_graph/project.rb', line 41

def branches_with_hidden
  outgoing(:branches).options(model: Branch).nodes.to_a
end

#last_changeObject



16
17
18
# File 'lib/tfs_graph/project.rb', line 16

def last_change
  branches.map {|b| b.last_changeset }
end