cevennes 1.1.1 → 1.2.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/LICENSE.txt +1 -1
- data/Makefile +1 -1
- data/README.md +39 -1
- data/lib/cevennes.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 598f7e128effec146dbe0acc01bd26101b689a6efdcf647c061416aa43accb53
|
4
|
+
data.tar.gz: b1cf17c58da5e0562100feff9fe40c1eee3cf07a2fc6fab0b724fbd792a240f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9686e580322ab076d7e85506d716aaac8e2d131d9af350b31b2985539bfc8d7a01f2b40dfd23e285e78e620e82dbc2cede2d1840c5d60f72d130b22f16cf3502
|
7
|
+
data.tar.gz: 5bcef831927839276c9ca7f4304d5c6904f37587d4f4654ba88962250eafd59bfc7036ba1ff9f25824e898a2e8f5f87a250f3aa0317a7e1fadd696c4efe97453
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
Copyright (c) 2018-
|
2
|
+
Copyright (c) 2018-2022, John Mettraux, jmettraux@gmail.com
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
# cevennes
|
3
3
|
|
4
|
-
[![
|
4
|
+
[![tests](https://github.com/jmettraux/cevennes/workflows/test/badge.svg)](https://github.com/jmettraux/cevennes/actions)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/cevennes.svg)](http://badge.fury.io/rb/cevennes)
|
6
6
|
|
7
7
|
Diffs CSVs by lines, focusing on a single ID
|
@@ -57,6 +57,44 @@ The second entry is a summary of the changes, altered `!` line count, removed `-
|
|
57
57
|
The remaining entries are the (non-)changes themselves, from line 1 to the end.
|
58
58
|
|
59
59
|
|
60
|
+
### drop_equals: true
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
require 'cevennes'
|
64
|
+
|
65
|
+
cvs0 = %{
|
66
|
+
id,name,age
|
67
|
+
0,John,33
|
68
|
+
1,Jean-Baptiste,43
|
69
|
+
3,Luke,21
|
70
|
+
}.strip + "\n"
|
71
|
+
cvs1 = %{
|
72
|
+
id,name,age
|
73
|
+
0,John,33
|
74
|
+
1,Jean-Baptiste,44
|
75
|
+
4,Matthew,20
|
76
|
+
}.strip + "\n"
|
77
|
+
|
78
|
+
d = Cevennes.diff('id', cvs0, cvs1, drop_equals: true)
|
79
|
+
# ==>
|
80
|
+
[
|
81
|
+
[ 'keys', 1, [ 'id', 'name', 'age' ],
|
82
|
+
1, [ 'id', 'name', 'age' ] ],
|
83
|
+
[ 'stats',
|
84
|
+
{ '=' => 1, '!' => 1, '-' => 1, '+' => 1,
|
85
|
+
'l0' => 3, 'l1' => 3 } ],
|
86
|
+
[ '!', 3, [ '1', 'Jean-Baptiste', '43' ],
|
87
|
+
3, [ '1', 'Jean-Baptiste', '44' ] ],
|
88
|
+
[ '-', 4, [ '3', 'Luke', '21'],
|
89
|
+
-1, nil ],
|
90
|
+
[ '+', -1, nil,
|
91
|
+
4, [ '4', 'Matthew', '20' ] ]
|
92
|
+
]
|
93
|
+
#
|
94
|
+
# the "=" entries are not included
|
95
|
+
```
|
96
|
+
|
97
|
+
|
60
98
|
## LICENSE
|
61
99
|
|
62
100
|
MIT, see [LICENSE.txt](LICENSE.txt)
|
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.2.0'
|
9
9
|
|
10
10
|
class << self
|
11
11
|
|
@@ -40,6 +40,8 @@ module Cevennes
|
|
40
40
|
s['l0'] = h0.length
|
41
41
|
s['l1'] = h1.length
|
42
42
|
|
43
|
+
d = d.reject { |e| e[0] == '=' } if opts[:drop_equals]
|
44
|
+
|
43
45
|
[ [ 'keys', *ks0, *ks1 ], [ 'stats', s ] ] + d
|
44
46
|
end
|
45
47
|
|
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.2.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:
|
11
|
+
date: 2022-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|