Class: GitStats::GitData::Author
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Inspector
#inspect, #pretty_print, #to_s
#initialize
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
10
11
12
|
# File 'lib/git_stats/git_data/author.rb', line 10
def email
@email
end
|
#name ⇒ Object
Returns the value of attribute name.
10
11
12
|
# File 'lib/git_stats/git_data/author.rb', line 10
def name
@name
end
|
#repo ⇒ Object
Returns the value of attribute repo.
10
11
12
|
# File 'lib/git_stats/git_data/author.rb', line 10
def repo
@repo
end
|
Instance Method Details
#==(other) ⇒ Object
66
67
68
|
# File 'lib/git_stats/git_data/author.rb', line 66
def ==(other)
[repo, name, email] == [other.repo, other.name, other.email]
end
|
#activity ⇒ Object
58
59
60
|
# File 'lib/git_stats/git_data/author.rb', line 58
def activity
@activity ||= Activity.new(commits)
end
|
#changed_lines ⇒ Object
20
21
22
|
# File 'lib/git_stats/git_data/author.rb', line 20
def changed_lines
insertions + deletions
end
|
#commits ⇒ Object
12
13
14
|
# File 'lib/git_stats/git_data/author.rb', line 12
def commits
@commits ||= repo.commits.select { |commit| commit.author == self }
end
|
#commits_sum ⇒ Object
16
17
18
|
# File 'lib/git_stats/git_data/author.rb', line 16
def commits_sum
commits.size
end
|
#commits_sum_by_date ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/git_stats/git_data/author.rb', line 32
def commits_sum_by_date
sum = 0
commits.map do |commit|
sum += 1
[commit.date, sum]
end
end
|
#deletions ⇒ Object
28
29
30
|
# File 'lib/git_stats/git_data/author.rb', line 28
def deletions
short_stats.sum(&:deletions)
end
|
#dirname ⇒ Object
62
63
64
|
# File 'lib/git_stats/git_data/author.rb', line 62
def dirname
name.underscore.split.join '_'
end
|
#insertions ⇒ Object
24
25
26
|
# File 'lib/git_stats/git_data/author.rb', line 24
def insertions
short_stats.sum(&:insertions)
end
|
#short_stats ⇒ Object
54
55
56
|
# File 'lib/git_stats/git_data/author.rb', line 54
def short_stats
commits.map(&:short_stat)
end
|