schema-model 0.6.9 → 0.6.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schema/parsers/common.rb +16 -1
- data/schema-model.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f8ccd138c2e52700656fe5bcf67ba518cdfb4c756cf656f821928758872c795
|
4
|
+
data.tar.gz: 90f75db3fc2e4fbae2bf350894b973cea392e652ca0be9b81368f0e9195f6c4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed515074d1a4ec263196f6217c9917f03dadb24dd6dc0b116168198b0c78e73c2cb18f268ed23ea19997d3d06a7fc46b269a51bd42b4e33c38325be0226b86d1
|
7
|
+
data.tar.gz: 58ccd5d4e9902f0dfff14e92222dcb2a6095cbd5bf281004ca738bdbc33618c38c300f76115d25ca91749d3d8b08cd4ec3548c0eb1fdeb43eabb0494b893055e
|
@@ -48,6 +48,21 @@ module Schema
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
# if the string is empty return nil
|
52
|
+
def parse_string_or_nil(field_name, parsing_errors, value)
|
53
|
+
case value
|
54
|
+
when String
|
55
|
+
value.empty? ? nil : value
|
56
|
+
when ::Hash, ::Array
|
57
|
+
parsing_errors.add(field_name, ::Schema::ParsingErrors::INCOMPATABLE)
|
58
|
+
nil
|
59
|
+
when nil
|
60
|
+
nil
|
61
|
+
else
|
62
|
+
String(value)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
51
66
|
def parse_float(field_name, parsing_errors, value)
|
52
67
|
case value
|
53
68
|
when Float
|
@@ -118,7 +133,7 @@ module Schema
|
|
118
133
|
when Integer, Float
|
119
134
|
value != 0
|
120
135
|
when String
|
121
|
-
BOOLEAN_REGEX.match(value)
|
136
|
+
BOOLEAN_REGEX.match?(value)
|
122
137
|
when nil
|
123
138
|
nil
|
124
139
|
else
|
data/schema-model.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Youch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inheritance-helper
|