columnizer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module Columnizer
11
11
  str = ''
12
12
  data.each do |row|
13
13
  row.each_with_index do |field, index|
14
- str += field + ' ' * (sizes[index] - field.size + (index == sizes.size - 1 ? 0 : options[:padding] || 0))
14
+ str += field.to_s + ' ' * (sizes[index] - field.size + (index == sizes.size - 1 ? 0 : options[:padding] || 0))
15
15
  end
16
16
  for index in row.size...sizes.size do # pad out
17
17
  str += ' ' * sizes[index]
@@ -29,7 +29,7 @@ module Columnizer
29
29
  data.each do |row|
30
30
  row.each_with_index do |field, index|
31
31
  c = sizes[index]
32
- sizes[index] = field.size if c.nil? || c < field.size
32
+ sizes[index] = field.to_s.size if c.nil? || c < field.to_s.size
33
33
  end
34
34
  end
35
35
  sizes
@@ -6,6 +6,6 @@ module Columnizer
6
6
 
7
7
  private
8
8
 
9
- VERSION = [0, 0, 1]
9
+ VERSION = [0, 0, 2]
10
10
 
11
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: columnizer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Crepezzi