git_stats 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/README.md +16 -10
  4. data/config/locales/de.yml +2 -0
  5. data/config/locales/en.yml +4 -1
  6. data/lib/git_stats/base.rb +3 -1
  7. data/lib/git_stats/cli.rb +5 -3
  8. data/lib/git_stats/core_extensions/enumerable.rb +10 -0
  9. data/lib/git_stats/generator.rb +4 -4
  10. data/lib/git_stats/git_data/comment_stat.rb +38 -0
  11. data/lib/git_stats/git_data/commit.rb +8 -4
  12. data/lib/git_stats/git_data/repo.rb +46 -13
  13. data/lib/git_stats/git_data/short_stat.rb +1 -1
  14. data/lib/git_stats/git_data/tree.rb +23 -0
  15. data/lib/git_stats/i18n.rb +1 -0
  16. data/lib/git_stats/stats_view/charts/authors_charts.rb +6 -4
  17. data/lib/git_stats/stats_view/charts/charts.rb +1 -1
  18. data/lib/git_stats/stats_view/charts/repo_charts.rb +10 -0
  19. data/lib/git_stats/stats_view/view.rb +2 -1
  20. data/lib/git_stats/version.rb +1 -1
  21. data/spec/factories.rb +8 -0
  22. data/spec/git_data/commit_range_spec.rb +2 -2
  23. data/spec/git_data/commit_spec.rb +1 -1
  24. data/spec/git_data/generator_spec.rb +5 -7
  25. data/spec/git_data/repo_spec.rb +5 -5
  26. data/spec/git_data/short_stat_spec.rb +1 -1
  27. data/spec/git_data/tree_spec.rb +41 -0
  28. data/spec/integration/author_spec.rb +2 -2
  29. data/spec/integration/file_spec.rb +2 -2
  30. data/spec/integration/shared.rb +91 -0
  31. data/spec/integration/tree_spec.rb +197 -0
  32. data/templates/author_details/_author_details.haml +4 -4
  33. data/templates/authors/_authors.haml +5 -5
  34. data/templates/comments/_comments.haml +11 -0
  35. data/templates/comments/by_date.haml +1 -0
  36. data/templates/general.haml +3 -0
  37. metadata +31 -25
  38. data/lib/git_stats/by_field_finder.rb +0 -7
  39. data/spec/by_field_finder_spec.rb +0 -25
@@ -15,21 +15,21 @@
15
15
  %h1.pagination-centered= page.t
16
16
 
17
17
  -if page == :commits_by_date
18
- = high_stock("charts.commits_sum_by_author_by_date", charts.commits_sum_by_author_by_date(4, [author]))
18
+ = high_stock("charts.commits_sum_by_author_by_date", charts.commits_sum_by_author_by_date([author]))
19
19
  %small
20
20
  %center= "5 #{:best_authors_shown.t}"
21
21
 
22
22
  -elsif page == :changed_lines_by_date
23
- = high_stock("charts.changed_lines_by_author_by_date", charts.changed_lines_by_author_by_date(4, [author]))
23
+ = high_stock("charts.changed_lines_by_author_by_date", charts.changed_lines_by_author_by_date([author]))
24
24
  %small
25
25
  %center= "5 #{:best_authors_shown.t}"
26
26
 
27
27
  -elsif page == :insertions_by_date
28
- = high_stock("charts.insertions_by_author_by_date", charts.insertions_by_author_by_date(4, [author]))
28
+ = high_stock("charts.insertions_by_author_by_date", charts.insertions_by_author_by_date([author]))
29
29
  %small
30
30
  %center= "5 #{:best_authors_shown.t}"
31
31
 
32
32
  -elsif page == :deletions_by_date
33
- = high_stock("charts.deletions_by_author_by_date", charts.deletions_by_author_by_date(4, [author]))
33
+ = high_stock("charts.deletions_by_author_by_date", charts.deletions_by_author_by_date([author]))
34
34
  %small
35
35
  %center= "5 #{:best_authors_shown.t}"
@@ -43,26 +43,26 @@
43
43
  %a.btn{:href => "#{author.dirname}/author_details/commits_by_date.html"}= :details.t
44
44
 
45
45
  -elsif page == :commits_count_by_author
46
- = high_chart("charts.commits_count_by_author", charts.commits_count_by_author(4))
46
+ = high_chart("charts.commits_count_by_author", charts.commits_count_by_author)
47
47
  %small
48
48
  %center= "5 #{:best_authors_shown.t}"
49
49
 
50
50
  -elsif page == :commits_sum_by_author_by_date
51
- = high_stock("charts.commits_sum_by_author_by_date", charts.commits_sum_by_author_by_date(4))
51
+ = high_stock("charts.commits_sum_by_author_by_date", charts.commits_sum_by_author_by_date)
52
52
  %small
53
53
  %center= "5 #{:best_authors_shown.t}"
54
54
 
55
55
  -elsif page == :changed_lines_by_author_by_date
56
- = high_stock("charts.changed_lines_by_author_by_date", charts.changed_lines_by_author_by_date(4))
56
+ = high_stock("charts.changed_lines_by_author_by_date", charts.changed_lines_by_author_by_date)
57
57
  %small
58
58
  %center= "5 #{:best_authors_shown.t}"
59
59
 
60
60
  -elsif page == :insertions_by_author_by_date
61
- = high_stock("charts.insertions_by_author_by_date", charts.insertions_by_author_by_date(4))
61
+ = high_stock("charts.insertions_by_author_by_date", charts.insertions_by_author_by_date)
62
62
  %small
63
63
  %center= "5 #{:best_authors_shown.t}"
64
64
 
65
65
  -elsif page == :deletions_by_author_by_date
66
- = high_stock("charts.deletions_by_author_by_date", charts.deletions_by_author_by_date(4))
66
+ = high_stock("charts.deletions_by_author_by_date", charts.deletions_by_author_by_date)
67
67
  %small
68
68
  %center= "5 #{:best_authors_shown.t}"
@@ -0,0 +1,11 @@
1
+ .tabbable.tabs-left
2
+ %ul.nav.nav-tabs
3
+ %li{class: page == :comments_by_date ? "active" : ""}
4
+ %a{:href => 'by_date.html'}= :comments_by_date.t
5
+
6
+ .tab-content
7
+ .tab-pane.active
8
+ .page-header
9
+ %h1.pagination-centered= page.t
10
+ - if page == :comments_by_date
11
+ = high_stock("comments_by_date", charts.comments_by_date)
@@ -0,0 +1 @@
1
+ = render_partial('comments/_comments', page: :comments_by_date)
@@ -5,6 +5,9 @@
5
5
  %tr
6
6
  %td= :project_version.t
7
7
  %td= repo.project_version
8
+ %tr
9
+ %td= :tree_path.t
10
+ %td= repo.tree_path
8
11
  %tr
9
12
  %td= :generated_at.t
10
13
  %td= I18n.localize(DateTime.now, format: :long)
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Gieniusz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2014-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '4.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tilt
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.4'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: haml
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '4.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: lazy_high_charts
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.4'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: i18n
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: thor
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: Git history statistics generator
@@ -116,9 +116,9 @@ executables:
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - .gitignore
120
- - .gitmodules
121
- - .rspec
119
+ - ".gitignore"
120
+ - ".gitmodules"
121
+ - ".rspec"
122
122
  - Gemfile
123
123
  - LICENSE.txt
124
124
  - README.md
@@ -132,8 +132,8 @@ files:
132
132
  - git_stats.gemspec
133
133
  - lib/git_stats.rb
134
134
  - lib/git_stats/base.rb
135
- - lib/git_stats/by_field_finder.rb
136
135
  - lib/git_stats/cli.rb
136
+ - lib/git_stats/core_extensions/enumerable.rb
137
137
  - lib/git_stats/core_extensions/hash.rb
138
138
  - lib/git_stats/core_extensions/string.rb
139
139
  - lib/git_stats/core_extensions/symbol.rb
@@ -143,9 +143,11 @@ files:
143
143
  - lib/git_stats/git_data/blob.rb
144
144
  - lib/git_stats/git_data/command_parser.rb
145
145
  - lib/git_stats/git_data/command_runner.rb
146
+ - lib/git_stats/git_data/comment_stat.rb
146
147
  - lib/git_stats/git_data/commit.rb
147
148
  - lib/git_stats/git_data/repo.rb
148
149
  - lib/git_stats/git_data/short_stat.rb
150
+ - lib/git_stats/git_data/tree.rb
149
151
  - lib/git_stats/hash_initializable.rb
150
152
  - lib/git_stats/i18n.rb
151
153
  - lib/git_stats/stats_view/charts/activity_charts.rb
@@ -158,7 +160,6 @@ files:
158
160
  - lib/git_stats/stats_view/view_data.rb
159
161
  - lib/git_stats/validator.rb
160
162
  - lib/git_stats/version.rb
161
- - spec/by_field_finder_spec.rb
162
163
  - spec/factories.rb
163
164
  - spec/git_data/activity_spec.rb
164
165
  - spec/git_data/author_spec.rb
@@ -169,12 +170,14 @@ files:
169
170
  - spec/git_data/generator_spec.rb
170
171
  - spec/git_data/repo_spec.rb
171
172
  - spec/git_data/short_stat_spec.rb
173
+ - spec/git_data/tree_spec.rb
172
174
  - spec/hash_extension_spec.rb
173
175
  - spec/integration/activity_spec.rb
174
176
  - spec/integration/author_spec.rb
175
177
  - spec/integration/file_spec.rb
176
178
  - spec/integration/repo_spec.rb
177
179
  - spec/integration/shared.rb
180
+ - spec/integration/tree_spec.rb
178
181
  - spec/spec_helper.rb
179
182
  - templates/activity/_activity.haml
180
183
  - templates/activity/by_date.haml
@@ -205,6 +208,8 @@ files:
205
208
  - templates/authors/commits_sum_by_author_by_date.haml
206
209
  - templates/authors/deletions_by_author_by_date.haml
207
210
  - templates/authors/insertions_by_author_by_date.haml
211
+ - templates/comments/_comments.haml
212
+ - templates/comments/by_date.haml
208
213
  - templates/files/_files.haml
209
214
  - templates/files/by_date.haml
210
215
  - templates/files/by_extension.haml
@@ -223,22 +228,21 @@ require_paths:
223
228
  - lib
224
229
  required_ruby_version: !ruby/object:Gem::Requirement
225
230
  requirements:
226
- - - '>='
231
+ - - ">="
227
232
  - !ruby/object:Gem::Version
228
233
  version: 1.9.2
229
234
  required_rubygems_version: !ruby/object:Gem::Requirement
230
235
  requirements:
231
- - - '>='
236
+ - - ">="
232
237
  - !ruby/object:Gem::Version
233
238
  version: '0'
234
239
  requirements: []
235
240
  rubyforge_project:
236
- rubygems_version: 2.1.10
241
+ rubygems_version: 2.2.2
237
242
  signing_key:
238
243
  specification_version: 4
239
244
  summary: HTML statistics generator from git repository
240
245
  test_files:
241
- - spec/by_field_finder_spec.rb
242
246
  - spec/factories.rb
243
247
  - spec/git_data/activity_spec.rb
244
248
  - spec/git_data/author_spec.rb
@@ -249,10 +253,12 @@ test_files:
249
253
  - spec/git_data/generator_spec.rb
250
254
  - spec/git_data/repo_spec.rb
251
255
  - spec/git_data/short_stat_spec.rb
256
+ - spec/git_data/tree_spec.rb
252
257
  - spec/hash_extension_spec.rb
253
258
  - spec/integration/activity_spec.rb
254
259
  - spec/integration/author_spec.rb
255
260
  - spec/integration/file_spec.rb
256
261
  - spec/integration/repo_spec.rb
257
262
  - spec/integration/shared.rb
263
+ - spec/integration/tree_spec.rb
258
264
  - spec/spec_helper.rb
@@ -1,7 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- module ByFieldFinder
3
- def method_missing(name, *args, &block)
4
- field = name[/^by_(.*)$/, 1]
5
- field ? find { |e| e.send(field) == args.first } : super
6
- end
7
- end
@@ -1,25 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'spec_helper'
3
-
4
- describe ByFieldFinder do
5
- let(:sut) { [double(field1: 'aa', field2: 'bb'), double(field1: 'cc', field2: 'bb'), double(field1: 'aa', field2: 'dd')].extend(ByFieldFinder) }
6
-
7
- [
8
- {field: :field1, search_value: 'aa', matching_index: 0},
9
- {field: :field1, search_value: 'cc', matching_index: 1},
10
- {field: :field2, search_value: 'bb', matching_index: 0},
11
- {field: :field2, search_value: 'dd', matching_index: 2},
12
- ].each do |test_params|
13
- it 'should return first matching object' do
14
- sut.send("by_#{test_params[:field]}", test_params[:search_value]).should == sut[test_params[:matching_index]]
15
- end
16
- end
17
-
18
- it 'should return nil if no object matches' do
19
- sut.by_field1('xx').should == nil
20
- end
21
-
22
- it 'should throw exception if elements doesnt respond to given field' do
23
- expect { sut.by_non_existing_field }.to raise_error
24
- end
25
- end