Class: GitStats::StatsView::Charts::RepoCharts

Inherits:
Object
  • Object
show all
Defined in:
lib/git_stats/stats_view/charts/repo_charts.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo) ⇒ RepoCharts

Returns a new instance of RepoCharts.



6
7
8
# File 'lib/git_stats/stats_view/charts/repo_charts.rb', line 6

def initialize(repo)
  @repo = repo
end

Instance Method Details

#comments_by_dateObject



50
51
52
53
54
55
56
57
58
# File 'lib/git_stats/stats_view/charts/repo_charts.rb', line 50

def comments_by_date
  Chart.new do |f|
    f.date_chart(
        data: @repo.comments_count_by_date,
        title: :comments_by_date.t,
        y_text: :comments.t
    )
  end
end

#files_by_dateObject



30
31
32
33
34
35
36
37
38
# File 'lib/git_stats/stats_view/charts/repo_charts.rb', line 30

def files_by_date
  Chart.new do |f|
    f.date_chart(
        data: @repo.files_count_by_date,
        title: :files_by_date.t,
        y_text: :files.t
    )
  end
end

#files_by_extensionObject



10
11
12
13
14
15
16
17
18
# File 'lib/git_stats/stats_view/charts/repo_charts.rb', line 10

def files_by_extension
  Chart.new do |f|
    f.column_hash_chart(
        data: @repo.files_by_extension_count,
        title: :files_by_extension.t,
        y_text: :files.t
    )
  end
end

#lines_by_dateObject



40
41
42
43
44
45
46
47
48
# File 'lib/git_stats/stats_view/charts/repo_charts.rb', line 40

def lines_by_date
  Chart.new do |f|
    f.date_chart(
        data: @repo.lines_count_by_date,
        title: :lines_by_date.t,
        y_text: :lines.t
    )
  end
end

#lines_by_extensionObject



20
21
22
23
24
25
26
27
28
# File 'lib/git_stats/stats_view/charts/repo_charts.rb', line 20

def lines_by_extension
  Chart.new do |f|
    f.column_hash_chart(
        data: @repo.lines_by_extension,
        title: :lines_by_extension.t,
        y_text: :lines.t
    )
  end
end