tabbit 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tabbit.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdc65d706c4a48f34ea5a6c9db0498c19cc8adf1
|
4
|
+
data.tar.gz: f80a2a9474132365c26571e1b578cdc4bf079167
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acffb34978af43085257f97956f7d3b94a5308917b4e11ae76e3d1346093edd21845b1c643eb097b11e24e7f276b22b9d11865dbc7bd617dcfe846eb92218bff
|
7
|
+
data.tar.gz: 5c51a5d292b4b688cfa38e8f2bee9c5d766efa27ed265a55e820b4031cc8eb7e7b8e0f73585edcd4c8a6faf479ca3e25a6cd96f725067d0c6396de2675084f63
|
data/lib/tabbit.rb
CHANGED
@@ -24,7 +24,7 @@ class Tabbit
|
|
24
24
|
|
25
25
|
# Finds the longest string in column
|
26
26
|
@table.each do |line|
|
27
|
-
if line[n].length > self.instance_variable_get("@max_length_#{n}")
|
27
|
+
if line[n].to_s.length > self.instance_variable_get("@max_length_#{n}")
|
28
28
|
self.instance_variable_set "@max_length_#{n}", line[n].length.to_f
|
29
29
|
end
|
30
30
|
end
|
@@ -33,9 +33,9 @@ class Tabbit
|
|
33
33
|
divider '=', @table, new_line: true
|
34
34
|
|
35
35
|
@table[0].length.times do |n|
|
36
|
-
difference = self.instance_variable_get("@max_length_#{n}") - @table[0][n].length + 2
|
36
|
+
difference = self.instance_variable_get("@max_length_#{n}") - @table[0][n].to_s.length + 2
|
37
37
|
|
38
|
-
cell = '|' + (' ' * 2) + @table[0][n].bold.red + (' ' * difference)
|
38
|
+
cell = '|' + (' ' * 2) + @table[0][n].to_s.bold.red + (' ' * difference)
|
39
39
|
@table[0][n] == @table[0].last ? puts(cell + '|') : print(cell)
|
40
40
|
end
|
41
41
|
|
@@ -48,8 +48,8 @@ class Tabbit
|
|
48
48
|
line = @table[n]
|
49
49
|
line.length.times do |i|
|
50
50
|
item = line[i]
|
51
|
-
difference = self.instance_variable_get("@max_length_#{i}") - item.length + 2
|
52
|
-
cell = '|' + (' ' * 2) + item + (' ' * difference)
|
51
|
+
difference = self.instance_variable_get("@max_length_#{i}") - item.to_s.length + 2
|
52
|
+
cell = '|' + (' ' * 2) + item.to_s + (' ' * difference)
|
53
53
|
item == line.last ? puts(cell + '|') : print(cell)
|
54
54
|
end
|
55
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tabbit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Green
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|