vll 0.1.14 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/vl +2 -88
  2. metadata +2 -2
data/bin/vl CHANGED
@@ -107,90 +107,6 @@ end
107
107
  #------#
108
108
 
109
109
 
110
- #$max_widths = []
111
- #
112
- ##==== line caching ====#
113
- #cached_lines = []
114
- #ARGF.each_line.with_index.reduce 0 do |pnum, (line, lnum)|
115
- # cached_lines.push(line)
116
- # next pnum if lnum < $options[:skip] or line =~ $options[:comment]
117
- # parsed_line = CSV.parse_line(line, {:col_sep=>$options[:separator], :quote_char=>$options[:quote]})
118
- # # damn you, 'csv' package!
119
- # parsed_line = [] if parsed_line == nil
120
- # parsed_line.each_with_index do |c, i|
121
- # # damn you, 'csv' package!
122
- # c = '' if c == nil
123
- # c = c.inspect[1..-2]
124
- # # -1 because it's possible that c is empty and i is out of range
125
- # if $max_widths.fetch(i, -1) < c.length then $max_widths[i] = c.length end
126
- # end
127
- # (pnum += 1) < $options[:probe_lines] ? pnum : break
128
- #end
129
- ##======================#
130
- #
131
- #
132
- #def print_line(line, lnum)
133
- # if lnum < $options[:skip] or line =~ $options[:comment] then
134
- # print line
135
- # return
136
- # end
137
- # parsed_line = CSV.parse_line(line, {:col_sep=>$options[:separator], :quote_char=>$options[:quote]})
138
- # # damn you, 'csv' package!
139
- # parsed_line = [] if parsed_line == nil
140
- # parsed_line.each_with_index do |c, i|
141
- # break if i > $options[:max_n_cols]
142
- # if i == $options[:max_n_cols] then
143
- # print "... #{parsed_line.size - i} more columns"
144
- # break
145
- # end
146
- #
147
- # # damn you, 'csv' package!
148
- # c = '' if c == nil
149
- # c = c.inspect[1..-2]
150
- #
151
- # if $max_widths.fetch(i, -1) < c.length then
152
- # $max_widths[i] = c.length
153
- # end
154
- #
155
- # c = c[0..$options[:chop_length]]
156
- # $max_widths[i] = [$options[:chop_length], $max_widths[i]].min
157
- #
158
- # case $options[:justify]
159
- # when 'l'
160
- # c = c.ljust($max_widths[i] + $options[:padding]) rescue break
161
- # when 'r'
162
- # c = c.rjust($max_widths[i] + $options[:padding]) rescue break
163
- # when 'a'
164
- # begin
165
- # if Float(c) then c = c.rjust($max_widths[i] + $options[:padding]) end
166
- # rescue
167
- # c = c.ljust($max_widths[i] + $options[:padding])
168
- # end
169
- # end
170
- #
171
- # if $options[:alternate_color] then
172
- # c = c.colorize([:yellow, :blue][i % 2])
173
- # end
174
- #
175
- # print c
176
- # end
177
- # puts
178
- #rescue
179
- # STDERR.puts 'vl: Pipe ended while writing.'
180
- # abort
181
- #end
182
- #
183
- #cached_lines.each.with_index do |line, lnum|
184
- # print_line(line, lnum)
185
- #end
186
- #
187
- #ARGF.each_line.with_index do |line, lnum|
188
- # print_line(line, lnum)
189
- #end
190
-
191
-
192
-
193
-
194
110
  #==== new version ===#
195
111
 
196
112
  $cached_lines = []
@@ -233,10 +149,8 @@ def print_row(row)
233
149
  print c
234
150
  end
235
151
  puts
236
- #rescue Exception => e
237
- # #STDERR.puts 'vl: Pipe ended while writing.'
238
- # pp e
239
- # throw e
152
+ rescue Errno::EPIPE => e
153
+ STDERR.puts 'Pipe ended while writing.'
240
154
  end
241
155
 
242
156
  (1..1.0/0).each do |i|
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: vll
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.14
5
+ version: 0.1.15
6
6
  platform: ruby
7
7
  authors:
8
8
  - xzhu
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-29 00:00:00.000000000 Z
12
+ date: 2016-10-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime