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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6b604ac611ad1d24fe34ce9769c5d5b34ca1f0cdbf005ff08bce1152f24976e
4
- data.tar.gz: e2925852747049479ad3172780c62e1c32ec9d04958d6de7c82049a7aa8103ae
3
+ metadata.gz: 598f7e128effec146dbe0acc01bd26101b689a6efdcf647c061416aa43accb53
4
+ data.tar.gz: b1cf17c58da5e0562100feff9fe40c1eee3cf07a2fc6fab0b724fbd792a240f9
5
5
  SHA512:
6
- metadata.gz: 7f77f3878e80646e0ea1d0b2c67bd6927cd5c60ab7b08acdb78747c83e14c6c38752753d4a90f055fdfc797a72f675dbe069240b278110f7b402dc2992d88c42
7
- data.tar.gz: b6ad6a2ab702e874bc03a6ca11c265fcd3157f77a556482a447e8d579381be5a50812e23ff1b6253032a50f9a5347af1ef849f5a37128ce7c20cc6c5d5c23e78
6
+ metadata.gz: 9686e580322ab076d7e85506d716aaac8e2d131d9af350b31b2985539bfc8d7a01f2b40dfd23e285e78e620e82dbc2cede2d1840c5d60f72d130b22f16cf3502
7
+ data.tar.gz: 5bcef831927839276c9ca7f4304d5c6904f37587d4f4654ba88962250eafd59bfc7036ba1ff9f25824e898a2e8f5f87a250f3aa0317a7e1fadd696c4efe97453
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## cevennes 1.2.0 released 2022-07-05
6
+
7
+ - Introduce `drop_equals: true`
8
+
9
+
5
10
  ## cevennes 1.1.1 released 2021-02-25
6
11
 
7
12
  - Refine UTF-8 re-encoding
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2018-2021, John Mettraux, jmettraux@gmail.com
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
@@ -28,7 +28,7 @@ build: gemspec_validate
28
28
  mv $(NAME)-$(VERSION).gem pkg/
29
29
 
30
30
  push: build
31
- gem push pkg/$(NAME)-$(VERSION).gem
31
+ gem push --otp "$(OTP)" pkg/$(NAME)-$(VERSION).gem
32
32
 
33
33
  spec:
34
34
  bundle exec rspec
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  # cevennes
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/jmettraux/cevennes.svg)](http://travis-ci.org/jmettraux/cevennes)
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.1.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.1.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: 2021-02-25 00:00:00.000000000 Z
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