columnizer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/columnizer.rb +2 -2
- data/lib/columnizer/version.rb +1 -1
- metadata +3 -3
data/lib/columnizer.rb
CHANGED
@@ -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
|
data/lib/columnizer/version.rb
CHANGED
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Crepezzi
|