csv 3.3.2 → 3.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb25f2d0582cf6f7fd0677b63468bf268cc362f8fc45209376a08d3f93995b01
4
- data.tar.gz: 32b3a6a958da3fbf005d0aea7217393befefe0da204ddf92b728c5c9514a1cce
3
+ metadata.gz: 7de8075012a39a948cee7b3cc1fa8ccb9ca15cc3ca3718f3883a7d82acc51c2c
4
+ data.tar.gz: 55459b45132d6da9880cfc294f46a9eb5a4646726c08b6a0053dc801179dccfc
5
5
  SHA512:
6
- metadata.gz: 77a56a3847636b8297007fa175c8e503933471b16ad8c34f3f676bc37af963d47101ee21eeb805cf1dd80201bce7117c20840bb94d25effb2e6bd299b2a5263d
7
- data.tar.gz: 04b07a2b4f9dd23062caa1b7cfe0fe7e85c45176379806249abdf2151f866d919a1dda7337c0bef1459f5ebee846fde27efb1b67664fdd3f5ab15301a7ecffc1
6
+ metadata.gz: '04382fe706d56323605226220819ed2af7af8833b753e98c9ca2537f288808b104c1e88a6d9a7d65ac393817c15a052be7966e8b9cd0494402513fe88ce4cb65'
7
+ data.tar.gz: 9b0f33b6b0560b84a73eaac22924b3b1397f2bfa939f036c2ba4243411e2df4fcafb6ebc82644217d977d7d2ebf3c226df93338f7def80196c050acdb847da0e
data/NEWS.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # News
2
2
 
3
+ ## 3.3.4 - 2025-04-13
4
+
5
+ ### Improvements
6
+
7
+ * `csv-filter`: Removed an experimental command line tool.
8
+ * GH-341
9
+
10
+ ## 3.3.3 - 2025-03-20
11
+
12
+ ### Improvements
13
+
14
+ * `csv-filter`: Added an experimental command line tool to filter a CSV.
15
+ * Patch by Burdette Lamar
16
+
17
+ ### Fixes
18
+
19
+ * Fixed wrong EOF detection for `ARGF`
20
+ * GH-328
21
+ * Reported by Takeshi Nishimatsu
22
+
23
+ * Fixed a regression bug that `CSV.open` rejects integer mode.
24
+ * GH-336
25
+ * Reported by Dave Burgess
26
+
27
+ ### Thanks
28
+
29
+ * Takeshi Nishimatsu
30
+
31
+ * Burdette Lamar
32
+
33
+ * Dave Burgess
34
+
3
35
  ## 3.3.2 - 2024-12-21
4
36
 
5
37
  ### Fixes
data/lib/csv/parser.rb CHANGED
@@ -18,6 +18,19 @@ class CSV
18
18
  # into your Encoding.
19
19
  #
20
20
 
21
+ class << self
22
+ ARGF_OBJECT_ID = ARGF.object_id
23
+ # Convenient method to check whether the give input reached EOF
24
+ # or not.
25
+ def eof?(input)
26
+ # We can't use input != ARGF in Ractor. Because ARGF isn't a
27
+ # shareable object.
28
+ input.object_id != ARGF_OBJECT_ID and
29
+ input.respond_to?(:eof) and
30
+ input.eof?
31
+ end
32
+ end
33
+
21
34
  # Raised when encoding is invalid.
22
35
  class InvalidEncoding < StandardError
23
36
  end
@@ -312,7 +325,7 @@ class CSV
312
325
  raise InvalidEncoding unless chunk.valid_encoding?
313
326
  # trace(__method__, :chunk, chunk)
314
327
  @scanner = StringScanner.new(chunk)
315
- if input.respond_to?(:eof?) and input.eof?
328
+ if Parser.eof?(input)
316
329
  @inputs.shift
317
330
  @last_scanner = @inputs.empty?
318
331
  end
@@ -869,10 +882,7 @@ class CSV
869
882
  string = nil
870
883
  if @samples.empty? and @input.is_a?(StringIO)
871
884
  string = @input.read
872
- elsif @samples.size == 1 and
873
- @input != ARGF and
874
- @input.respond_to?(:eof?) and
875
- @input.eof?
885
+ elsif @samples.size == 1 and Parser.eof?(@input)
876
886
  string = @samples[0]
877
887
  end
878
888
  if string
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.3.2"
5
+ VERSION = "3.3.4"
6
6
  end
data/lib/csv.rb CHANGED
@@ -1976,7 +1976,7 @@ class CSV
1976
1976
  return unless Encoding.default_external == Encoding::UTF_8
1977
1977
  return if options.key?(:encoding)
1978
1978
  return if options.key?(:external_encoding)
1979
- return if mode.include?(":")
1979
+ return if mode.is_a?(String) and mode.include?(":")
1980
1980
  file_opts[:encoding] = "bom|utf-8"
1981
1981
  end
1982
1982
 
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Edward Gray II
8
8
  - Kouhei Sutou
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-12-21 00:00:00.000000000 Z
11
+ date: 2025-04-13 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: The CSV library provides a complete interface to CSV files and data.
15
14
  It offers tools to enable you to read and write to and from Strings or IO objects,
@@ -71,8 +70,8 @@ homepage: https://github.com/ruby/csv
71
70
  licenses:
72
71
  - Ruby
73
72
  - BSD-2-Clause
74
- metadata: {}
75
- post_install_message:
73
+ metadata:
74
+ changelog_uri: https://github.com/ruby/csv/releases/tag/v3.3.4
76
75
  rdoc_options:
77
76
  - "--main"
78
77
  - README.md
@@ -89,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
88
  - !ruby/object:Gem::Version
90
89
  version: '0'
91
90
  requirements: []
92
- rubygems_version: 3.5.22
93
- signing_key:
91
+ rubygems_version: 3.6.2
94
92
  specification_version: 4
95
93
  summary: CSV Reading and Writing
96
94
  test_files: []