data_model 0.5.0 → 0.6.0

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: c330ccaea1eb4d6a39ae646d1bfc1adea6fcea63398c393ca9daea37ad6c9345
4
- data.tar.gz: 9ca8082aa99dd38e6c9838d089201be698713a2af312492d9f8d5c6d0512dddb
3
+ metadata.gz: f3a30187193b436d7dd863a4b2fe28d8baf21428d6fd936cb67555e9792786a7
4
+ data.tar.gz: e44e496aaf29d7ecd8dfd5633aae5275bb67a1ecfb821f7a64137f9532c36cca
5
5
  SHA512:
6
- metadata.gz: e0b248691f742a60fe78029b5793cd00afd383457f3cd16610a56bb096e2cb37db0ad7c1cb064ec9fef4ffd6750b07857f8f2f4d44db3c06cf57ab342d6759c2
7
- data.tar.gz: c5438f427c94cf00c3f4f64ed4078c80211f705d2646ad6489dcf4ae4c34165fa420498755e2131b2c0185cd84a57c582c7bac77a489f01f4cfa4d23a4bd2297
6
+ metadata.gz: 9fd5b20f3a87909ef221656b6b541413f1201759e08cc51af148fbd18037c0b54b0253e2e21f51adf4503d4b61d1dbe4e5a929a62310574964e9214875d772a8
7
+ data.tar.gz: 47c5090b016f7ac15162c74e62464da01b1a4c170ae52db0f28f63d71a7686f7acd3063624b8c2ec5813d76fa826af56a1b4649d85162d220877e8053ff63890
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- data_model (0.4.0)
4
+ data_model (0.5.0)
5
5
  zeitwerk
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (7.0.5)
10
+ activesupport (7.0.6)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
@@ -15,8 +15,9 @@ GEM
15
15
  ast (2.4.2)
16
16
  coderay (1.1.3)
17
17
  concurrent-ruby (1.2.2)
18
- csv (3.2.6)
18
+ csv (3.2.7)
19
19
  diff-lcs (1.5.0)
20
+ erubi (1.12.0)
20
21
  ffi (1.15.5)
21
22
  fileutils (1.7.1)
22
23
  formatador (1.1.0)
@@ -32,7 +33,7 @@ GEM
32
33
  guard-rake (1.0.0)
33
34
  guard
34
35
  rake
35
- i18n (1.13.0)
36
+ i18n (1.14.1)
36
37
  concurrent-ruby (~> 1.0)
37
38
  json (2.6.3)
38
39
  language_server-protocol (3.17.0.3)
@@ -40,63 +41,69 @@ GEM
40
41
  rb-fsevent (~> 0.10, >= 0.10.3)
41
42
  rb-inotify (~> 0.9, >= 0.9.10)
42
43
  logger (1.5.3)
43
- lumberjack (1.2.8)
44
+ lumberjack (1.2.9)
44
45
  method_source (1.0.0)
45
- minitest (5.18.0)
46
+ minitest (5.19.0)
46
47
  nenv (0.3.0)
47
48
  netrc (0.11.0)
48
49
  notiffany (0.1.3)
49
50
  nenv (~> 0.1)
50
51
  shellany (~> 0.0)
51
52
  parallel (1.23.0)
52
- parser (3.2.2.1)
53
+ parser (3.2.2.3)
53
54
  ast (~> 2.4.1)
55
+ racc
56
+ prettier_print (1.2.1)
54
57
  pry (0.14.2)
55
58
  coderay (~> 1.1)
56
59
  method_source (~> 1.0)
60
+ racc (1.7.1)
57
61
  rainbow (3.1.1)
58
62
  rake (13.0.6)
59
63
  rb-fsevent (0.11.2)
60
64
  rb-inotify (0.10.1)
61
65
  ffi (~> 1.0)
62
- rbi (0.0.16)
66
+ rbi (0.0.17)
63
67
  ast
64
- parser (>= 2.6.4.0)
68
+ parser (>= 3.0.0)
65
69
  sorbet-runtime (>= 0.5.9204)
66
- unparser
67
- rbs (3.1.0)
68
- regexp_parser (2.8.0)
69
- rexml (3.2.5)
70
- rubocop (1.50.2)
70
+ unparser (>= 0.5.6)
71
+ rbs (3.1.3)
72
+ regexp_parser (2.8.1)
73
+ rexml (3.2.6)
74
+ rubocop (1.55.1)
71
75
  json (~> 2.3)
76
+ language_server-protocol (>= 3.17.0)
72
77
  parallel (~> 1.10)
73
- parser (>= 3.2.0.0)
78
+ parser (>= 3.2.2.3)
74
79
  rainbow (>= 2.2.2, < 4.0)
75
80
  regexp_parser (>= 1.8, < 3.0)
76
81
  rexml (>= 3.2.5, < 4.0)
77
- rubocop-ast (>= 1.28.0, < 2.0)
82
+ rubocop-ast (>= 1.28.1, < 2.0)
78
83
  ruby-progressbar (~> 1.7)
79
84
  unicode-display_width (>= 2.4.0, < 3.0)
80
- rubocop-ast (1.28.0)
85
+ rubocop-ast (1.29.0)
81
86
  parser (>= 3.2.1.0)
82
87
  ruby-progressbar (1.13.0)
83
- rufo (0.16.1)
88
+ rufo (0.16.2)
84
89
  securerandom (0.2.2)
85
90
  shellany (0.0.1)
86
- sorbet (0.5.10795)
87
- sorbet-static (= 0.5.10795)
88
- sorbet-runtime (0.5.10795)
89
- sorbet-static (0.5.10795-universal-darwin-22)
90
- sorbet-static-and-runtime (0.5.10795)
91
- sorbet (= 0.5.10795)
92
- sorbet-runtime (= 0.5.10795)
93
- spoom (1.2.1)
91
+ sorbet (0.5.10950)
92
+ sorbet-static (= 0.5.10950)
93
+ sorbet-runtime (0.5.10950)
94
+ sorbet-static (0.5.10950-universal-darwin-22)
95
+ sorbet-static-and-runtime (0.5.10950)
96
+ sorbet (= 0.5.10950)
97
+ sorbet-runtime (= 0.5.10950)
98
+ spoom (1.2.2)
99
+ erubi (>= 1.10.0)
94
100
  sorbet (>= 0.5.10187)
95
101
  sorbet-runtime (>= 0.5.9204)
102
+ syntax_tree (>= 6.1.1)
96
103
  thor (>= 0.19.2)
97
- steep (1.4.0)
104
+ steep (1.5.2)
98
105
  activesupport (>= 5.1)
99
- concurrent-ruby (>= 1.2.2)
106
+ concurrent-ruby (>= 1.1.10)
100
107
  csv (>= 3.0.9)
101
108
  fileutils (>= 1.1.0)
102
109
  json (>= 2.1.0)
@@ -105,12 +112,14 @@ GEM
105
112
  logger (>= 1.3.0)
106
113
  parser (>= 3.1)
107
114
  rainbow (>= 2.2.2, < 4.0)
108
- rbs (>= 2.8.0)
115
+ rbs (>= 3.1.0)
109
116
  securerandom (>= 0.1)
110
117
  strscan (>= 1.0.0)
111
118
  terminal-table (>= 2, < 4)
112
119
  strscan (3.0.6)
113
- tapioca (0.11.5)
120
+ syntax_tree (6.1.1)
121
+ prettier_print (>= 1.2.0)
122
+ tapioca (0.11.8)
114
123
  bundler (>= 2.2.25)
115
124
  netrc (>= 0.11.0)
116
125
  parallel (>= 1.21.0)
@@ -121,18 +130,18 @@ GEM
121
130
  yard-sorbet
122
131
  terminal-table (3.0.2)
123
132
  unicode-display_width (>= 1.1.1, < 3)
124
- thor (1.2.1)
133
+ thor (1.2.2)
125
134
  tzinfo (2.0.6)
126
135
  concurrent-ruby (~> 1.0)
127
136
  unicode-display_width (2.4.2)
128
- unparser (0.6.7)
137
+ unparser (0.6.8)
129
138
  diff-lcs (~> 1.3)
130
139
  parser (>= 3.2.0)
131
140
  yard (0.9.34)
132
141
  yard-sorbet (0.8.1)
133
142
  sorbet-runtime (>= 0.5)
134
143
  yard (>= 0.9)
135
- zeitwerk (2.6.7)
144
+ zeitwerk (2.6.11)
136
145
 
137
146
  PLATFORMS
138
147
  arm64-darwin-22
@@ -149,4 +158,4 @@ DEPENDENCIES
149
158
  tapioca
150
159
 
151
160
  BUNDLED WITH
152
- 2.4.12
161
+ 2.4.18
@@ -134,8 +134,16 @@ module DataModel
134
134
 
135
135
  # detect extra keys then what is defined in the schema
136
136
  if !args.open
137
- keys = children.keys
138
- extra = val.keys - keys
137
+ found = []
138
+ for child_key in children.keys
139
+ for val_key in val.keys
140
+ if val_key.to_s == child_key.to_s # doing it this way to support symbols and strings
141
+ found << val_key
142
+ end
143
+ end
144
+ end
145
+
146
+ extra = val.keys - found
139
147
 
140
148
  if !extra.empty?
141
149
  errors.add(extra_keys_error(extra))
@@ -97,9 +97,13 @@ module DataModel
97
97
  end
98
98
 
99
99
  for req in self.class.required_types
100
- if !data.key?(req)
101
- raise "Missing required field #{req}"
100
+ for key in data.keys
101
+ if key.to_s == req.to_s
102
+ next
103
+ end
102
104
  end
105
+
106
+ raise "Missing required field #{req}"
103
107
  end
104
108
  end
105
109
 
@@ -1,3 +1,3 @@
1
1
  module DataModel
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Briggs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-30 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
222
  requirements: []
223
- rubygems_version: 3.4.10
223
+ rubygems_version: 3.4.18
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Define a model for your data