Class: Churn::GitAnalyzer
Overview
analizes git SCM to find recently changed files, and what lines have been altered
Class Method Summary
collapse
Instance Method Summary
collapse
#get_updated_files_change_info, #get_updated_files_from_log, #initialize, set_source_control
Class Method Details
.supported? ⇒ Boolean
6
7
8
|
# File 'lib/churn/scm/git_analyzer.rb', line 6
def self.supported?
!!(`git branch 2>&1` && $?.success?)
end
|
Instance Method Details
#get_commit_history ⇒ Object
18
19
20
|
# File 'lib/churn/scm/git_analyzer.rb', line 18
def get_commit_history
`git log --reverse --pretty=format:"%H"`.split(/\n/).reject{|line| line == ""}
end
|
#get_logs ⇒ Object
10
11
12
|
# File 'lib/churn/scm/git_analyzer.rb', line 10
def get_logs
`git log #{date_range} --name-only --pretty=format:`.split(/\n/).reject{|line| line == ""}
end
|
#get_revisions ⇒ Object
14
15
16
|
# File 'lib/churn/scm/git_analyzer.rb', line 14
def get_revisions
`git log #{date_range} --pretty=format:"%H"`.split(/\n/).reject{|line| line == ""}
end
|