gitstats-ruby 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 (66) hide show
  1. data/.gitignore +3 -0
  2. data/LICENSE +674 -0
  3. data/README.markdown +53 -0
  4. data/bin/gitstats +176 -0
  5. data/gitstats-ruby.gemspec +22 -0
  6. data/lib/gitstats.rb +18 -0
  7. data/lib/gitstats/author.rb +41 -0
  8. data/lib/gitstats/git.rb +158 -0
  9. data/lib/gitstats/renderer.rb +30 -0
  10. data/lib/gitstats/renderer/gnuplot.rb +150 -0
  11. data/lib/gitstats/renderer/haml.rb +70 -0
  12. data/lib/gitstats/renderer/sass.rb +33 -0
  13. data/lib/gitstats/statgen.rb +116 -0
  14. data/lib/gitstats/stats.rb +12 -0
  15. data/lib/gitstats/stats/commit.rb +48 -0
  16. data/lib/gitstats/stats/commit/author.rb +17 -0
  17. data/lib/gitstats/stats/commit/time.rb +92 -0
  18. data/lib/gitstats/stats/file.rb +15 -0
  19. data/lib/gitstats/stats/file/filetype.rb +14 -0
  20. data/lib/gitstats/yearmonth.rb +39 -0
  21. data/template/activity.haml +3 -0
  22. data/template/asc.gif +0 -0
  23. data/template/authors.haml +2 -0
  24. data/template/bg.gif +0 -0
  25. data/template/commits_per_hour.plot +14 -0
  26. data/template/commits_per_month.plot +15 -0
  27. data/template/commits_per_wday.plot +15 -0
  28. data/template/commits_per_year.plot +11 -0
  29. data/template/commits_per_yearmonth.plot +11 -0
  30. data/template/desc.gif +0 -0
  31. data/template/filechanges_by_yearmonth.plot +17 -0
  32. data/template/files.haml +2 -0
  33. data/template/files_by_yearmonth.plot +11 -0
  34. data/template/helpers/block.rb +26 -0
  35. data/template/helpers/config.rb +12 -0
  36. data/template/helpers/names.rb +76 -0
  37. data/template/helpers/utils.rb +16 -0
  38. data/template/index.haml +2 -0
  39. data/template/jquery.js +4 -0
  40. data/template/jquery.tablesorter.js +4 -0
  41. data/template/lastweeks.plot +14 -0
  42. data/template/layouts/default.haml +43 -0
  43. data/template/linechanges_by_yearmonth.plot +17 -0
  44. data/template/lines.haml +2 -0
  45. data/template/lines_by_yearmonth.plot +11 -0
  46. data/template/partials/authors.haml +30 -0
  47. data/template/partials/blockheader.haml +2 -0
  48. data/template/partials/blocktoc.haml +7 -0
  49. data/template/partials/commits_per_month.haml +27 -0
  50. data/template/partials/commits_per_year.haml +27 -0
  51. data/template/partials/commits_per_yearmonth.haml +27 -0
  52. data/template/partials/day_of_week.haml +28 -0
  53. data/template/partials/filechanges_by_yearmonth.haml +3 -0
  54. data/template/partials/files_by_yearmonth.haml +3 -0
  55. data/template/partials/filetypes.haml +23 -0
  56. data/template/partials/general.haml +34 -0
  57. data/template/partials/hour_of_day.haml +28 -0
  58. data/template/partials/hour_of_week.haml +24 -0
  59. data/template/partials/lastweeks.haml +24 -0
  60. data/template/partials/linechanges_by_yearmonth.haml +3 -0
  61. data/template/partials/lines_by_yearmonth.haml +3 -0
  62. data/template/partials/repos.haml +13 -0
  63. data/template/partials/top_authors_of_year.haml +30 -0
  64. data/template/partials/top_authors_of_yearmonth.haml +30 -0
  65. data/template/style.scss +132 -0
  66. metadata +187 -0
@@ -0,0 +1,30 @@
1
+ - i = 0
2
+ - block(:top_authors_of_year) do
3
+ .blocktable
4
+ %table
5
+ %thead
6
+ %th Year
7
+ %th Author
8
+ %th Commits
9
+ %th Total
10
+ %tbody
11
+ - stats.year_stats.sort{ |a, b| b[0] <=> a[0] }.each do |year, authorstats|
12
+ - authors = authorstats.sort{ |a, b| b[1].commits <=> a[1].commits }[0, top_author_count]
13
+ - authors.each do |author|
14
+ - c = author[1].commits
15
+ - first = author == authors.first
16
+ - i += 1 if first
17
+ %tr{:class => first ? 'top' : "yearauthor_sub#{i}"}
18
+ %td{:class => first ? "yearauthor_top#{i}" : ""}&= first ? year : ''
19
+ %td{:class => first ? "yearauthor_top#{i}" : ""}&= author[0]
20
+ %td{:class => first ? "yearauthor_top#{i}" : ""}&= '%d of %d (%.2f%%)' % [c, authorstats.commits.to_f, c * 100.0 / authorstats.commits.to_f]
21
+ %td{:class => first ? "yearauthor_top#{i}" : ""}&= first ? authorstats.count : ''
22
+ - for j in 1..i
23
+ :javascript
24
+ $(document).ready(function() {
25
+ $(".yearauthor_sub#{j}").hide();
26
+ $(".yearauthor_top#{j}").click(function() {
27
+ $(".yearauthor_sub#{j}").toggle();
28
+ return false;
29
+ });
30
+ });
@@ -0,0 +1,30 @@
1
+ - i = 0
2
+ - block(:top_authors_of_yearmonth) do
3
+ .blocktable
4
+ %table
5
+ %thead
6
+ %th Year-Month
7
+ %th Author
8
+ %th Commits
9
+ %th Total
10
+ %tbody
11
+ - stats.yearmonth_stats.sort{ |a, b| b[0] <=> a[0] }.each do |yearmonth, authorstats|
12
+ - authors = authorstats.sort{ |a, b| b[1].commits <=> a[1].commits }[0, top_author_count]
13
+ - authors.each do |author|
14
+ - c = author[1].commits
15
+ - first = author == authors.first
16
+ - i += 1 if first
17
+ %tr{:class => first ? 'top' : "yearmonthauthor_sub#{i}"}
18
+ %td{:class => first ? "yearmonthauthor_top#{i}" : ""}&= first ? yearmonth : ''
19
+ %td{:class => first ? "yearmonthauthor_top#{i}" : ""}&= author[0]
20
+ %td{:class => first ? "yearmonthauthor_top#{i}" : ""}&= '%d of %d (%.2f%%)' % [c, authorstats.commits.to_f, c * 100.0 / authorstats.commits.to_f]
21
+ %td{:class => first ? "yearmonthauthor_top#{i}" : ""}&= first ? authorstats.count : ''
22
+ - for j in 1..i
23
+ :javascript
24
+ $(document).ready(function() {
25
+ $(".yearmonthauthor_sub#{j}").hide();
26
+ $(".yearmonthauthor_top#{j}").click(function() {
27
+ $(".yearmonthauthor_sub#{j}").toggle();
28
+ return false;
29
+ });
30
+ });
@@ -0,0 +1,132 @@
1
+ $blueprint-font-size: 12px;
2
+ $menu-vpadding: 5px;
3
+ $menu-hpadding: 10px;
4
+
5
+ @import "compass/css3/border-radius";
6
+ @import "blueprint";
7
+
8
+ @include blueprint;
9
+
10
+ @mixin gradientclass($from: green, $to: red) {
11
+ @for $i from 0 through 100 {
12
+ .gradient-#{$i} {
13
+ background-color: mix($to, $from, $i);
14
+ }
15
+ }
16
+ }
17
+
18
+ a {
19
+ text-decoration: none;
20
+ }
21
+
22
+ table {
23
+ width: auto;
24
+ border: solid 1px black;
25
+ }
26
+
27
+ table.simpletable {
28
+ border: none;
29
+ tbody th {
30
+ text-align: left;
31
+ }
32
+ }
33
+
34
+ img {
35
+ border: solid 1px black;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ tbody th {
40
+ background-color: $blueprint-table-header-color;
41
+ }
42
+
43
+ #menu {
44
+ @include clearfix;
45
+ @include border-radius;
46
+
47
+ background-color: $blueprint-table-header-color;
48
+
49
+ padding: {
50
+ left: $menu-hpadding;
51
+ }
52
+
53
+ ul {
54
+ margin: 0;
55
+ padding: 0;
56
+ list-style: none;
57
+ }
58
+
59
+ li {
60
+ display: inline-block;
61
+ float: left;
62
+
63
+ padding: {
64
+ top: $menu-vpadding;
65
+ bottom: $menu-vpadding;
66
+ left: $menu-hpadding;
67
+ right: $menu-hpadding;
68
+ }
69
+
70
+ border-right: solid 1px white;
71
+
72
+ &.first {
73
+ padding-left: 0;
74
+ }
75
+ &.last {
76
+ border: none;
77
+ box-shadow: none;
78
+ }
79
+ }
80
+
81
+ a {
82
+ font-size: 150%;
83
+ }
84
+ }
85
+
86
+ table.tablesorter {
87
+ thead {
88
+ tr {
89
+ .header {
90
+ background: {
91
+ image: url("bg.gif");
92
+ position: right center;
93
+ repeat: no-repeat;
94
+ }
95
+ cursor: pointer;
96
+ padding-right: 21px;
97
+ }
98
+
99
+ .headerSortUp {
100
+ background-image: url("asc.gif");
101
+ }
102
+
103
+ .headerSortDown {
104
+ background-image: url("desc.gif");
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ tr.top {
111
+ td {
112
+ font-weight: bold;
113
+ background-color: $blueprint-table-stripe-color;
114
+ }
115
+ }
116
+
117
+ .blockheader {
118
+ @include border-radius;
119
+ padding-left: $menu-hpadding;
120
+ background-color: $blueprint-table-header-color;
121
+ }
122
+
123
+ .blockcontainer {
124
+ .blockdiagram {
125
+ }
126
+
127
+ .blocktable {
128
+ }
129
+ }
130
+
131
+ @include gradientclass(yellow, red);
132
+
metadata ADDED
@@ -0,0 +1,187 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gitstats-ruby
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Christoph Plank
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-11-14 00:00:00 +01:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: haml
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: sass
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: compass
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :runtime
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: gnuplot
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ type: :runtime
76
+ version_requirements: *id004
77
+ description: Generates statistics of git repositories like http://gitstats.sourceforge.net but with a more extendable and flexible backend system
78
+ email:
79
+ - chrisistuff@gmail.com
80
+ executables:
81
+ - gitstats
82
+ extensions: []
83
+
84
+ extra_rdoc_files: []
85
+
86
+ files:
87
+ - .gitignore
88
+ - LICENSE
89
+ - README.markdown
90
+ - bin/gitstats
91
+ - gitstats-ruby.gemspec
92
+ - lib/gitstats.rb
93
+ - lib/gitstats/author.rb
94
+ - lib/gitstats/git.rb
95
+ - lib/gitstats/renderer.rb
96
+ - lib/gitstats/renderer/gnuplot.rb
97
+ - lib/gitstats/renderer/haml.rb
98
+ - lib/gitstats/renderer/sass.rb
99
+ - lib/gitstats/statgen.rb
100
+ - lib/gitstats/stats.rb
101
+ - lib/gitstats/stats/commit.rb
102
+ - lib/gitstats/stats/commit/author.rb
103
+ - lib/gitstats/stats/commit/time.rb
104
+ - lib/gitstats/stats/file.rb
105
+ - lib/gitstats/stats/file/filetype.rb
106
+ - lib/gitstats/yearmonth.rb
107
+ - template/activity.haml
108
+ - template/asc.gif
109
+ - template/authors.haml
110
+ - template/bg.gif
111
+ - template/commits_per_hour.plot
112
+ - template/commits_per_month.plot
113
+ - template/commits_per_wday.plot
114
+ - template/commits_per_year.plot
115
+ - template/commits_per_yearmonth.plot
116
+ - template/desc.gif
117
+ - template/filechanges_by_yearmonth.plot
118
+ - template/files.haml
119
+ - template/files_by_yearmonth.plot
120
+ - template/helpers/block.rb
121
+ - template/helpers/config.rb
122
+ - template/helpers/names.rb
123
+ - template/helpers/utils.rb
124
+ - template/index.haml
125
+ - template/jquery.js
126
+ - template/jquery.tablesorter.js
127
+ - template/lastweeks.plot
128
+ - template/layouts/default.haml
129
+ - template/linechanges_by_yearmonth.plot
130
+ - template/lines.haml
131
+ - template/lines_by_yearmonth.plot
132
+ - template/partials/authors.haml
133
+ - template/partials/blockheader.haml
134
+ - template/partials/blocktoc.haml
135
+ - template/partials/commits_per_month.haml
136
+ - template/partials/commits_per_year.haml
137
+ - template/partials/commits_per_yearmonth.haml
138
+ - template/partials/day_of_week.haml
139
+ - template/partials/filechanges_by_yearmonth.haml
140
+ - template/partials/files_by_yearmonth.haml
141
+ - template/partials/filetypes.haml
142
+ - template/partials/general.haml
143
+ - template/partials/hour_of_day.haml
144
+ - template/partials/hour_of_week.haml
145
+ - template/partials/lastweeks.haml
146
+ - template/partials/linechanges_by_yearmonth.haml
147
+ - template/partials/lines_by_yearmonth.haml
148
+ - template/partials/repos.haml
149
+ - template/partials/top_authors_of_year.haml
150
+ - template/partials/top_authors_of_yearmonth.haml
151
+ - template/style.scss
152
+ has_rdoc: true
153
+ homepage: http://rubygems.org/gems/gitstats-ruby
154
+ licenses: []
155
+
156
+ post_install_message:
157
+ rdoc_options: []
158
+
159
+ require_paths:
160
+ - lib
161
+ required_ruby_version: !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ hash: 3
167
+ segments:
168
+ - 0
169
+ version: "0"
170
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ hash: 3
176
+ segments:
177
+ - 0
178
+ version: "0"
179
+ requirements: []
180
+
181
+ rubyforge_project:
182
+ rubygems_version: 1.6.2
183
+ signing_key:
184
+ specification_version: 3
185
+ summary: Generates statistics of git repositories
186
+ test_files: []
187
+