mini_defender 0.1.10 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mini_defender/validator.rb +5 -3
- data/lib/mini_defender/version.rb +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: 558b5d94318a81f2f82af39e68f2945063310dd648cbdc7dce7b11db2452d331
|
4
|
+
data.tar.gz: b110e5e0d706c60b6e26681906c555e8b2554f9d4fcd518e27a5d2cf803f3da2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a01a92db5349fa2273418c6e12477d66d59bc160f7b16d21ff6f9953b3608433428e2fd6b13b35193c1ad5a69445c25e22bb746ef27ce0737d6d4c9e6a79e78a
|
7
|
+
data.tar.gz: 45f4354582db5e8e1a73a53037f162f35505b334bf8fa4ac1d8560809df4d6b103790c3753886d0cd8b0fae041b35c6b49ee0bb26fe5863a2bcc3d4cbd6c89b5
|
@@ -50,20 +50,22 @@ module MiniDefender
|
|
50
50
|
next
|
51
51
|
end
|
52
52
|
|
53
|
-
value = @data[k]
|
53
|
+
value = coerced = @data[k]
|
54
54
|
rule_set.each do |rule|
|
55
55
|
next unless rule.active?(self)
|
56
56
|
|
57
57
|
value_included &= !rule.excluded?(self)
|
58
58
|
|
59
|
-
|
59
|
+
if rule.passes?(k, coerced, self)
|
60
|
+
coerced = rule.coerce(coerced)
|
61
|
+
else
|
60
62
|
@errors[k] << rule.error_message(k, value, self)
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
64
66
|
if @errors[k].empty? && value_included
|
65
67
|
@validated[k] = value
|
66
|
-
@coerced[k] =
|
68
|
+
@coerced[k] = coerced
|
67
69
|
end
|
68
70
|
end
|
69
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_defender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ali Alhoshaiyan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|