evt-schema 2.3.1.5 → 2.3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schema/data_structure.rb +5 -5
- data/lib/schema/schema.rb +3 -3
- data/lib/schema.rb +1 -1
- metadata +4 -5
- data/lib/schema/scratch.rb +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d2604faa3a43356561c9c0ccaf6ef63550d3351d79a6f4f032acf62b4ebb6d0
|
4
|
+
data.tar.gz: 4e93fb8a36bb8fb3de0220c08450b56254a14ef3447ea242a9d09774e4bb3ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d6b5342a2df666e0fcbe3e1d3c25afd67a2854b1f1e46c02fc836c92f94568e3df6a9da492dd0d8f50ef4b4b0c6393175056aba8bb8ed2faa07d1115cd926df
|
7
|
+
data.tar.gz: 6bd8e4673db5859e8b29a2b587afe94a1faf55966c52683f5d5e3a64ee18f0ebb036eff3516a48a385988e1e18ca8645955023ebdf1d42a236e54aceeaba564c
|
@@ -2,19 +2,19 @@ module Schema
|
|
2
2
|
module DataStructure
|
3
3
|
def self.included(cls)
|
4
4
|
cls.class_exec do
|
5
|
-
include
|
5
|
+
include TemplateMethod
|
6
6
|
include Schema
|
7
7
|
extend Build
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
template_method :configure
|
10
|
+
template_method :configure_dependencies do
|
11
11
|
configure
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
template_method :transform_read do |data|
|
15
15
|
transform_in(data)
|
16
16
|
end
|
17
|
-
|
17
|
+
template_method :transform_in
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
data/lib/schema/schema.rb
CHANGED
@@ -7,12 +7,12 @@ module Schema
|
|
7
7
|
extend AttributeMacro
|
8
8
|
extend Attributes
|
9
9
|
|
10
|
-
include
|
10
|
+
include TemplateMethod
|
11
11
|
|
12
|
-
|
12
|
+
template_method :transform_write do |data|
|
13
13
|
transform_out(data)
|
14
14
|
end
|
15
|
-
|
15
|
+
template_method :transform_out
|
16
16
|
|
17
17
|
const_set(:Boolean, Boolean)
|
18
18
|
end
|
data/lib/schema.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.1.
|
4
|
+
version: 2.3.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-attribute
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: evt-
|
70
|
+
name: evt-template_method
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -115,7 +115,6 @@ files:
|
|
115
115
|
- lib/schema/schema/compare.rb
|
116
116
|
- lib/schema/schema/compare/comparison.rb
|
117
117
|
- lib/schema/schema/compare/comparison/entry.rb
|
118
|
-
- lib/schema/scratch.rb
|
119
118
|
- lib/schema/validation/error.rb
|
120
119
|
- lib/schema/validation/nil_attributes.rb
|
121
120
|
homepage: https://github.com/eventide-project/schema
|
@@ -137,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
136
|
- !ruby/object:Gem::Version
|
138
137
|
version: '0'
|
139
138
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
139
|
+
rubygems_version: 3.4.10
|
141
140
|
signing_key:
|
142
141
|
specification_version: 4
|
143
142
|
summary: Primitives for schema and data structure
|
data/lib/schema/scratch.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
Foo.build
|
2
|
-
|
3
|
-
-> transform_read({})
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
class Thing
|
14
|
-
attribute :some_attribute, String
|
15
|
-
attribute :some_object, SomeClass
|
16
|
-
|
17
|
-
def self.transform_read(data)
|
18
|
-
some_object_data = data[:some_object] # => nil or some hash
|
19
|
-
|
20
|
-
if not some_object_data.nil?
|
21
|
-
foo_data = some_object_data[:foo] # => Error
|
22
|
-
end
|
23
|
-
|
24
|
-
some_object = SomeClass.build(some_object_data)
|
25
|
-
|
26
|
-
data[:some_object] = some_object
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class SomeClass
|
31
|
-
attribute :foo
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
data = {}
|
36
|
-
thing = Thing.build(data)
|
37
|
-
|
38
|
-
build(data) -> transform_read(data) # Rem: data is empty
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
thing = data[:some_atttribute]
|
47
|
-
# => nil
|
48
|
-
|
49
|
-
thing.other_thing
|
50
|
-
# => nil reference error
|