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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 277fe614e5fc3f2f8ad100a70c6021aea0b8c9f989a46aad6618f9c3e81e5baf
4
- data.tar.gz: cb8aafb272a93788371dcc6992f61ea26a7a19844f3aabacb0e16fc9a3e54058
3
+ metadata.gz: b0dfdbc61b4f75c06e3ea3ffd26980443aebe03d9a2fbdb8dc46a48d986d0447
4
+ data.tar.gz: 06cae607c0c77df4aa9f206d8d6d776a4c9207e359506558b9b07885c6f18c24
5
5
  SHA512:
6
- metadata.gz: 063bf8125079ad1c9f42f26990ab9a6a7a07100fecc2db71a792e5b89aa757decc571e1c39a70c8c8a2eb50475749bbc103985a0fa66a1e35762f7568d7a7f85
7
- data.tar.gz: 7daef31a3902cba8dbc139a1d828d15493def81c95011f4da6ee69369dbdfdd3fb97a20a7d9a9f0cd1a8129669e27403f6426644e3b2f48e7fef592c22967dc0
6
+ metadata.gz: 0ec7e66bf0feb2f6dc9cea0cf72748e74e5a9ac817cd98254f17e2e42dca39265b067a8415c4edefd1879c878f4e1e96f68caa3289a97b26eafcd2e835d0160e
7
+ data.tar.gz: cbe775cdbf43c7eb86af541d2dbafc8359aee4e108cb62f34fa73adbb401ac96c2c3b6839f972f0d3285068d8fa7c96120ef4de1b10f14acd9457fe9384cc822
data/NEWS.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 3.0.6 - 2019-03-30
4
+
5
+ ### Improvements
6
+
7
+ * `CSV.foreach`: Added support for `mode`.
8
+
3
9
  ## 3.0.5 - 2019-03-24
4
10
 
5
11
  ### Improvements
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
@@ -696,16 +696,16 @@ class CSV
696
696
  else
697
697
  scanner = @scanner
698
698
  end
699
- scanner.each_line(@row_separator) do |value|
700
- next if @skip_lines and skip_line?(value)
701
- value.chomp!
699
+ scanner.each_line(@row_separator) do |line|
700
+ next if @skip_lines and skip_line?(line)
701
+ line.chomp!
702
702
 
703
- if value.empty?
703
+ if line.empty?
704
704
  next if @skip_blanks
705
705
  row = []
706
706
  else
707
- value = strip_value(value)
708
- row = value.split(@split_column_separator, -1)
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 = value
716
+ @last_line = line
717
717
  emit_row(row, &block)
718
718
  end
719
719
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  class CSV
4
4
  # The version of the installed library.
5
- VERSION = "3.0.5"
5
+ VERSION = "3.0.6"
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.0.5
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-24 00:00:00.000000000 Z
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