gitstats-ruby 1.0.0 → 1.0.1

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.
@@ -5,9 +5,16 @@
5
5
  %title
6
6
  Statistics
7
7
  %link{:href => 'style.css', :rel => 'stylesheet', :type => 'text/css'}
8
+ %link{:href => 'jquery.jqplot.min.css', :rel => 'stylesheet', :type => 'text/css'}
8
9
  %meta{'http-equiv' => 'content-type', :content => 'text/html; charset=UTF-8'}
9
10
  %script{:type => 'text/javascript', :src => 'jquery.js'}
11
+ %script{:type => 'text/javascript', :src => 'jquery.jqplot.min.js'}
12
+ %script{:type => 'text/javascript', :src => 'jqplot.cursor.min.js'}
10
13
  %script{:type => 'text/javascript', :src => 'jquery.tablesorter.js'}
14
+ %script{:type => 'text/javascript', :src => 'jqplot.dateAxisRenderer.min.js'}
15
+ %script{:type => 'text/javascript', :src => 'jqplot.canvasTextRenderer.min.js'}
16
+ %script{:type => 'text/javascript', :src => 'jqplot.canvasAxisTickRenderer.min.js'}
17
+ %script{:type => 'text/javascript', :src => 'jqplot.canvasAxisLabelRenderer.min.js'}
11
18
  %body
12
19
  :javascript
13
20
  $.tablesorter.addParser({
@@ -28,6 +35,73 @@
28
35
  return false;
29
36
  });
30
37
  });
38
+
39
+ var jqplot_zoom_reset = function(evt, p, cursor) {
40
+ for(var i = 0;i < p.series.length;i++) {
41
+ p.series[i].showMarker = false;
42
+ p.series[i].markerOptions.show = false;
43
+ p.series[i].markerRenderer.show = false;
44
+ }
45
+
46
+ p.redraw();
47
+ };
48
+
49
+ var jqplot_zoom = function(evt, gridpos, datapos, p, cursor) {
50
+ var min = p.axes['xaxis'].min;
51
+ var max = p.axes['xaxis'].max;
52
+
53
+ var maxaxis = {
54
+ yaxis: null,
55
+ y2axis: null,
56
+ y3axis: null,
57
+ y4axis: null,
58
+ y5axis: null,
59
+ y6axis: null,
60
+ y7axis: null,
61
+ y8axis: null,
62
+ y9axis: null
63
+ };
64
+
65
+ var cnt = [];
66
+
67
+ var maxlen = 0;
68
+ for(var i = 0;i < p.series.length;i++) {
69
+ var len = p.series[i].data.length;
70
+ if(len > maxlen)
71
+ maxlen = len;
72
+ cnt[i] = 0;
73
+ }
74
+
75
+ for(var i = 0;i < maxlen;i++) {
76
+ for(var j = 0;j < p.series.length;j++) {
77
+ if(i < p.series[j].data.length) {
78
+ if((p.series[j].data[i][0] >= min) && (p.series[j].data[i][0] <= max)) {
79
+ cnt[j]++;
80
+ if(maxaxis[p.series[j].yaxis] == null)
81
+ maxaxis[p.series[j].yaxis] = p.series[j].data[i][1];
82
+ else if(p.series[j].data[i][1] > maxaxis[p.series[j].yaxis])
83
+ maxaxis[p.series[j].yaxis] = p.series[j].data[i][1];
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ for(var i = 0;i < p.series.length;i++) {
90
+ p.series[i].showMarker = cnt[i] <= 100;
91
+ p.series[i].markerOptions.show = cnt[i] <= 100;
92
+ p.series[i].markerRenderer.show = cnt[i] <= 100;
93
+ }
94
+
95
+ for(var ax in maxaxis) {
96
+ if(maxaxis[ax] != null) {
97
+ p.axes[ax].max = maxaxis[ax] * p.axes[ax].pad;
98
+ p.axes[ax].tickInterval = null;
99
+ p.axes[ax].numberTicks = null;
100
+ p.axes[ax]._ticks = [];
101
+ }
102
+ }
103
+ p.redraw();
104
+ };
31
105
  #menu
32
106
  %ul
33
107
  %li.first
@@ -1,2 +1,2 @@
1
1
  - layout :default
2
- = blocks :lines_by_yearmonth, :linechanges_by_yearmonth
2
+ = blocks :lineschart, :lines_by_yearmonth, :linechanges_by_yearmonth
@@ -0,0 +1,60 @@
1
+ - block(:commitchart) do
2
+ .blockdiagram
3
+ #commitchart{ :style => 'height:240px; width:640px' }
4
+
5
+ - lst = Array.new
6
+ - stats.date_stats.each_sorted do |a, b|
7
+ - lst << "['#{a}', #{b.commits}]"
8
+
9
+ :javascript
10
+ $(document).ready(function(){
11
+ var line = [#{lst.join(',')}];
12
+ var plot = $.jqplot('commitchart', [line], {
13
+ legend: {
14
+ show: true,
15
+ rowSpacing: '0',
16
+ location: 'nw',
17
+ },
18
+ axes: {
19
+ xaxis: {
20
+ pad: 0,
21
+ renderer: $.jqplot.DateAxisRenderer,
22
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
23
+ tickOptions: {
24
+ angle: 30
25
+ }
26
+ },
27
+ yaxis: {
28
+ label: 'Commits',
29
+ min: 0,
30
+ labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
31
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
32
+ tickOptions: {
33
+ angle: 30,
34
+ formatString: '%d'
35
+ }
36
+ }
37
+ },
38
+ series: [
39
+ {
40
+ label: 'Commits',
41
+ showMarker: false
42
+ }
43
+ ],
44
+ cursor: {
45
+ show: true,
46
+ zoom: true,
47
+ looseZoom: false,
48
+ constrainZoomTo: 'x',
49
+ showTooltip: true,
50
+ tooltipLocation: 'sw',
51
+ showTooltipUnitPosition: false,
52
+ showTooltipDataPosition: true,
53
+ showVerticalLine: true,
54
+ tooltipFormatString: '<b>%2$s</b> %1$s: %3$s'
55
+ }
56
+ });
57
+
58
+ plot.target.bind('jqplotZoom', jqplot_zoom);
59
+ plot.target.bind('jqplotResetZoom', jqplot_zoom_reset);
60
+ });
@@ -0,0 +1,86 @@
1
+ - block(:fileschart) do
2
+ .blockdiagram
3
+ #fileschart{ :style => 'height:240px; width:640px' }
4
+
5
+ - old = 0
6
+ - lst1 = Array.new
7
+ - lst2 = Array.new
8
+ - lst3 = Array.new
9
+ - stats.date_stats.each_sorted do |a, b|
10
+ - old += b.files
11
+ - lst1 << "['#{a}', #{old}]"
12
+ - lst2 << "['#{a}', #{b.files_added}]"
13
+ - lst3 << "['#{a}', #{b.files_deleted}]"
14
+
15
+ :javascript
16
+ $(document).ready(function(){
17
+ var line1 = [#{lst1.join(',')}];
18
+ var line2 = [#{lst2.join(',')}];
19
+ var line3 = [#{lst3.join(',')}];
20
+ var plot = $.jqplot('fileschart', [line1, line2, line3], {
21
+ legend: {
22
+ show: true,
23
+ rowSpacing: '0',
24
+ location: 'nw',
25
+ },
26
+ axes: {
27
+ xaxis: {
28
+ pad: 0,
29
+ renderer: $.jqplot.DateAxisRenderer,
30
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
31
+ tickOptions: {
32
+ angle: 30
33
+ }
34
+ },
35
+ yaxis: {
36
+ label: 'Files',
37
+ min: 0,
38
+ labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
39
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
40
+ tickOptions: {
41
+ angle: 30,
42
+ formatString: '%d'
43
+ }
44
+ },
45
+ y2axis: {
46
+ label: 'Changes',
47
+ min: 0,
48
+ labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
49
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
50
+ tickOptions: {
51
+ angle: 30,
52
+ formatString: '%d'
53
+ }
54
+ }
55
+ },
56
+ series: [
57
+ {
58
+ label: 'Files',
59
+ showMarker: false
60
+ },{
61
+ label: 'Added',
62
+ showMarker: false,
63
+ yaxis: 'y2axis'
64
+ },{
65
+ label: 'Deleted',
66
+ showMarker: false,
67
+ yaxis: 'y2axis'
68
+ }
69
+ ],
70
+ cursor: {
71
+ show: true,
72
+ zoom: true,
73
+ looseZoom: false,
74
+ constrainZoomTo: 'x',
75
+ showTooltip: true,
76
+ tooltipLocation: 'sw',
77
+ showTooltipUnitPosition: false,
78
+ showTooltipDataPosition: true,
79
+ showVerticalLine: true,
80
+ tooltipFormatString: '<b>%2$s</b> %1$s: %3$s'
81
+ }
82
+ });
83
+
84
+ plot.target.bind('jqplotZoom', jqplot_zoom);
85
+ plot.target.bind('jqplotResetZoom', jqplot_zoom_reset);
86
+ });
@@ -0,0 +1,86 @@
1
+ - block(:lineschart) do
2
+ .blockdiagram
3
+ #lineschart{ :style => 'height:240px; width:640px' }
4
+
5
+ - old = 0
6
+ - lst1 = Array.new
7
+ - lst2 = Array.new
8
+ - lst3 = Array.new
9
+ - stats.date_stats.each_sorted do |a, b|
10
+ - old += b.lines
11
+ - lst1 << "['#{a}', #{old}]"
12
+ - lst2 << "['#{a}', #{b.lines_added}]"
13
+ - lst3 << "['#{a}', #{b.lines_deleted}]"
14
+
15
+ :javascript
16
+ $(document).ready(function(){
17
+ var line1 = [#{lst1.join(',')}];
18
+ var line2 = [#{lst2.join(',')}];
19
+ var line3 = [#{lst3.join(',')}];
20
+ var plot = $.jqplot('lineschart', [line1, line2, line3], {
21
+ legend: {
22
+ show: true,
23
+ rowSpacing: '0',
24
+ location: 'nw',
25
+ },
26
+ axes: {
27
+ xaxis: {
28
+ pad: 0,
29
+ renderer: $.jqplot.DateAxisRenderer,
30
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
31
+ tickOptions: {
32
+ angle: 30
33
+ }
34
+ },
35
+ yaxis: {
36
+ label: 'Lines',
37
+ min: 0,
38
+ labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
39
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
40
+ tickOptions: {
41
+ angle: 30,
42
+ formatString: '%d'
43
+ }
44
+ },
45
+ y2axis: {
46
+ label: 'Changes',
47
+ min: 0,
48
+ labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
49
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
50
+ tickOptions: {
51
+ angle: 30,
52
+ formatString: '%d'
53
+ }
54
+ }
55
+ },
56
+ series: [
57
+ {
58
+ label: 'Lines',
59
+ showMarker: false
60
+ },{
61
+ label: 'Added',
62
+ showMarker: false,
63
+ yaxis: 'y2axis'
64
+ },{
65
+ label: 'Deleted',
66
+ showMarker: false,
67
+ yaxis: 'y2axis'
68
+ }
69
+ ],
70
+ cursor: {
71
+ show: true,
72
+ zoom: true,
73
+ looseZoom: false,
74
+ constrainZoomTo: 'x',
75
+ showTooltip: true,
76
+ tooltipLocation: 'sw',
77
+ showTooltipUnitPosition: false,
78
+ showTooltipDataPosition: true,
79
+ showVerticalLine: true,
80
+ tooltipFormatString: '<b>%2$s</b> %1$s: %3$s'
81
+ }
82
+ });
83
+
84
+ plot.target.bind('jqplotZoom', jqplot_zoom);
85
+ plot.target.bind('jqplotResetZoom', jqplot_zoom_reset);
86
+ });
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitstats-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christoph Plank
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-14 00:00:00 +01:00
19
- default_executable:
18
+ date: 2012-04-21 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: haml
@@ -122,6 +121,13 @@ files:
122
121
  - template/helpers/names.rb
123
122
  - template/helpers/utils.rb
124
123
  - template/index.haml
124
+ - template/jqplot.canvasAxisLabelRenderer.min.js
125
+ - template/jqplot.canvasAxisTickRenderer.min.js
126
+ - template/jqplot.canvasTextRenderer.min.js
127
+ - template/jqplot.cursor.min.js
128
+ - template/jqplot.dateAxisRenderer.min.js
129
+ - template/jquery.jqplot.min.css
130
+ - template/jquery.jqplot.min.js
125
131
  - template/jquery.js
126
132
  - template/jquery.tablesorter.js
127
133
  - template/lastweeks.plot
@@ -132,12 +138,14 @@ files:
132
138
  - template/partials/authors.haml
133
139
  - template/partials/blockheader.haml
134
140
  - template/partials/blocktoc.haml
141
+ - template/partials/commitchart.haml
135
142
  - template/partials/commits_per_month.haml
136
143
  - template/partials/commits_per_year.haml
137
144
  - template/partials/commits_per_yearmonth.haml
138
145
  - template/partials/day_of_week.haml
139
146
  - template/partials/filechanges_by_yearmonth.haml
140
147
  - template/partials/files_by_yearmonth.haml
148
+ - template/partials/fileschart.haml
141
149
  - template/partials/filetypes.haml
142
150
  - template/partials/general.haml
143
151
  - template/partials/hour_of_day.haml
@@ -145,11 +153,11 @@ files:
145
153
  - template/partials/lastweeks.haml
146
154
  - template/partials/linechanges_by_yearmonth.haml
147
155
  - template/partials/lines_by_yearmonth.haml
156
+ - template/partials/lineschart.haml
148
157
  - template/partials/repos.haml
149
158
  - template/partials/top_authors_of_year.haml
150
159
  - template/partials/top_authors_of_yearmonth.haml
151
160
  - template/style.scss
152
- has_rdoc: true
153
161
  homepage: http://rubygems.org/gems/gitstats-ruby
154
162
  licenses: []
155
163
 
@@ -179,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
187
  requirements: []
180
188
 
181
189
  rubyforge_project:
182
- rubygems_version: 1.6.2
190
+ rubygems_version: 1.8.11
183
191
  signing_key:
184
192
  specification_version: 3
185
193
  summary: Generates statistics of git repositories