cevennes 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +2 -0
  4. data/lib/cevennes.rb +8 -2
  5. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 598f7e128effec146dbe0acc01bd26101b689a6efdcf647c061416aa43accb53
4
- data.tar.gz: b1cf17c58da5e0562100feff9fe40c1eee3cf07a2fc6fab0b724fbd792a240f9
3
+ metadata.gz: 435cddee7086da63e735457390edf766d42522bf58626b95ead034c418899719
4
+ data.tar.gz: 20f5371e968decbfc05d062d44ae2cef6f1856716a9e58d321133b6d3089267e
5
5
  SHA512:
6
- metadata.gz: 9686e580322ab076d7e85506d716aaac8e2d131d9af350b31b2985539bfc8d7a01f2b40dfd23e285e78e620e82dbc2cede2d1840c5d60f72d130b22f16cf3502
7
- data.tar.gz: 5bcef831927839276c9ca7f4304d5c6904f37587d4f4654ba88962250eafd59bfc7036ba1ff9f25824e898a2e8f5f87a250f3aa0317a7e1fadd696c4efe97453
6
+ metadata.gz: ac1aa7f98147a393812a2fec1fdf6e6c714d35a5e325a7a2912f484db7d59212ee66daed23fdbe0013d11b18e737ba2b5e7f9527021ef7300cc9742c0313f80f
7
+ data.tar.gz: 44b7de7c27260dd623a466c880e4f9c789cf429efc6aa53671f092bfd9449f5d7c5841796da5b517faa34f9dfad202527b98ff8816b940ab4e345e0bfeb4f81b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## cevennes 1.3.0 released 2022-07-24
6
+
7
+ - Diff already parsed CSV as well
8
+
9
+
5
10
  ## cevennes 1.2.0 released 2022-07-05
6
11
 
7
12
  - Introduce `drop_equals: true`
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.2.0'
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 = ::CSV.parse(reencode(csv))
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.2.0
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-05 00:00:00.000000000 Z
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.0.6
65
+ rubygems_version: 3.2.3
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: CSV diff library