Class: Metior::Report::Default::RepositoryInformation

Inherits:
View
  • Object
show all
Defined in:
reports/default/views/repository_information.rb

Overview

Author:

  • Sebastian Staudt

Instance Method Summary collapse

Methods inherited from View

inherited, #method_missing, #render, #repository, requires, #respond_to?, #vcs_name

Methods included from ViewHelper

#count, #even_odd, #reset_count

Constructor Details

#initialize(report) ⇒ RepositoryInformation

Returns a new instance of RepositoryInformation.



11
12
13
14
15
# File 'reports/default/views/repository_information.rb', line 11

def initialize(report)
  super

  @activity = repository.commits(report.range).activity
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Metior::Report::View

Instance Method Details

#commit_countObject



17
18
19
# File 'reports/default/views/repository_information.rb', line 17

def commit_count
  repository.commits(@report.range).size
end

#commits_per_active_dayObject



21
22
23
# File 'reports/default/views/repository_information.rb', line 21

def commits_per_active_day
  (@activity[:commits_per_active_day] * 100).round / 100.0
end

#initial_commit_dateObject



25
26
27
# File 'reports/default/views/repository_information.rb', line 25

def initial_commit_date
  @activity[:first_commit_date]
end

#last_commit_dateObject



29
30
31
# File 'reports/default/views/repository_information.rb', line 29

def last_commit_date
  @activity[:last_commit_date]
end

#most_active_dayObject



33
34
35
# File 'reports/default/views/repository_information.rb', line 33

def most_active_day
  @activity[:most_active_day].strftime '%m/%d/%Y'
end

#rangeObject



37
38
39
# File 'reports/default/views/repository_information.rb', line 37

def range
  @report.range
end

#repository_pathObject



41
42
43
# File 'reports/default/views/repository_information.rb', line 41

def repository_path
  repository.path
end