somebee-rbench 0.2.3 → 0.2.4

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.
@@ -43,7 +43,7 @@ module RBench
43
43
  @runner.columns.each do |column|
44
44
  value = @cells[column.name]
45
45
  value = @cells.values_at(*value) if value.is_a?(Array)
46
- value = nil if value.is_a?(Array) && value.nitems != 2
46
+ value = nil if value.is_a?(Array) && value.compact.length != 2
47
47
 
48
48
  out << column.to_s(value)
49
49
  end
@@ -2,7 +2,7 @@ module RBench
2
2
  class Summary
3
3
  attr_reader :name, :runner, :cells, :items
4
4
  attr_accessor :lines
5
-
5
+
6
6
  def initialize(runner, group, name)
7
7
  @runner = runner
8
8
  @group = group
@@ -10,13 +10,12 @@ module RBench
10
10
  @cells = {} # A hash with keys as columns, and values being the result
11
11
  @items = []
12
12
  end
13
-
13
+
14
14
  def run
15
15
  # maybe add convenience-method to group to. group == runner really.
16
16
  items = (@group ? @group.items & @runner.reports : @runner.reports)
17
-
18
- rows = items.map{|item| item.cells.values_at(*@runner.columns.map{|c|c.name}) }
19
- rows = rows.pop.zip(*rows)
17
+
18
+ rows = items.map{|item| item.cells.values_at(*@runner.columns.map{|c|c.name}) }.transpose
20
19
 
21
20
  @runner.columns.each_with_index do |c,i|
22
21
  if c.compare
@@ -33,10 +32,10 @@ module RBench
33
32
  @cells[c.name] = rows[i].compact.select{|r| r.kind_of?(Numeric)}.inject(0){|tot,v| tot += v.to_f }
34
33
  end
35
34
  end
36
-
35
+
37
36
  puts to_s
38
37
  end
39
-
38
+
40
39
  def to_s
41
40
  out = ""
42
41
  out << @runner.separator(nil,"=") + @runner.newline unless @group
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: somebee-rbench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yehuda Katz & Sindre Aarsaether
@@ -9,12 +9,12 @@ autorequire: rbench
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-06-13 00:00:00 -07:00
12
+ date: 2009-05-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
16
  description: Library for generating nice ruby-benchmarks
17
- email: post [a] rbench [d] org
17
+ email: sindre [a] identu [d] no
18
18
  executables: []
19
19
 
20
20
  extensions: []
@@ -37,7 +37,8 @@ files:
37
37
  - lib/rbench/group.rb
38
38
  - lib/rbench/column.rb
39
39
  has_rdoc: true
40
- homepage: http://www.rbench.org
40
+ homepage: http://www.github.com/somebee/rbench
41
+ licenses:
41
42
  post_install_message:
42
43
  rdoc_options: []
43
44
 
@@ -58,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
59
  requirements: []
59
60
 
60
61
  rubyforge_project:
61
- rubygems_version: 1.0.1
62
+ rubygems_version: 1.3.5
62
63
  signing_key:
63
64
  specification_version: 2
64
65
  summary: Library for generating nice ruby-benchmarks