rake_report 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 582c706a204224045d68a5198235d991df33a893
4
- data.tar.gz: a4b6bc79eaeeeecdc640e785490b0e296559094b
3
+ metadata.gz: bb74994b4cb92abd75ed78aee5be0a9869576e20
4
+ data.tar.gz: 36df8bf32125007f74a606c2d2046d610d8cc2c8
5
5
  SHA512:
6
- metadata.gz: 6691a3e8f13db4b29df9452ef187456283e8638556459bcc2ffe5b3f2cb31ef99dbbd0ee316dcfb96f2c34ebaf878e793d477e0c795ec12040b1d651524fd415
7
- data.tar.gz: 4e0efb7e3899d5a8372f9a943c99505b6e118da64385523be33e1db457058ea504c9cb4ee5466caf78b2d4ab42710a1154118a235ca0bb1239aea929324dae49
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
+ [![rake_report_test.html](/img/rake_report_test.png)](/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
@@ -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.google.com/jsapi"></script>
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("visualization", "1", {packages:["timeline"]});
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);
@@ -1,3 +1,3 @@
1
1
  module RakeReport
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
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.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: 2015-08-06 00:00:00.000000000 Z
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.4.6
109
+ rubygems_version: 2.6.11
108
110
  signing_key:
109
111
  specification_version: 4
110
112
  summary: Generate timing reports for rake tasks.