datacaster 3.2.3 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e87035b2c58689f1682294141d8ef6dfe02c6054a810e7bcda3a22f2d934091
|
4
|
+
data.tar.gz: d6262e0130ef3f831731e9b0d6095a40fa7a19bfa9eecd5a0630c5eb8a3d9513
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6800f34a95b7e8baaad2d2f093f4c6be58e35904220339c2c8c5452fcea375b169224ebf49c699d965073cf9b3777ab00b91adf48184d539c2ff1616accde73f
|
7
|
+
data.tar.gz: b8f9fd1227da11c029af5af57fb336f7e10f29b763123517ed4e5fbae0b27ca9ff6a65367841684edc366066ad27c720d367a318578b09637bfa98680bfcb58c
|
@@ -47,7 +47,8 @@ module Datacaster
|
|
47
47
|
when Hash
|
48
48
|
cast_hash(result, schema)
|
49
49
|
else
|
50
|
-
raise "Expected hash or array when checking #{
|
50
|
+
raise RuntimeError, "Expected hash or array inside result when checking #{result.inspect} " \
|
51
|
+
"(schema is #{schema.inspect})", caller
|
51
52
|
end
|
52
53
|
end
|
53
54
|
|
@@ -35,8 +35,20 @@ module Datacaster
|
|
35
35
|
@should_check_stack[-1] = true
|
36
36
|
end
|
37
37
|
|
38
|
+
# Notify current runtime that some child runtime has built schema,
|
39
|
+
# child runtime's schema is passed as the argument
|
38
40
|
def checked_schema!(schema)
|
39
|
-
|
41
|
+
# Current runtime has marked its schema as checked unconditionally
|
42
|
+
return if @pointer_stack[-1] == true
|
43
|
+
|
44
|
+
# Child runtime marks its schema as checked unconditionally, so
|
45
|
+
# current runtime should do as well
|
46
|
+
if schema == true
|
47
|
+
@pointer_stack[-1] = true
|
48
|
+
# Child runtime's schema should be merged with current runtime's schema
|
49
|
+
else
|
50
|
+
@pointer_stack[-1].merge!(schema)
|
51
|
+
end
|
40
52
|
end
|
41
53
|
|
42
54
|
def ignore_checks!(&block)
|
@@ -63,11 +63,8 @@ module Datacaster
|
|
63
63
|
result = check.with_runtime(runtime).(switch_result)
|
64
64
|
next unless result.valid?
|
65
65
|
|
66
|
-
if
|
67
|
-
|
68
|
-
else
|
69
|
-
return runtime.checked_key!(@pick_key) { clause.with_runtime(runtime).(object) }
|
70
|
-
end
|
66
|
+
runtime.checked_key!(@pick_key) if !@pick_key.nil? && !@pick_key.is_a?(Array)
|
67
|
+
return clause.with_runtime(runtime).(object)
|
71
68
|
end
|
72
69
|
|
73
70
|
# all 'on'-s have failed
|
data/lib/datacaster/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datacaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Zolotarev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|