csv 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +6 -0
- data/lib/csv.rb +3 -3
- data/lib/csv/parser.rb +7 -7
- data/lib/csv/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0dfdbc61b4f75c06e3ea3ffd26980443aebe03d9a2fbdb8dc46a48d986d0447
|
4
|
+
data.tar.gz: 06cae607c0c77df4aa9f206d8d6d776a4c9207e359506558b9b07885c6f18c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ec7e66bf0feb2f6dc9cea0cf72748e74e5a9ac817cd98254f17e2e42dca39265b067a8415c4edefd1879c878f4e1e96f68caa3289a97b26eafcd2e835d0160e
|
7
|
+
data.tar.gz: cbe775cdbf43c7eb86af541d2dbafc8359aee4e108cb62f34fa73adbb401ac96c2c3b6839f972f0d3285068d8fa7c96120ef4de1b10f14acd9457fe9384cc822
|
data/NEWS.md
CHANGED
data/lib/csv.rb
CHANGED
@@ -504,9 +504,9 @@ class CSV
|
|
504
504
|
# <tt>encoding: "UTF-32BE:UTF-8"</tt> would read UTF-32BE data from the file
|
505
505
|
# but transcode it to UTF-8 before CSV parses it.
|
506
506
|
#
|
507
|
-
def self.foreach(path, **options, &block)
|
508
|
-
return to_enum(__method__, path, options) unless block_given?
|
509
|
-
open(path, options) do |csv|
|
507
|
+
def self.foreach(path, mode="r", **options, &block)
|
508
|
+
return to_enum(__method__, path, mode, options) unless block_given?
|
509
|
+
open(path, mode, options) do |csv|
|
510
510
|
csv.each(&block)
|
511
511
|
end
|
512
512
|
end
|
data/lib/csv/parser.rb
CHANGED
@@ -696,16 +696,16 @@ class CSV
|
|
696
696
|
else
|
697
697
|
scanner = @scanner
|
698
698
|
end
|
699
|
-
scanner.each_line(@row_separator) do |
|
700
|
-
next if @skip_lines and skip_line?(
|
701
|
-
|
699
|
+
scanner.each_line(@row_separator) do |line|
|
700
|
+
next if @skip_lines and skip_line?(line)
|
701
|
+
line.chomp!
|
702
702
|
|
703
|
-
if
|
703
|
+
if line.empty?
|
704
704
|
next if @skip_blanks
|
705
705
|
row = []
|
706
706
|
else
|
707
|
-
|
708
|
-
row =
|
707
|
+
line = strip_value(line)
|
708
|
+
row = line.split(@split_column_separator, -1)
|
709
709
|
n_columns = row.size
|
710
710
|
i = 0
|
711
711
|
while i < n_columns
|
@@ -713,7 +713,7 @@ class CSV
|
|
713
713
|
i += 1
|
714
714
|
end
|
715
715
|
end
|
716
|
-
@last_line =
|
716
|
+
@last_line = line
|
717
717
|
emit_row(row, &block)
|
718
718
|
end
|
719
719
|
end
|
data/lib/csv/version.rb
CHANGED
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.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Edward Gray II
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-03-
|
12
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.7.6
|
113
|
+
rubygems_version: 2.7.6.2
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: CSV Reading and Writing
|