acsv-p 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acsv-p/csv.rb +3 -4
- data/lib/acsv-p/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91c1d0ecc9d74058749134fd1053518687d391fcafe7ed9cc0ab5ec4c9bfaaac
|
4
|
+
data.tar.gz: 8ecca24358ed636c7913b4ef72310715dcf7d95ff52fcb3faee8210d6282bc5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa50c0dc0d8a56ce92dccffb0f61fd8be4d292cddb9485b0e0333e8dfe81a83890e45890db51232ec4ff2d6e260bd65675c17619ad6c0168d56b6f024014b84
|
7
|
+
data.tar.gz: e754abf636e17eba38d98070578bbf286d5b0985f16e14f3646f3ac5a6b470fce706b10c049b2626f31ac7f8fde7abb310c0320fdf400c955c30ee9d777bdeff
|
data/lib/acsv-p/csv.rb
CHANGED
@@ -15,7 +15,7 @@ module ACSV
|
|
15
15
|
# @see http://www.ruby-doc.org/stdlib/libdoc/csv/rdoc/CSV.html#method-c-new
|
16
16
|
def initialize(data, options = Hash.new)
|
17
17
|
options[:col_sep] ||= ACSV::Detect.separator(data)
|
18
|
-
super(data, options)
|
18
|
+
super(data, **options)
|
19
19
|
end
|
20
20
|
|
21
21
|
# This method opens an IO object, and wraps that with CSV. For reading, separator
|
@@ -39,7 +39,7 @@ module ACSV
|
|
39
39
|
mode, ext_enc, int_enc = full_mode.split(':')
|
40
40
|
if (ext_enc.nil? || ext_enc=='') && options[:encoding].nil? && options[:external_encoding].nil?
|
41
41
|
# try to detect encoding
|
42
|
-
if ext_enc = ACSV::Detect.encoding(File.open(args[0], mode, options), options)
|
42
|
+
if ext_enc = ACSV::Detect.encoding(File.open(args[0], mode, **options), options)
|
43
43
|
# workaround for http://stackoverflow.com/a/20723346
|
44
44
|
ext_enc = "BOM|#{ext_enc}" if ext_enc =~ /UTF/
|
45
45
|
# create new mode specification if there was one, else store in option
|
@@ -58,8 +58,7 @@ module ACSV
|
|
58
58
|
options.delete :confidence
|
59
59
|
options.delete :method
|
60
60
|
# to superclass
|
61
|
-
args
|
62
|
-
super(*args)
|
61
|
+
super(args[0], args[1], **options)
|
63
62
|
end
|
64
63
|
end
|
65
64
|
end
|
data/lib/acsv-p/version.rb
CHANGED