validation_profiler 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/validation_profiler.rb +7 -1
- data/lib/validation_profiler/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baeca9907ceff378745b670ce9c27f2ec426fc75
|
4
|
+
data.tar.gz: f8f7eccde03ed9e1150bd09580171c66bffcf1d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 412d6af8cfea9c35be540af66c79b4caf916db726b95eb59a3ebc231e15e222dfa348b90a62d71a8c185e7c6eb67d2e6fec7a399b15358b85fa30c673b29a7c0
|
7
|
+
data.tar.gz: 84bfc375d6152154baddde7f97b66c2e0a9ecad5149df7214fbfc27d5cc1cfd306321c1f6914508d2584f65e01c8d40f4260c4ef7e5403ac8bb06587c8484aec
|
data/lib/validation_profiler.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'validation_profiler/version'
|
2
2
|
require 'validation_profiler/rules/rules'
|
3
3
|
require 'validation_profiler/rules/validation_rule_manager'
|
4
|
+
|
4
5
|
class Class
|
5
6
|
|
6
7
|
# Specifies a validation rule to use within a validation profile.
|
@@ -10,7 +11,7 @@ class Class
|
|
10
11
|
# @param attributes [Hash] [Optional] A has containing the validation rule options
|
11
12
|
def validates(field, rule, attributes = {})
|
12
13
|
|
13
|
-
if !
|
14
|
+
if !self.class_variable_defined?(:@@validation_rules)
|
14
15
|
self.class_variable_set(:@@validation_rules, [])
|
15
16
|
end
|
16
17
|
|
@@ -21,6 +22,10 @@ class Class
|
|
21
22
|
|
22
23
|
end
|
23
24
|
|
25
|
+
def self.sides
|
26
|
+
@@sides
|
27
|
+
end
|
28
|
+
|
24
29
|
end
|
25
30
|
|
26
31
|
class ValidationManager
|
@@ -36,6 +41,7 @@ class ValidationManager
|
|
36
41
|
result = ValidationManagerResult.new
|
37
42
|
|
38
43
|
validation_rules = profile.class_variable_get(:@@validation_rules)
|
44
|
+
|
39
45
|
validation_rules.each do |r|
|
40
46
|
|
41
47
|
if ValidationRuleManager.instance == nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validation_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaughanbrittonsage
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: A Validation framework for creating validation profiles, allowing for
|
56
70
|
the separation & reuse of validation logic from the object being validated.
|
57
71
|
email:
|