git_stats 1.0.0

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 (92) hide show
  1. data/.gitignore +21 -0
  2. data/.gitmodules +3 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +13 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +44 -0
  7. data/Rakefile +1 -0
  8. data/bin/git_stats +11 -0
  9. data/config/locales/en.yml +56 -0
  10. data/config/locales/pl.yml +56 -0
  11. data/config/locales/pl_default.yml +224 -0
  12. data/git_stats.gemspec +27 -0
  13. data/lib/git_stats.rb +15 -0
  14. data/lib/git_stats/base.rb +30 -0
  15. data/lib/git_stats/by_field_finder.rb +7 -0
  16. data/lib/git_stats/cli.rb +17 -0
  17. data/lib/git_stats/core_extensions/hash.rb +9 -0
  18. data/lib/git_stats/core_extensions/string.rb +6 -0
  19. data/lib/git_stats/core_extensions/symbol.rb +6 -0
  20. data/lib/git_stats/generator.rb +32 -0
  21. data/lib/git_stats/git_data/activity.rb +78 -0
  22. data/lib/git_stats/git_data/author.rb +67 -0
  23. data/lib/git_stats/git_data/blob.rb +38 -0
  24. data/lib/git_stats/git_data/command_parser.rb +33 -0
  25. data/lib/git_stats/git_data/command_runner.rb +10 -0
  26. data/lib/git_stats/git_data/commit.rb +63 -0
  27. data/lib/git_stats/git_data/repo.rb +137 -0
  28. data/lib/git_stats/git_data/short_stat.rb +33 -0
  29. data/lib/git_stats/hash_initializable.rb +7 -0
  30. data/lib/git_stats/i18n.rb +2 -0
  31. data/lib/git_stats/stats_view/charts/activity_charts.rb +70 -0
  32. data/lib/git_stats/stats_view/charts/authors_charts.rb +35 -0
  33. data/lib/git_stats/stats_view/charts/chart.rb +119 -0
  34. data/lib/git_stats/stats_view/charts/charts.rb +35 -0
  35. data/lib/git_stats/stats_view/charts/repo_charts.rb +53 -0
  36. data/lib/git_stats/stats_view/template.rb +20 -0
  37. data/lib/git_stats/stats_view/view.rb +72 -0
  38. data/lib/git_stats/stats_view/view_data.rb +31 -0
  39. data/lib/git_stats/version.rb +4 -0
  40. data/spec/by_field_finder_spec.rb +25 -0
  41. data/spec/factories.rb +25 -0
  42. data/spec/git_data/activity_spec.rb +38 -0
  43. data/spec/git_data/author_spec.rb +25 -0
  44. data/spec/git_data/blob_spec.rb +25 -0
  45. data/spec/git_data/cli_spec.rb +20 -0
  46. data/spec/git_data/command_observer_spec.rb +35 -0
  47. data/spec/git_data/commit_range_spec.rb +47 -0
  48. data/spec/git_data/commit_spec.rb +48 -0
  49. data/spec/git_data/generator_spec.rb +46 -0
  50. data/spec/git_data/repo_spec.rb +46 -0
  51. data/spec/git_data/short_stat_spec.rb +28 -0
  52. data/spec/hash_extension_spec.rb +26 -0
  53. data/spec/integration/activity_spec.rb +33 -0
  54. data/spec/integration/author_spec.rb +67 -0
  55. data/spec/integration/file_spec.rb +31 -0
  56. data/spec/integration/repo_spec.rb +68 -0
  57. data/spec/integration/shared.rb +37 -0
  58. data/spec/spec_helper.rb +13 -0
  59. data/templates/activity/_activity.haml +101 -0
  60. data/templates/activity/by_date.haml +1 -0
  61. data/templates/activity/day_of_week.haml +1 -0
  62. data/templates/activity/hour_of_day.haml +1 -0
  63. data/templates/activity/hour_of_week.haml +1 -0
  64. data/templates/activity/month_of_year.haml +1 -0
  65. data/templates/activity/year.haml +1 -0
  66. data/templates/activity/year_month.haml +1 -0
  67. data/templates/assets/bootstrap/css/bootstrap-responsive.css +1058 -0
  68. data/templates/assets/bootstrap/css/bootstrap-responsive.min.css +9 -0
  69. data/templates/assets/bootstrap/css/bootstrap.css +5774 -0
  70. data/templates/assets/bootstrap/css/bootstrap.min.css +9 -0
  71. data/templates/assets/bootstrap/img/glyphicons-halflings-white.png +0 -0
  72. data/templates/assets/bootstrap/img/glyphicons-halflings.png +0 -0
  73. data/templates/assets/bootstrap/js/bootstrap.js +2027 -0
  74. data/templates/assets/bootstrap/js/bootstrap.min.js +6 -0
  75. data/templates/assets/highstock.js +305 -0
  76. data/templates/assets/jquery.min.js +2 -0
  77. data/templates/authors/_authors.haml +66 -0
  78. data/templates/authors/best_authors.haml +1 -0
  79. data/templates/authors/changed_lines_by_author_by_date.haml +1 -0
  80. data/templates/authors/commits_sum_by_author_by_date.haml +1 -0
  81. data/templates/authors/deletions_by_author_by_date.haml +1 -0
  82. data/templates/authors/insertions_by_author_by_date.haml +1 -0
  83. data/templates/files/_files.haml +15 -0
  84. data/templates/files/by_date.haml +1 -0
  85. data/templates/files/by_extension.haml +1 -0
  86. data/templates/general.haml +28 -0
  87. data/templates/layout.haml +29 -0
  88. data/templates/lines/_lines.haml +15 -0
  89. data/templates/lines/by_date.haml +1 -0
  90. data/templates/lines/by_extension.haml +1 -0
  91. data/templates/static/index.html +5 -0
  92. metadata +268 -0
@@ -0,0 +1,21 @@
1
+ # gem
2
+ *.gem
3
+ *.rbc
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+
20
+ # rubymine
21
+ .idea
@@ -0,0 +1,3 @@
1
+ [submodule "spec/integration/test_repo"]
2
+ path = spec/integration/test_repo
3
+ url = git://github.com/tomgi/git_stats_test_repo.git
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color --format documentation
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in git_stats.gemspec
4
+ gemspec
5
+
6
+
7
+ group :test do
8
+ gem 'rake'
9
+ gem 'pry'
10
+ gem 'rspec'
11
+ gem 'factory_girl'
12
+ gem 'simplecov'
13
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Tomasz Gieniusz
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,44 @@
1
+ # GitStats
2
+
3
+ GitStats is a git repository statistics generator.
4
+ It browses the repository and outputs html page with some statistics.
5
+
6
+ ## Examples
7
+ * [devise](http://tomgi.github.com/git_stats/examples/devise/index.html)
8
+ * [devise_invitable](http://tomgi.github.com/git_stats/examples/devise_invitable/index.html)
9
+ * [jquery](http://tomgi.github.com/git_stats/examples/jquery/index.html)
10
+ * [paperclip](http://tomgi.github.com/git_stats/examples/paperclip/index.html)
11
+ * [rails](http://tomgi.github.com/git_stats/examples/rails/index.html)
12
+
13
+ ## Installation
14
+
15
+ $ gem install git_stats
16
+
17
+ ## Usage
18
+
19
+ ### Generator
20
+
21
+ $ git_stats repo_path output_directory
22
+ $ favorite_browser output_directory/index.html
23
+
24
+ ### API usage example
25
+
26
+ > repo = GitStats::GitData::Repo.new(path: '.')
27
+ > repo.authors
28
+ => [...]
29
+ > repo.commits
30
+ => [...]
31
+ > commit.files
32
+ => [...]
33
+
34
+ ## Build Status
35
+ [![Build Status](https://secure.travis-ci.org/tomgi/git_stats.png)](https://secure.travis-ci.org/tomgi/git_stats)
36
+
37
+ ## Contributing
38
+
39
+ 1. Fork it
40
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
41
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
42
+ 4. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
43
+ 5. Push to the branch (`git push origin my-new-feature`)
44
+ 6. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+
4
+ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
5
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
6
+
7
+ # start up the CLI
8
+ require "git_stats/cli"
9
+
10
+ cli = GitStats::CLI.new
11
+ cli.start(*ARGV)
@@ -0,0 +1,56 @@
1
+ en:
2
+ project_name: Project name
3
+ project_version: Project version
4
+ generated_at: Generated at
5
+ generator: Generator
6
+ report_period: Report period
7
+ total_files: Total files
8
+ total_lines: Total lines
9
+ total_commits: Total commits
10
+ authors: Authors
11
+ commits: Commits
12
+ commits_by_hour: Commits by hour
13
+ files: Files
14
+ lines: Lines
15
+ files_by_date: Files by date
16
+ lines_by_date: Lines by date
17
+ files_by_extension: Files by extension
18
+ lines_by_extension: Lines by extension
19
+ hour_of_day: Hour of day
20
+ hour: Hour
21
+ percentage: Percentage
22
+ day: Day
23
+ day_of_week: Day of week
24
+ hour_of_week: Hour of week
25
+ month: Month
26
+ month_of_year: Month of year
27
+ year_month: Year and month
28
+ commits_by_wday: Commits by day of week
29
+ commits_by_month: Commits by month
30
+ commits_by_year_month: Commits by year and month
31
+ commits_by_month_of_year: Commits by month of year
32
+ year: Year
33
+ commits_by_year: Commits by year
34
+ activity: Activity
35
+ activity_by_date: Activity by date
36
+ commits_by_date: Commits by date
37
+ insertions_by_author: Lines added by author
38
+ deletions_by_author: Lines deleted by author
39
+ changed_lines_by_author: Changed lines by author
40
+ best_authors_shown: best authors shown
41
+ commits_count_by_author: Commits count by author
42
+ commits_sum_by_author_by_date: Commits sum by author by date
43
+ insertions_by_author_by_date: Lines added by author by date
44
+ deletions_by_author_by_date: Lines deleted by author by date
45
+ changed_lines_by_author_by_date: Changed lines by author by date
46
+ best_authors: Best authors
47
+ insertions: Lines added
48
+ deletions: Lines deleted
49
+ first_commit: First_commit
50
+ last_commit: Last commit
51
+ author: Author
52
+ show_more: More
53
+ close: Close
54
+ binary: Binary
55
+ text: Text
56
+ general: General
@@ -0,0 +1,56 @@
1
+ pl:
2
+ project_name: Nazwa projektu
3
+ project_version: Wersja projektu
4
+ generated_at: Wygenerowano
5
+ generator: Generator
6
+ report_period: Okres raportu
7
+ total_files: Liczba plików
8
+ total_lines: Liczba linii
9
+ total_commits: Liczba commitów
10
+ authors: Autorzy
11
+ commits: Commity
12
+ commits_by_hour: Commity po godzinie
13
+ files: Pliki
14
+ lines: Linie
15
+ files_by_date: Pliki po dacie
16
+ lines_by_date: Linie po dacie
17
+ files_by_extension: Pliki po rozszerzeniu
18
+ lines_by_extension: Linie po rozszerzeniu
19
+ hour_of_day: Godzina dnia
20
+ hour: Godzina
21
+ percentage: Procent
22
+ day: Dzień
23
+ day_of_week: Dzień tygodnia
24
+ hour_of_week: Godzina tygodnia
25
+ month: Miesiąc
26
+ month_of_year: Miesiąc roku
27
+ year_month: Rok i miesiąc
28
+ commits_by_wday: Commity po dniu tygodnia
29
+ commits_by_month: Commity po miesiącu
30
+ commits_by_year_month: Commity po roku i miesiącu
31
+ commits_by_month_of_year: Commity po miesiącu i roku
32
+ year: Rok
33
+ commits_by_year: Commity po roku
34
+ activity: Aktywność
35
+ activity_by_date: Aktywność po dacie
36
+ commits_by_date: Commity po dacie
37
+ insertions_by_author: Dodane linie
38
+ deletions_by_author: Usunięte linie
39
+ changed_lines_by_author: Zmienione linie
40
+ best_authors_shown: najlepszych autorów
41
+ commits_count_by_author: Liczba commitów
42
+ commits_sum_by_author_by_date: Liczba commitów po dacie
43
+ insertions_by_author_by_date: Dodane linie po dacie
44
+ deletions_by_author_by_date: Usunięte linie po dacie
45
+ changed_lines_by_author_by_date: Zmienione linie po dacie
46
+ best_authors: Najlepsi autorzy
47
+ insertions: Dodane linie
48
+ deletions: Usunięte linie
49
+ first_commit: Pierwszy commit
50
+ last_commit: Ostatni commit
51
+ author: Autor
52
+ show_more: Więcej
53
+ close: Zamknij
54
+ binary: Binarne
55
+ text: Tekstowe
56
+ general: Ogólne
@@ -0,0 +1,224 @@
1
+ pl:
2
+ date:
3
+ abbr_day_names:
4
+ - nie
5
+ - pon
6
+ - wto
7
+ - śro
8
+ - czw
9
+ - pią
10
+ - sob
11
+ abbr_month_names:
12
+ -
13
+ - sty
14
+ - lut
15
+ - mar
16
+ - kwi
17
+ - maj
18
+ - cze
19
+ - lip
20
+ - sie
21
+ - wrz
22
+ - paź
23
+ - lis
24
+ - gru
25
+ day_names:
26
+ - niedziela
27
+ - poniedziałek
28
+ - wtorek
29
+ - środa
30
+ - czwartek
31
+ - piątek
32
+ - sobota
33
+ formats:
34
+ default: ! '%d-%m-%Y'
35
+ long: ! '%B %d, %Y'
36
+ short: ! '%d %b'
37
+ month_names:
38
+ -
39
+ - styczeń
40
+ - luty
41
+ - marzec
42
+ - kwiecień
43
+ - maj
44
+ - czerwiec
45
+ - lipiec
46
+ - sierpień
47
+ - wrzesień
48
+ - październik
49
+ - listopad
50
+ - grudzień
51
+ order:
52
+ - :day
53
+ - :month
54
+ - :year
55
+ datetime:
56
+ distance_in_words:
57
+ about_x_hours:
58
+ few: około %{count} godziny
59
+ one: około godziny
60
+ other: około %{count} godzin
61
+ many: około %{count} godzin
62
+ about_x_months:
63
+ few: około %{count} miesiące
64
+ one: około miesiąca
65
+ other: około %{count} miesięcy
66
+ many: około %{count} miesięcy
67
+ about_x_years:
68
+ few: około %{count} lata
69
+ one: około rok
70
+ other: około %{count} lat
71
+ many: około %{count} lat
72
+ almost_x_years:
73
+ few: prawie %{count} lata
74
+ one: prawie rok
75
+ other: prawie %{count} lat
76
+ many: prawie %{count} lat
77
+ half_a_minute: pół minuty
78
+ less_than_x_minutes:
79
+ few: mniej niż %{count} minuty
80
+ one: mniej niż minutę
81
+ other: mniej niż %{count} minut
82
+ many: mniej niż %{count} minut
83
+ less_than_x_seconds:
84
+ few: mniej niż %{count} sekundy
85
+ one: mniej niż sekundę
86
+ other: mniej niż %{count} sekund
87
+ many: mniej niż %{count} sekund
88
+ over_x_years:
89
+ few: ponad %{count} lata
90
+ one: ponad rok
91
+ other: ponad %{count} lat
92
+ many: ponad %{count} lat
93
+ x_days:
94
+ few: ! '%{count} dni'
95
+ one: 1 dzień
96
+ other: ! '%{count} dni'
97
+ many: ! '%{count} dni'
98
+ x_minutes:
99
+ few: ! '%{count} minuty'
100
+ one: 1 minuta
101
+ other: ! '%{count} minut'
102
+ many: ! '%{count} minut'
103
+ x_months:
104
+ few: ! '%{count} miesiące'
105
+ one: 1 miesiąc
106
+ other: ! '%{count} miesięcy'
107
+ many: ! '%{count} miesięcy'
108
+ x_seconds:
109
+ few: ! '%{count} sekundy'
110
+ one: 1 sekunda
111
+ other: ! '%{count} sekund'
112
+ many: ! '%{count} sekund'
113
+ prompts:
114
+ day: Dzień
115
+ hour: Godzina
116
+ minute: Minuta
117
+ month: Miesiąc
118
+ second: Sekundy
119
+ year: Rok
120
+ errors: &errors
121
+ format: ! '%{attribute} %{message}'
122
+ messages:
123
+ accepted: musi zostać zaakceptowane
124
+ blank: nie może być puste
125
+ confirmation: nie zgadza się z potwierdzeniem
126
+ empty: nie może być puste
127
+ equal_to: musi być równe %{count}
128
+ even: musi być parzyste
129
+ exclusion: jest zarezerwowane
130
+ greater_than: musi być większe od %{count}
131
+ greater_than_or_equal_to: musi być większe lub równe %{count}
132
+ inclusion: nie znajduje się na liście dopuszczalnych wartości
133
+ invalid: jest nieprawidłowe
134
+ less_than: musi być mniejsze od %{count}
135
+ less_than_or_equal_to: musi być mniejsze lub równe %{count}
136
+ not_a_number: nie jest liczbą
137
+ not_an_integer: musi być liczbą całkowitą
138
+ odd: musi być nieparzyste
139
+ record_invalid: ! 'Negatywne sprawdzenie poprawności: %{errors}'
140
+ taken: zostało już zajęte
141
+ too_long: jest za długie (maksymalnie %{count} znaków)
142
+ too_short: jest za krótkie (przynajmniej %{count} znaków)
143
+ wrong_length: ma nieprawidłową długość (powinna wynosić %{count} znaków)
144
+ template:
145
+ body: ! 'Błędy dotyczą następujących pól:'
146
+ header:
147
+ one: ! '%{model} nie został zachowany z powodu jednego błędu'
148
+ few: ! '%{model} nie został zachowany z powodu %{count} błędów'
149
+ other: ! '%{model} nie został zachowany z powodu %{count} błędów'
150
+ helpers:
151
+ select:
152
+ prompt: Proszę wybrać
153
+ submit:
154
+ create: Utwórz %{model}
155
+ submit: Zapisz %{model}
156
+ update: Aktualizuj %{model}
157
+ number:
158
+ currency:
159
+ format:
160
+ delimiter: ! ' '
161
+ format: ! '%u %n'
162
+ precision: 2
163
+ separator: ! ','
164
+ significant: false
165
+ strip_insignificant_zeros: true
166
+ unit: PLN
167
+ format:
168
+ delimiter: ! ' '
169
+ precision: 3
170
+ separator: ! ','
171
+ significant: false
172
+ strip_insignificant_zeros: false
173
+ human:
174
+ decimal_units:
175
+ format: ! '%n %u'
176
+ units:
177
+ billion: Miliard
178
+ million: Milion
179
+ quadrillion: Biliard
180
+ thousand: Tysiąc
181
+ trillion: Bilion
182
+ unit: ''
183
+ format:
184
+ delimiter: ''
185
+ precision: 3
186
+ significant: true
187
+ strip_insignificant_zeros: true
188
+ storage_units:
189
+ format: ! '%n %u'
190
+ units:
191
+ byte:
192
+ one: bajt
193
+ few: bajty
194
+ many: bajty
195
+ other: bajty
196
+ gb: GB
197
+ kb: KB
198
+ mb: MB
199
+ tb: TB
200
+ percentage:
201
+ format:
202
+ delimiter: ''
203
+ precision:
204
+ format:
205
+ delimiter: ''
206
+ support:
207
+ array:
208
+ last_word_connector: ! ' oraz '
209
+ two_words_connector: ! ' i '
210
+ words_connector: ! ', '
211
+ time:
212
+ am: przed południem
213
+ formats:
214
+ default: ! '%a, %d %b %Y %H:%M:%S %z'
215
+ long: ! '%B %d, %Y %H:%M'
216
+ short: ! '%d %b %H:%M'
217
+ pm: po południu
218
+ # remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
219
+ activemodel:
220
+ errors:
221
+ <<: *errors
222
+ activerecord:
223
+ errors:
224
+ <<: *errors