cvg 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +6 -0
- data/bin/cvg +12 -1
- data/features/basic.feature +21 -0
- data/lib/cvg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjE2NjE3OTZhOWE0OWU4MWQzZTk5Njc5MGVjYjJmMTE0ZjFkNzJjMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTJlMmZkODU4ZWUzODVkMjNlMjdkYWNhNmQxMDM3MGU3YmVlNDcyYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGNlYTIwNGJlN2JlMzZiMTVhMmQ2Y2FiYjMxZWVhYzcwNTA3ZGMxNDUyZDE0
|
10
|
+
NTgwNWNkMjgxNjUzMzNkZmJiY2M3MTM1YWI3YjRjZjY4YTYwYTliMjU1Yjgw
|
11
|
+
Mzk5Mjc4N2NmYWQ4OTUzNzEzMGMzYzE0YzJiYzg1MDA4OGE3N2U=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjVjZDAyZWIwMGYxYzE1Y2NiMDY2OWQ1ZmY2MmVkZjJkZGJjNDExNDdkNzc2
|
14
|
+
OThiMzNmMGFjNDU2ZDBlMzBmODkzOTlkODM1ODVhOTlmMGIyN2Q3Yzc1MmIz
|
15
|
+
NmQ1Yjc0Y2U0MWRlNDk5ODgyOTVjZjRhYTRiYTUxNzNmMGVlY2E=
|
data/CHANGELOG
CHANGED
data/bin/cvg
CHANGED
@@ -57,6 +57,17 @@ class Cvg
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
+
class AnyPresent < Test
|
61
|
+
class << self
|
62
|
+
def accept(k, arg)
|
63
|
+
new(k, arg) if k == 'any-present'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
def pass?(row)
|
67
|
+
row.values_at(*cols).any?(&:present?)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
60
71
|
class Missing < Test
|
61
72
|
class << self
|
62
73
|
def accept(k, arg)
|
@@ -211,7 +222,7 @@ class Cvg
|
|
211
222
|
end
|
212
223
|
end
|
213
224
|
|
214
|
-
TESTS = [Present, Missing, Match, GreaterOrLesser, Dedup]
|
225
|
+
TESTS = [Present, Missing, Match, GreaterOrLesser, Dedup, AnyPresent]
|
215
226
|
FLAGS = {
|
216
227
|
'detect-missing' => DetectMissing,
|
217
228
|
'count' => Count,
|
data/features/basic.feature
CHANGED
@@ -300,3 +300,24 @@ Feature: Basic functionality
|
|
300
300
|
bb,aa
|
301
301
|
bbb,aaa
|
302
302
|
"""
|
303
|
+
|
304
|
+
Scenario: Any of fields is present
|
305
|
+
Given an input csv
|
306
|
+
"""
|
307
|
+
a,b,c,d
|
308
|
+
yes,x,
|
309
|
+
yes,,x,
|
310
|
+
no,,,x
|
311
|
+
yes,_,,
|
312
|
+
yes,,_,
|
313
|
+
no," ",,
|
314
|
+
"""
|
315
|
+
When you pass arguments --any-present b,c
|
316
|
+
Then you get output
|
317
|
+
"""
|
318
|
+
a,b,c,d
|
319
|
+
yes,x,,
|
320
|
+
yes,,x,
|
321
|
+
yes,_,,
|
322
|
+
yes,,_,
|
323
|
+
"""
|
data/lib/cvg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cvg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seamus Abshere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|