fasterer-csv 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fasterer_csv.rb +5 -5
- metadata +3 -3
data/lib/fasterer_csv.rb
CHANGED
@@ -232,23 +232,23 @@ module FastererCSV
|
|
232
232
|
|
233
233
|
class << self
|
234
234
|
|
235
|
-
def headers(file, quot = '~', sep = ',', fail_on_malformed = true, column =
|
235
|
+
def headers(file, quot = '~', sep = ',', fail_on_malformed = true, column = NoConversion.new, &block)
|
236
236
|
parse_headers(File.open(file, 'r') {|io| io.gets }, quot, sep, fail_on_malformed, column, &block)
|
237
237
|
end
|
238
238
|
|
239
|
-
def read(file, quot = '~', sep = ',', fail_on_malformed = true, column =
|
239
|
+
def read(file, quot = '~', sep = ',', fail_on_malformed = true, column = NoConversion.new, &block)
|
240
240
|
parse(File.open(file, 'r') { |io| io.sysread(File.size(file)) }, quot, sep, fail_on_malformed, column, &block)
|
241
241
|
end
|
242
242
|
|
243
|
-
def
|
243
|
+
def read_converted(file, quot = '~', sep = ',', fail_on_malformed = true, column = NumericConversion.new, &block)
|
244
244
|
parse(File.open(file, 'r') { |io| io.sysread(File.size(file)) }, quot, sep, fail_on_malformed, column, &block)
|
245
245
|
end
|
246
246
|
|
247
|
-
def parse_headers(data, quot = '~', sep = ',', fail_on_malformed = true, column =
|
247
|
+
def parse_headers(data, quot = '~', sep = ',', fail_on_malformed = true, column = NoConversion.new, &block)
|
248
248
|
parse(data, quot, sep, fail_on_malformed, column, &block).headers
|
249
249
|
end
|
250
250
|
|
251
|
-
def parse(data, quot = '~', sep = ',', fail_on_malformed = true, column =
|
251
|
+
def parse(data, quot = '~', sep = ',', fail_on_malformed = true, column = NoConversion.new)
|
252
252
|
q, s, row, inquot, clean, maybe, table, field, endline = quot[0], sep[0], [], false, true, false, nil, true, false
|
253
253
|
|
254
254
|
data.each_byte do |c|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fasterer-csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 10
|
10
|
+
version: 0.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mason
|