Class: RubyCritic::SourceControlSystem::Git::Churn

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/source_control_systems/git/churn.rb

Overview

:reek:TooManyInstanceVariables rubocop:disable Metrics/ClassLength

Instance Method Summary collapse

Constructor Details

#initialize(churn_after: nil, paths: ['.']) ⇒ Churn

:reek:TooManyStatements



27
28
29
30
31
32
33
34
35
# File 'lib/rubycritic/source_control_systems/git/churn.rb', line 27

def initialize(churn_after: nil, paths: ['.'])
  @churn_after = churn_after
  @paths = Array(paths)
  @date = nil
  @stats = {}
  @git_root = find_git_root

  call
end

Instance Method Details

#date_of_last_commit(path) ⇒ Object



41
42
43
# File 'lib/rubycritic/source_control_systems/git/churn.rb', line 41

def date_of_last_commit(path)
  stats(path).date
end

#revisions_count(path) ⇒ Object



37
38
39
# File 'lib/rubycritic/source_control_systems/git/churn.rb', line 37

def revisions_count(path)
  stats(path).count
end