csv_query 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,8 +31,8 @@ module CsvQuery
31
31
 
32
32
  column_widths = [0] * num_columns
33
33
  results.collect { |row|
34
- row.each_with_index do |column, index|
35
- width = column.size
34
+ row.each_with_index do |value, index|
35
+ width = value.to_s.size
36
36
  column_widths[index] = width if width > column_widths[index]
37
37
  end
38
38
  }
@@ -1,3 +1,3 @@
1
1
  module CsvQuery
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -56,8 +56,8 @@ EOS
56
56
 
57
57
  it "works with numeric results" do
58
58
  results = [
59
- ["Animal", "COUNT(*)"],
60
- ["Monkeys", 12]
59
+ ["Animal", "COUNT(*)", "Average"],
60
+ ["Monkeys", 12, 123.456]
61
61
  ]
62
62
 
63
63
  output = capture_stdout do
@@ -65,9 +65,9 @@ EOS
65
65
  end
66
66
 
67
67
  output.must_equal <<EOS
68
- Animal | COUNT(*)
69
- --------+---------
70
- Monkeys | 12
68
+ Animal | COUNT(*) | Average
69
+ --------+----------+--------
70
+ Monkeys | 12 | 123.456
71
71
  EOS
72
72
  end
73
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  version: '0'
73
73
  segments:
74
74
  - 0
75
- hash: 3872383393282162040
75
+ hash: 4047582568054347755
76
76
  requirements: []
77
77
  rubyforge_project:
78
78
  rubygems_version: 1.8.24