cevennes 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -0
- data/lib/cevennes.rb +8 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 435cddee7086da63e735457390edf766d42522bf58626b95ead034c418899719
|
4
|
+
data.tar.gz: 20f5371e968decbfc05d062d44ae2cef6f1856716a9e58d321133b6d3089267e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac1aa7f98147a393812a2fec1fdf6e6c714d35a5e325a7a2912f484db7d59212ee66daed23fdbe0013d11b18e737ba2b5e7f9527021ef7300cc9742c0313f80f
|
7
|
+
data.tar.gz: 44b7de7c27260dd623a466c880e4f9c789cf429efc6aa53671f092bfd9449f5d7c5841796da5b517faa34f9dfad202527b98ff8816b940ab4e345e0bfeb4f81b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -56,6 +56,8 @@ The second entry is a summary of the changes, altered `!` line count, removed `-
|
|
56
56
|
|
57
57
|
The remaining entries are the (non-)changes themselves, from line 1 to the end.
|
58
58
|
|
59
|
+
Since 1.3.0, Cevennes accepts CSV strings and parsed CSV (array of arrays).
|
60
|
+
|
59
61
|
|
60
62
|
### drop_equals: true
|
61
63
|
|
data/lib/cevennes.rb
CHANGED
@@ -5,7 +5,7 @@ require 'csv'
|
|
5
5
|
|
6
6
|
module Cevennes
|
7
7
|
|
8
|
-
VERSION = '1.
|
8
|
+
VERSION = '1.3.0'
|
9
9
|
|
10
10
|
class << self
|
11
11
|
|
@@ -60,7 +60,7 @@ module Cevennes
|
|
60
60
|
d = opts[:ignore_key_case] ? DOWNCASE : IDENTITY
|
61
61
|
did = d[id]
|
62
62
|
|
63
|
-
csva =
|
63
|
+
csva = parse(csv)
|
64
64
|
.each_with_index.collect { |row, i| [ 1 + i, strip(row) ] }
|
65
65
|
.reject { |i, row| row.compact.empty? }
|
66
66
|
.drop_while { |i, row| ! row.find { |cell| d[cell] == did } }
|
@@ -84,6 +84,12 @@ module Cevennes
|
|
84
84
|
h }
|
85
85
|
end
|
86
86
|
|
87
|
+
def parse(csv)
|
88
|
+
|
89
|
+
return csv if csv.is_a?(Array)
|
90
|
+
::CSV.parse(reencode(csv))
|
91
|
+
end
|
92
|
+
|
87
93
|
#def deflate(row)
|
88
94
|
# ::CSV.generate(encoding: 'UTF-8') { |csv| csv << row }.strip
|
89
95
|
#end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cevennes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mettraux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -17,8 +17,8 @@ dependencies:
|
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: '3.7'
|
19
19
|
name: rspec
|
20
|
-
type: :development
|
21
20
|
prerelease: false
|
21
|
+
type: :development
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
requirements: []
|
65
|
-
rubygems_version: 3.
|
65
|
+
rubygems_version: 3.2.3
|
66
66
|
signing_key:
|
67
67
|
specification_version: 4
|
68
68
|
summary: CSV diff library
|