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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTczMWJiNzMyZGI2NTBjM2E4YmRjNjE4ZGRhODQ1ZTliYmQ4NTE2NA==
4
+ ZjE2NjE3OTZhOWE0OWU4MWQzZTk5Njc5MGVjYjJmMTE0ZjFkNzJjMw==
5
5
  data.tar.gz: !binary |-
6
- NzJmZmMwMTFhOWNjZDZlM2MxNTcyNzU5NjgyYTA5NzA2YTQwZGZlNg==
6
+ NTJlMmZkODU4ZWUzODVkMjNlMjdkYWNhNmQxMDM3MGU3YmVlNDcyYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmZiZDk0MmYxYzVkMmIxYTY4YmQ2Njk3MjJiODM4YjIxMjZlMTExNjlhNzBi
10
- ZjVjMTIyY2M5OTQwMzQ5MjlhMWUwNDQ3MzhjNWJhNTZhNzg4NmRlOGQ1ZDRi
11
- ODg5NDg3ZjdlMDc0NTAxY2JlNzgyNDlhOWNiNTRjMWZmZjRkM2Q=
9
+ NGNlYTIwNGJlN2JlMzZiMTVhMmQ2Y2FiYjMxZWVhYzcwNTA3ZGMxNDUyZDE0
10
+ NTgwNWNkMjgxNjUzMzNkZmJiY2M3MTM1YWI3YjRjZjY4YTYwYTliMjU1Yjgw
11
+ Mzk5Mjc4N2NmYWQ4OTUzNzEzMGMzYzE0YzJiYzg1MDA4OGE3N2U=
12
12
  data.tar.gz: !binary |-
13
- ODlmNWM4NjA0ZDMwYTJlMWZkMzZmZmQ4NGEyOTk4NTM3YTYxYjYyY2JhNDk3
14
- YzQ2MTYxMGI5ZWYwMGM0OTgyZGU0OTlmMzdjNDFmZmRiNmEyMTYwMDhiYjA3
15
- ZWQ5YTFkNWY3ZDdmM2VlYWRiMmFmZGQzMGJlM2MzZWJkMGUyYzA=
13
+ ZjVjZDAyZWIwMGYxYzE1Y2NiMDY2OWQ1ZmY2MmVkZjJkZGJjNDExNDdkNzc2
14
+ OThiMzNmMGFjNDU2ZDBlMzBmODkzOTlkODM1ODVhOTlmMGIyN2Q3Yzc1MmIz
15
+ NmQ1Yjc0Y2U0MWRlNDk5ODgyOTVjZjRhYTRiYTUxNzNmMGVlY2E=
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 0.1.2 / 2013-11-11
2
+
3
+ * Enhancements
4
+
5
+ * --any-present b,c
6
+
1
7
  0.1.1 / 2013-11-11
2
8
 
3
9
  * Enhancements
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,
@@ -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
+ """
@@ -1,3 +1,3 @@
1
1
  class Cvg
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport