validation_profiler 1.4.1 → 1.5.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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 91535ba345c6a0bd0054c4bf41d535e933fed864f19e2bd28b84a0d5c459a4b3
|
4
|
+
data.tar.gz: 96ecb4ee6c75bdca5dd536964e79120e35d1733ed31e6711bc86bf9f54de9052
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b32686a6c08567f043be516baf9389911d13a0e940d4e57e5df752c4345b88fbb4360723cf3ef9c0bb1ebd199bc0e4ca088fb08edfd4b52591561a4fcfdeed41
|
7
|
+
data.tar.gz: ab4d1e452e567edce9c30b1637d211f422eb179be236dbf2cf67944ee8f93fc2a8129b2fcde35c4d514d0861621a3f7ab30406cb010bc1e85d73729f521c77a9
|
@@ -20,7 +20,6 @@ module ValidationProfiler
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
23
|
def validate(obj, field, attributes = {}, parent = nil)
|
25
24
|
|
26
25
|
#attempt to get the field value from the object
|
@@ -29,15 +28,28 @@ module ValidationProfiler
|
|
29
28
|
if !is_required?(field_value, attributes)
|
30
29
|
return true
|
31
30
|
end
|
32
|
-
|
31
|
+
|
32
|
+
if attributes[:multiple] == true
|
33
|
+
return multiple_valid?(field_value)
|
34
|
+
end
|
35
|
+
|
33
36
|
#validate the value against the regex
|
34
37
|
if field_value =~ REGEX
|
35
38
|
return true
|
36
39
|
end
|
37
40
|
|
38
|
-
|
41
|
+
false
|
39
42
|
|
40
43
|
end
|
44
|
+
|
45
|
+
def multiple_valid?(value)
|
46
|
+
return false unless value.is_a? String
|
47
|
+
value.split(/ *[,|;] */).each do |val|
|
48
|
+
next if val =~ REGEX
|
49
|
+
return false
|
50
|
+
end
|
51
|
+
true
|
52
|
+
end
|
41
53
|
|
42
54
|
end
|
43
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validation_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sage One
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: A Validation framework for creating validation profiles, allowing for
|
70
84
|
the separation & reuse of validation logic from the object being validated.
|
71
85
|
email:
|
@@ -106,6 +120,7 @@ files:
|
|
106
120
|
- lib/validation_profiler/rules/time_validation_rule.rb
|
107
121
|
- lib/validation_profiler/rules/validation_rule.rb
|
108
122
|
- lib/validation_profiler/rules/validation_rule_manager.rb
|
123
|
+
- lib/validation_profiler/version.rb
|
109
124
|
homepage: https://github.com/sage/validation_profiler
|
110
125
|
licenses:
|
111
126
|
- MIT
|
@@ -126,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
141
|
version: '0'
|
127
142
|
requirements: []
|
128
143
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.7.7
|
130
145
|
signing_key:
|
131
146
|
specification_version: 4
|
132
147
|
summary: A Validation framework for creating validation profiles, allowing for the
|