smarter_csv 1.12.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/CONTRIBUTORS.md +1 -0
- data/lib/smarter_csv/auto_detection.rb +6 -1
- data/lib/smarter_csv/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: 05aa9e7d2d22ec6e1beb3790e2b727cd3e615cadcd537716f2dfbb190cc87a09
|
4
|
+
data.tar.gz: e37b072c7c81a3b6cdc6192ed2bfab046c924f3aa7a8a3e2a66f55fafa25b7ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07c149aaa123ef75fb65fd596fbab64359e24cf2b8606fe406d714358a1c14696fa9ecb420e6dd0a95d40f6af6d41e4988b16df9eac4346d9e1295e3c32f22b1
|
7
|
+
data.tar.gz: 71341c1cf1092fabbfe9106ce533adb872e2bc1b0c30fbc032f3ceaea1832e2ddef5d4156f1465658a67dddaae508cd23b12cfe9fdf34edea3f1f3ede0385688
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
|
2
2
|
# SmarterCSV 1.x Change Log
|
3
3
|
|
4
|
+
## 1.12.1 (2024-07-10)
|
5
|
+
* Improved column separator detection by ignoring quoted sections [#276](https://github.com/tilo/smarter_csv/pull/276) (thanks to Nicolas Castellanos)
|
6
|
+
|
4
7
|
## 1.12.0 (2024-07-09)
|
5
8
|
* Added Thread-Safety: added SmarterCSV::Reader to process CSV files in a thread-safe manner ([issue #277](https://github.com/tilo/smarter_csv/pull/277))
|
6
9
|
* SmarterCSV::Writer changed default row separator to the system's row separator (`\n` on Linux, `\r\n` on Windows)
|
data/CONTRIBUTORS.md
CHANGED
@@ -53,3 +53,4 @@ A Big Thank you to everyone who filed issues, sent comments, and who contributed
|
|
53
53
|
* [JP Camara](https://github.com/jpcamara)
|
54
54
|
* [Kenton Hirowatari](https://github.com/hirowatari)
|
55
55
|
* [Daniel Pepper](https://github.com/dpep)
|
56
|
+
* [Nicolas Castellanos](https://github.com/nicastelo)
|
@@ -19,7 +19,12 @@ module SmarterCSV
|
|
19
19
|
count.times do
|
20
20
|
line = readline_with_counts(filehandle, options)
|
21
21
|
delimiters.each do |d|
|
22
|
-
|
22
|
+
escaped_quote = Regexp.escape(options[:quote_char])
|
23
|
+
|
24
|
+
# Count only non-quoted occurrences of the delimiter
|
25
|
+
non_quoted_text = line.split(/#{escaped_quote}[^#{escaped_quote}]*#{escaped_quote}/).join
|
26
|
+
|
27
|
+
candidates[d] += non_quoted_text.scan(d).count
|
23
28
|
end
|
24
29
|
rescue EOFError # short files
|
25
30
|
break
|
data/lib/smarter_csv/version.rb
CHANGED