enolib 0.8.0 → 0.8.1

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: 49f109d1e380fde591e9fd8356d83a1024f5bcfb617d4408cbd803b8723379a0
4
- data.tar.gz: 8015043eb20b92a86b6afd8a7ae510eb47f24b5fd10226bcadd0b8fe5021c76c
3
+ metadata.gz: 82a5f3b57bea51aba3499b9644e9cd29474d66b7ba128d518a54d8e521ae083a
4
+ data.tar.gz: 7ade76737f47280a31e461e2e72314ab5f3c251ae7c2bc24e2e94074b0dd5b72
5
5
  SHA512:
6
- metadata.gz: 7525f016c0835c764b5b5888c98bf57214a8e1918458bd8253ac44cc424e9563713376fc369ee6198d389c63a52db79e6476c7ab476708780c4884883ba52693
7
- data.tar.gz: 3667c043b3089e5ef598567adc6f5fe57e0246f98f82ff3f6052050945adbcb1af03a7f16aac343acb26c710229d7548deedd7108ddb310bdf2da66821a4e83f
6
+ metadata.gz: 601b7caa41e96e34d343aed777e9b5ca070f66403b3b495e68117d0fccde5fd5c7f84e0cde09ee875e3923a8806abf75440f5047929064b7e87862488f179fb5
7
+ data.tar.gz: 3aab9362a8488a9918546d53becbbee9bb33537cb1188f754ec500df86402c9781c44947df0339576638ae6029df2f7d1314dd85fd6cd973ce6f5b7b987294f2
@@ -34,7 +34,7 @@ module Enolib
34
34
 
35
35
  entries.each do |entry|
36
36
  next if entry.touched # TODO: Revisit instance var existance question in ruby
37
-
37
+
38
38
  if message.is_a?(Proc)
39
39
  message = message.call(entry)
40
40
  end
@@ -60,7 +60,7 @@ module Enolib
60
60
  end
61
61
 
62
62
  def optional_entry(key)
63
- _entry(key, optional: true)
63
+ _entry(key, required: false)
64
64
  end
65
65
 
66
66
  def parent
@@ -104,7 +104,7 @@ module Enolib
104
104
  end
105
105
 
106
106
  if entries.empty?
107
- if required || @all_entries_required
107
+ if required || required == nil && @all_entries_required
108
108
  raise Errors::Validation.missing_element(@context, key, @instruction, 'missing_fieldset_entry')
109
109
  elsif required == nil
110
110
  return MissingFieldsetEntry.new(key, self)
@@ -286,7 +286,7 @@ module Enolib
286
286
  end
287
287
 
288
288
  if elements.empty?
289
- if required || @all_elements_required
289
+ if required || required == nil && @all_elements_required
290
290
  raise Errors::Validation.missing_element(@context, key, @instruction, 'missing_element')
291
291
  elsif required == nil
292
292
  return MissingSectionElement.new(key, self)
@@ -328,7 +328,7 @@ module Enolib
328
328
  end
329
329
 
330
330
  if elements.empty?
331
- if required || @all_elements_required
331
+ if required || required == nil && @all_elements_required
332
332
  raise Errors::Validation.missing_element(@context, key, @instruction, 'missing_empty')
333
333
  elsif required == nil
334
334
  return MissingEmpty.new(key, self)
@@ -374,7 +374,7 @@ module Enolib
374
374
  end
375
375
 
376
376
  if elements.empty?
377
- if required || @all_elements_required
377
+ if required || required == nil && @all_elements_required
378
378
  raise Errors::Validation.missing_element(@context, key, @instruction, 'missing_field')
379
379
  elsif required == nil
380
380
  return MissingField.new(key, self)
@@ -417,7 +417,7 @@ module Enolib
417
417
  end
418
418
 
419
419
  if elements.empty?
420
- if required || @all_elements_required
420
+ if required || required == nil && @all_elements_required
421
421
  raise Errors::Validation.missing_element(@context, key, @instruction, 'missing_fieldset')
422
422
  elsif required == nil
423
423
  return MissingFieldset.new(key, self)
@@ -483,7 +483,7 @@ module Enolib
483
483
  end
484
484
 
485
485
  if elements.empty?
486
- if required || @all_elements_required
486
+ if required || required == nil && @all_elements_required
487
487
  raise Errors::Validation.missing_element(@context, key, @instruction, 'missing_list')
488
488
  elsif required == nil
489
489
  return MissingList.new(key, self)
@@ -526,7 +526,7 @@ module Enolib
526
526
  end
527
527
 
528
528
  if elements.empty?
529
- if required || @all_elements_required
529
+ if required || required == nil && @all_elements_required
530
530
  raise Errors::Validation.missing_element(@context, key, @instruction, 'missing_section')
531
531
  elsif required == nil
532
532
  return MissingSection.new(key, self)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enolib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Repp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-28 00:00:00.000000000 Z
11
+ date: 2019-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep-cover
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.4
19
+ version: 0.7.5
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.4
26
+ version: 0.7.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement