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.



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

def initialize(repo)
  @repo = repo
end

Instance Method Details

#comments_by_dateObject



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

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



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

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



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

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



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

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



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

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