csv 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +26 -0
- data/lib/csv.rb +0 -1
- data/lib/csv/row.rb +1 -6
- data/lib/csv/table.rb +8 -3
- data/lib/csv/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0c308f4cca10d6b48a2268e992fa545918c6cbe99837b83ec048b55eb76b702
|
4
|
+
data.tar.gz: 8661eb5e276abdeb5e939e3c2359d6ee991199550cfaa8e623496946fad17b8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5875a4b446bd22fbdb0ab1a829576e219b64aa80a66f27e73ae487ed7fa6fb09429f8f3185ab8b08c07ee30a49204b98acd1d7a72a97c9ec89234d79dc597553
|
7
|
+
data.tar.gz: bda1a607b00312b0e4bc0e2d444670d5f9661251ad73cb2061baeb695cb264af0a06f3bf44fc4d00d6406a1b61f0d4bbdfb8e6fd036d276f51fd30fec4f179e3
|
data/NEWS.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 3.0.4 - 2019-01-25
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Removed duplicated `CSV::Row#include?` implementations.
|
8
|
+
[GitHub#69][Patch by Max Schwenk]
|
9
|
+
|
10
|
+
* Removed duplicated `CSV::Row#header?` implementations.
|
11
|
+
[GitHub#70][Patch by Max Schwenk]
|
12
|
+
|
13
|
+
### Fixes
|
14
|
+
|
15
|
+
* Fixed a typo in document.
|
16
|
+
[GitHub#72][Patch by Artur Beljajev]
|
17
|
+
|
18
|
+
* Fixed a compatibility bug when row headers are changed.
|
19
|
+
[GitHub#71][Reported by tomoyuki kosaka]
|
20
|
+
|
21
|
+
### Thanks
|
22
|
+
|
23
|
+
* Max Schwenk
|
24
|
+
|
25
|
+
* Artur Beljajev
|
26
|
+
|
27
|
+
* tomoyuki kosaka
|
28
|
+
|
3
29
|
## 3.0.3 - 2019-01-12
|
4
30
|
|
5
31
|
### Improvements
|
data/lib/csv.rb
CHANGED
data/lib/csv/row.rb
CHANGED
@@ -130,6 +130,7 @@ class CSV
|
|
130
130
|
alias_method :include?, :has_key?
|
131
131
|
alias_method :key?, :has_key?
|
132
132
|
alias_method :member?, :has_key?
|
133
|
+
alias_method :header?, :has_key?
|
133
134
|
|
134
135
|
#
|
135
136
|
# :call-seq:
|
@@ -286,12 +287,6 @@ class CSV
|
|
286
287
|
index.nil? ? nil : index + minimum_index
|
287
288
|
end
|
288
289
|
|
289
|
-
# Returns +true+ if +name+ is a header for this row, and +false+ otherwise.
|
290
|
-
def header?(name)
|
291
|
-
headers.include? name
|
292
|
-
end
|
293
|
-
alias_method :include?, :header?
|
294
|
-
|
295
290
|
#
|
296
291
|
# Returns +true+ if +data+ matches a field in this row, and +false+
|
297
292
|
# otherwise.
|
data/lib/csv/table.rb
CHANGED
@@ -19,7 +19,7 @@ class CSV
|
|
19
19
|
# The optional +headers+ parameter can be set to Array of headers.
|
20
20
|
# If headers aren't set, headers are fetched from CSV::Row objects.
|
21
21
|
# Otherwise, headers() method will return headers being set in
|
22
|
-
# headers
|
22
|
+
# headers argument.
|
23
23
|
#
|
24
24
|
# A CSV::Table object supports the following Array methods through
|
25
25
|
# delegation:
|
@@ -133,10 +133,15 @@ class CSV
|
|
133
133
|
|
134
134
|
#
|
135
135
|
# Returns the headers for the first row of this table (assumed to match all
|
136
|
-
# other rows).
|
136
|
+
# other rows). The headers Array passed to CSV::Table.new is returned for
|
137
|
+
# empty tables.
|
137
138
|
#
|
138
139
|
def headers
|
139
|
-
@
|
140
|
+
if @table.empty?
|
141
|
+
@headers.dup
|
142
|
+
else
|
143
|
+
@table.first.headers
|
144
|
+
end
|
140
145
|
end
|
141
146
|
|
142
147
|
#
|
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.4
|
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-01-
|
12
|
+
date: 2019-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -109,7 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.7.6
|
113
114
|
signing_key:
|
114
115
|
specification_version: 4
|
115
116
|
summary: CSV Reading and Writing
|