vll 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vl +13 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9068ba45e1eb3fc283d28d1451c8426b3c76e7fa
|
4
|
+
data.tar.gz: 77d2493fcbf0e36d9332ff317d1ebc4aec37c674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1454aaa260c5ce313238fa38dbfd32ae9764a0c40c780e47b8f03d070ab224c4118276569f7905b567197b966846972f5cd6f0761727bb1e4444d3457474090
|
7
|
+
data.tar.gz: 58a8711da7202000a85a325eaf3f2d660e8cfd8d251be5382fd2a9fd21dcf18067a35528020fba1ff63322498effacfae9df13da9727ac95e08ca50315fb71b1
|
data/bin/vl
CHANGED
@@ -106,7 +106,12 @@ cached_lines = []
|
|
106
106
|
ARGF.each_line.with_index.reduce 0 do |pnum, (line, lnum)|
|
107
107
|
cached_lines.push(line)
|
108
108
|
next pnum if lnum < $options[:skip] or line =~ $options[:comment]
|
109
|
-
CSV.parse_line(line, {:col_sep=>$options[:separator]})
|
109
|
+
parsed_line = CSV.parse_line(line, {:col_sep=>$options[:separator]})
|
110
|
+
# damn you, 'csv' package!
|
111
|
+
parsed_line = [] if parsed_line == nil
|
112
|
+
parsed_line.each_with_index do |c, i|
|
113
|
+
# damn you, 'csv' package!
|
114
|
+
c = '' if c == nil
|
110
115
|
# -1 because it's possible that c is empty and i is out of range
|
111
116
|
if $max_widths.fetch(i, -1) < c.length then $max_widths[i] = c.length end
|
112
117
|
end
|
@@ -120,7 +125,13 @@ def print_line(line, lnum)
|
|
120
125
|
print line
|
121
126
|
return
|
122
127
|
end
|
123
|
-
CSV.parse_line(line, {:col_sep=>$options[:separator]})
|
128
|
+
parsed_line = CSV.parse_line(line, {:col_sep=>$options[:separator]})
|
129
|
+
# damn you, 'csv' package!
|
130
|
+
parsed_line = [] if parsed_line == nil
|
131
|
+
parsed_line.each_with_index do |c, i|
|
132
|
+
# damn you, 'csv' package!
|
133
|
+
c = '' if c == nil
|
134
|
+
c = '' if c == nil
|
124
135
|
if $max_widths.fetch(i, -1) < c.length then $max_widths[i] = c.length end
|
125
136
|
case $options[:justify]
|
126
137
|
when 'l'
|