Class: Metior::Report::Default::RepositoryInformation
- Inherits:
-
View
- Object
- Mustache
- View
- Metior::Report::Default::RepositoryInformation
show all
- Defined in:
- reports/default/views/repository_information.rb
Overview
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
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_count ⇒ Object
17
18
19
|
# File 'reports/default/views/repository_information.rb', line 17
def commit_count
repository.commits(@report.range).size
end
|
#commits_per_active_day ⇒ Object
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_date ⇒ Object
25
26
27
|
# File 'reports/default/views/repository_information.rb', line 25
def initial_commit_date
@activity[:first_commit_date]
end
|
#last_commit_date ⇒ Object
29
30
31
|
# File 'reports/default/views/repository_information.rb', line 29
def last_commit_date
@activity[:last_commit_date]
end
|
#most_active_day ⇒ Object
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
|
37
38
39
|
# File 'reports/default/views/repository_information.rb', line 37
def range
@report.range
end
|
#repository_path ⇒ Object
41
42
43
|
# File 'reports/default/views/repository_information.rb', line 41
def repository_path
repository.path
end
|