csv 3.2.9 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7dabc413b85090aa7c9c93ca318de9adb1c0c2d94273f4e8d23d73d2882680a
4
- data.tar.gz: 8e8484c342de0947a59af726ab20d7a88a2ae766a9e62139edb6c5650d144d0a
3
+ metadata.gz: 4be2aab05afe081e964c806337cab1e8763532ecf66ef29bb8f6854cd65b29bf
4
+ data.tar.gz: 716f28f2377749b95d8f5f9f19a7cba50499e4ff46c4978efdc002ba25162475
5
5
  SHA512:
6
- metadata.gz: 28edfb536bed667f78a618a3d13f5b305d1749879efae7256aaa8a0fa84694f2df7cc285851976b8b2f45ce9a7ae5741f9bd4277c3ea32c9a27fd2379a0f1be2
7
- data.tar.gz: 7fe44532cde1e9022da25f798b696ad51b7c81bc3bd64cfd97610d13f073f141886bfdd03e9bb710bab2d3e7fda71a47cfea0ea7da8d3f6c06b38edfc295e364
6
+ metadata.gz: bc67687257ea7790091d9755199624dced05c3ea07a9afc47b86cc49dac1dfce77b884e1c2397de71f1f2de22720778135373652d7af05acb990814e6fa2d940
7
+ data.tar.gz: fce6230a6fdcff2ae8044a0f374ea71403cdf1f59d2024bb64a87ade52a897a907dfcb271b39d1ad81299cbd9eebf2ca43008dec99d86648550f73584d8c468c
data/NEWS.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # News
2
2
 
3
+ ## 3.3.0 - 2024-03-22
4
+
5
+ ### Fixes
6
+
7
+ * Fixed a regression parse bug in 3.2.9 that parsing with
8
+ `:skip_lines` may cause wrong result.
9
+
3
10
  ## 3.2.9 - 2024-03-22
4
11
 
5
12
  ### Fixes
data/lib/csv/parser.rb CHANGED
@@ -901,15 +901,18 @@ class CSV
901
901
  def skip_needless_lines
902
902
  return unless @skip_lines
903
903
 
904
- @scanner.keep_start
905
- @scanner.each_line(@row_separator) do |line|
906
- line << @row_separator if parse_row_end
907
- break unless skip_line?(line)
908
- @lineno += 1
909
- @scanner.keep_drop
904
+ until @scanner.eos?
910
905
  @scanner.keep_start
906
+ line = @scanner.scan_all(@not_line_end) || "".encode(@encoding)
907
+ line << @row_separator if parse_row_end
908
+ if skip_line?(line)
909
+ @lineno += 1
910
+ @scanner.keep_drop
911
+ else
912
+ @scanner.keep_back
913
+ return
914
+ end
911
915
  end
912
- @scanner.keep_back
913
916
  end
914
917
 
915
918
  def skip_line?(line)
data/lib/csv/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  class CSV
4
4
  # The version of the installed library.
5
- VERSION = "3.2.9"
5
+ VERSION = "3.3.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.9
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Edward Gray II