rake_report 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.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/img/rake_report_test.htm +41 -0
- data/img/rake_report_test.png +0 -0
- data/lib/rake_report/template.rb +4 -5
- data/lib/rake_report/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb74994b4cb92abd75ed78aee5be0a9869576e20
|
|
4
|
+
data.tar.gz: 36df8bf32125007f74a606c2d2046d610d8cc2c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c4415aa3c6cafd00fde92d3f65a2b06f53565fb6ca41ff7fba330ba8ace79018154acbb052a177617c41128a0bbc7601febf9200b526c0c2b09a9cd4187b027
|
|
7
|
+
data.tar.gz: 776d0b2b5a16626babed79af035f99c0621d5a96c1e905129afddc5b1e009cdb1b1827202a1bcdded3bdf4fce077ed635494a576b129d8fc8fc1e257b9e19356
|
data/README.md
CHANGED
|
@@ -33,6 +33,10 @@ DataTable formatted for the Timeline visualization API:
|
|
|
33
33
|
|
|
34
34
|
https://developers.google.com/chart/interactive/docs/gallery/timeline#data-format
|
|
35
35
|
|
|
36
|
+
## Example Output
|
|
37
|
+
|
|
38
|
+
[](/img/rake_report_test.htm)
|
|
39
|
+
|
|
36
40
|
## Contributing
|
|
37
41
|
|
|
38
42
|
1. Fork it ( https://github.com/optimizely/rake_report/fork )
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
|
5
|
+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
|
6
|
+
<script type="text/javascript">
|
|
7
|
+
var jsonData = {"cols":[{"label":"task","type":"string"},{"label":"type","type":"string"},{"label":"start","type":"datetime"},{"label":"end","type":"datetime"}],"rows":[{"c":[{"v":"unit:create_comment"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 095)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 251)"}]},{"c":[{"v":"unit:destroy_comment"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 251)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 345)"}]},{"c":[{"v":"unit:create_image"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 095)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 442)"}]},{"c":[{"v":"unit:destroy_image"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 442)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 572)"}]},{"c":[{"v":"integration:create_image"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 095)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 643)"}]},{"c":[{"v":"unit:create_blog"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 095)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 692)"}]},{"c":[{"v":"integration:create_comment"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 251)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 741)"}]},{"c":[{"v":"lint"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 095)"},{"v":"Date(2015, 8, 6, 11, 24, 14, 744)"}]},{"c":[{"v":"integration:create_blog"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 345)"},{"v":"Date(2015, 8, 6, 11, 24, 15, 260)"}]},{"c":[{"v":"unit:destroy_blog"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 692)"},{"v":"Date(2015, 8, 6, 11, 24, 15, 303)"}]},{"c":[{"v":"integration:create_post"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 572)"},{"v":"Date(2015, 8, 6, 11, 24, 15, 422)"}]},{"c":[{"v":"unit:create_post"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 15, 260)"},{"v":"Date(2015, 8, 6, 11, 24, 15, 495)"}]},{"c":[{"v":"integration:destroy_comment"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 14, 741)"},{"v":"Date(2015, 8, 6, 11, 24, 15, 663)"}]},{"c":[{"v":"integration:destroy_blog"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 15, 260)"},{"v":"Date(2015, 8, 6, 11, 24, 15, 973)"}]},{"c":[{"v":"integration:destroy_image"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 15, 303)"},{"v":"Date(2015, 8, 6, 11, 24, 15, 979)"}]},{"c":[{"v":"integration:destroy_post"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 15, 422)"},{"v":"Date(2015, 8, 6, 11, 24, 16, 321)"}]},{"c":[{"v":"unit:destroy_post"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 15, 495)"},{"v":"Date(2015, 8, 6, 11, 24, 16, 413)"}]},{"c":[{"v":"objects"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 16, 414)"},{"v":"Date(2015, 8, 6, 11, 24, 16, 414)"}]},{"c":[{"v":"integration"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 16, 414)"},{"v":"Date(2015, 8, 6, 11, 24, 16, 414)"}]},{"c":[{"v":"unit"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 16, 414)"},{"v":"Date(2015, 8, 6, 11, 24, 16, 779)"}]},{"c":[{"v":"test"},{"v":"execute"},{"v":"Date(2015, 8, 6, 11, 24, 16, 779)"},{"v":"Date(2015, 8, 6, 11, 24, 16, 779)"}]},{"c":[{"v":"test"},{"v":"invoke"},{"v":"Date(2015, 8, 6, 11, 24, 14, 094)"},{"v":"Date(2015, 8, 6, 11, 24, 16, 779)"}]}]};
|
|
8
|
+
|
|
9
|
+
google.load("visualization", "1", {packages:["timeline"]});
|
|
10
|
+
google.setOnLoadCallback(drawChart);
|
|
11
|
+
|
|
12
|
+
function drawChart() {
|
|
13
|
+
var dataTable = new google.visualization.DataTable(jsonData);
|
|
14
|
+
var container = document.getElementById('timeline');
|
|
15
|
+
var chart = new google.visualization.Timeline(container);
|
|
16
|
+
|
|
17
|
+
// If the number of rows exceeds the length of the color array
|
|
18
|
+
// the chart shows every row with the same color. This is prettier.
|
|
19
|
+
var color_palatte = ["#50ABD2","#78B653","#CAD04F","#ED913D","#E8182E"];
|
|
20
|
+
var colors = new Array();
|
|
21
|
+
for(var i=0; i < dataTable.getNumberOfRows(); i++) {
|
|
22
|
+
colors.push(color_palatte[i % color_palatte.length]);
|
|
23
|
+
}
|
|
24
|
+
var options = {
|
|
25
|
+
colors: colors,
|
|
26
|
+
timeline: {
|
|
27
|
+
showBarLabels: false,
|
|
28
|
+
colorByRowLabel: true,
|
|
29
|
+
groupByRowLabel: true
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
chart.draw(dataTable, options);
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
</head>
|
|
37
|
+
<body>
|
|
38
|
+
<div id="timeline" style="height: 100%"></div>
|
|
39
|
+
</body>
|
|
40
|
+
</html>
|
|
41
|
+
|
|
Binary file
|
data/lib/rake_report/template.rb
CHANGED
|
@@ -7,18 +7,17 @@ class RakeReportTemplate
|
|
|
7
7
|
@template = template
|
|
8
8
|
@timers = timers
|
|
9
9
|
end
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
def template
|
|
12
12
|
%q{
|
|
13
13
|
<html>
|
|
14
14
|
<head>
|
|
15
|
-
<script type="text/javascript" src="https://www.
|
|
16
|
-
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
|
15
|
+
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
|
17
16
|
<script type="text/javascript">
|
|
18
17
|
var jsonData = <%= timers.to_json %>;
|
|
19
18
|
|
|
20
|
-
google.load("
|
|
21
|
-
google.setOnLoadCallback(drawChart);
|
|
19
|
+
google.charts.load("current",{packages:["timeline"]});
|
|
20
|
+
google.charts.setOnLoadCallback(drawChart);
|
|
22
21
|
|
|
23
22
|
function drawChart() {
|
|
24
23
|
var dataTable = new google.visualization.DataTable(jsonData);
|
data/lib/rake_report/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake_report
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steve Adams
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-10-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -79,6 +79,8 @@ files:
|
|
|
79
79
|
- LICENSE.txt
|
|
80
80
|
- README.md
|
|
81
81
|
- Rakefile
|
|
82
|
+
- img/rake_report_test.htm
|
|
83
|
+
- img/rake_report_test.png
|
|
82
84
|
- lib/rake_report.rb
|
|
83
85
|
- lib/rake_report/override.rb
|
|
84
86
|
- lib/rake_report/template.rb
|
|
@@ -104,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
104
106
|
version: '0'
|
|
105
107
|
requirements: []
|
|
106
108
|
rubyforge_project:
|
|
107
|
-
rubygems_version: 2.
|
|
109
|
+
rubygems_version: 2.6.11
|
|
108
110
|
signing_key:
|
|
109
111
|
specification_version: 4
|
|
110
112
|
summary: Generate timing reports for rake tasks.
|