Class: Diggit::DevelopersActivity::Analyses::ProjectDevelopersAnalysis
- Inherits:
-
ActivityAnalysis
- Object
- Analysis
- ActivityAnalysis
- Diggit::DevelopersActivity::Analyses::ProjectDevelopersAnalysis
show all
- Defined in:
- lib/diggit/developers_activity/analyses/project_developers_analysis.rb
Overview
Records the activity of developers at the project level, ie, the date at which developers commit
Instance Method Summary
collapse
#load_options
#extract_developers_activity
Instance Method Details
#clean ⇒ Object
35
36
37
|
# File 'lib/diggit/developers_activity/analyses/project_developers_analysis.rb', line 35
def clean
db.client[COL].find({ project: @source.url }).delete_many
end
|
#run ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/diggit/developers_activity/analyses/project_developers_analysis.rb', line 13
def run
super
puts('Extracting project-level activity')
r_last = repo.lookup(src_opt[@source]["R_last"])
r_first_time = repo.lookup(src_opt[@source]["R_first"]).author[:time]
walker = Rugged::Walker.new(repo)
walker.sorting(Rugged::SORT_DATE)
walker.push(r_last)
devs = []
walker.each do |commit|
t = commit.author[:time]
author = Authors.get_author(commit)
devs << { project: @source.url, author: author, time: t }
break if t < r_first_time
end
db.insert(COL, devs)
end
|