example_group_timer 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # HISTORY
2
2
 
3
+ ## 0.0.4
4
+
5
+ * Use proper numerical sorting
6
+ * Sort examples and example groups together
7
+
3
8
  ## 0.0.3
4
9
 
5
10
  * Use HTML-with-charts output
@@ -21,7 +21,7 @@ module ExampleGroupTimer
21
21
  end
22
22
 
23
23
  def percentage
24
- ''
24
+ 100
25
25
  end
26
26
 
27
27
  def description
@@ -26,8 +26,7 @@ module ExampleGroupTimer
26
26
  def report
27
27
  super
28
28
  puts "<ol>"
29
- examples.sort_by { |o| o.duration }.reverse.each(&:report)
30
- subgroups.sort_by { |o| o.duration }.reverse.each(&:report)
29
+ (examples + subgroups).sort_by(&:duration).reverse.each(&:report)
31
30
  puts "</ol>"
32
31
  end
33
32
  end
@@ -16,7 +16,7 @@ module ExampleGroupTimer
16
16
  end
17
17
 
18
18
  def duration
19
- '%.5f' % [@finished_at - @started_at]
19
+ @finished_at - @started_at
20
20
  end
21
21
 
22
22
  def indent
@@ -24,7 +24,7 @@ module ExampleGroupTimer
24
24
  end
25
25
 
26
26
  def percentage
27
- ('%.1f%' % [(duration.to_f / parent.duration.to_f) * 100]).rjust(5)
27
+ (duration.to_f / parent.duration.to_f) * 100
28
28
  end
29
29
 
30
30
  def report
@@ -32,8 +32,8 @@ module ExampleGroupTimer
32
32
  <li>
33
33
  <div class="example-group">
34
34
  <span class="title">%s</span>
35
- <span class="duration">%s</span>
36
- <span class="share">%s</span>
35
+ <span class="duration">%.4f</span>
36
+ <span class="share">%.1f%%</span>
37
37
  </div>
38
38
  </li>
39
39
  EOS
@@ -1,3 +1,3 @@
1
1
  module ExampleGroupTimer
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: example_group_timer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-04 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake