rubyperf 1.3.0 → 1.3.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -12,13 +12,37 @@ module Perf
12
12
  PERCENT_FORMAT = "%.3f"
13
13
  INDENT = " "*3
14
14
 
15
+ def initialize
16
+ super
17
+ @line=0
18
+ end
19
+
20
+ # Formats the header
15
21
  def format_header(v)
16
- "<table class='rubyperf_report_format_html_table'><tr><th>#{v[:title]}</th><th>%</th><th>count</th><th>user</th><th>system</th><th>total</th><th>real</th></tr>"
22
+ "<table class='rubyperf_report'><tr>" \
23
+ "<th class='title'>#{v[:title]}</th>" \
24
+ "<th class='percent'>%</th>" \
25
+ "<th class='count'>count</th>" \
26
+ "<th class='user_time'>user</th>" \
27
+ "<th class='system_time'>system</th>" \
28
+ "<th class='total_time'>total</th>" \
29
+ "<th class='real_time'>real</th>" \
30
+ "</tr>"
17
31
  end
18
32
 
33
+ # Formats the measure
19
34
  def format_measure(v)
35
+ @line+=1
20
36
  percent= v[:percent].is_a?(String) ? v[:percent] : (PERCENT_FORMAT%v[:percent])
21
- "<tr><td>#{v[:title]}</td><td>#{percent}</td><td>#{v[:count]}</td><td>#{v[:time].utime}</td><td>#{v[:time].stime}</td><td>#{v[:time].total}</td><td>#{v[:time].real}</td></td>"
37
+ "<tr class='#{@line % 2==0 ? "even_row" : "odd_row"}'>" \
38
+ "<td class='title'>#{v[:title]}</td>" \
39
+ "<td class='percent'>#{percent}</td>" \
40
+ "<td class='count'>#{v[:count]}</td>" \
41
+ "<td class='user_time'>#{v[:time].utime}</td>" \
42
+ "<td class='system_time'>#{v[:time].stime}</td>" \
43
+ "<td class='total_time'>#{v[:time].total}</td>" \
44
+ "<td class='real_time'>#{v[:time].real}</td>" \
45
+ "</tr>"
22
46
  end
23
47
 
24
48
  def format_footer(v)
data/rubyperf.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rubyperf}
8
- s.version = "1.3.0"
8
+ s.version = "1.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["lpasqualis"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyperf
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 0
10
- version: 1.3.0
9
+ - 1
10
+ version: 1.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - lpasqualis