evnt 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/evnt/validator.rb +12 -0
- data/lib/evnt/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: 04e50930d63c06bea3e9210c6e509a570994198cd4dd2c5f966d3701720587e0
|
4
|
+
data.tar.gz: bff08e10f4ae1c9379ec1256d4302b2a3230e8a72d4809b7c1df789b2c7f8695
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc055a1e3886e9603395ea779589d410194c7e14585d9ad6ce586a7ebad9b1b3474feebaf8b58e475e431b22f5d6ca306154dab76c0d5b60fd8ab40e251a37b
|
7
|
+
data.tar.gz: a597ef9f651a5f2d8ce358264f4a0faa42f866653e7eda72fb5c5a2cbdca2691bc84080bda10d1b586f9710a2b3ab77173af18230c92309b0e13ea34569f9b4e
|
data/README.md
CHANGED
@@ -34,6 +34,8 @@ Evnt is developed to be used over all kinds of projects and frameworks (like Rub
|
|
34
34
|
- [Event](https://github.com/ideonetwork/evnt/blob/master/doc/Event.md)
|
35
35
|
- [Handler](https://github.com/ideonetwork/evnt/blob/master/doc/Handler.md)
|
36
36
|
|
37
|
+
Every entity is a simple class that should be extended to structure your awesome project.
|
38
|
+
|
37
39
|
## Development
|
38
40
|
|
39
41
|
To update the documentation run:
|
data/lib/evnt/validator.rb
CHANGED
@@ -64,6 +64,7 @@ module Evnt
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def _validates_custom
|
67
|
+
_validates_global_equal if @_result
|
67
68
|
_validates_global_in if @_result
|
68
69
|
_validates_global_out if @_result
|
69
70
|
|
@@ -71,6 +72,7 @@ module Evnt
|
|
71
72
|
when :string
|
72
73
|
_validates_string_blank if @_result
|
73
74
|
_validates_string_length if @_result
|
75
|
+
_validates_string_regex if @_result
|
74
76
|
when :integer
|
75
77
|
_validates_number_min if @_result
|
76
78
|
_validates_number_max if @_result
|
@@ -153,6 +155,11 @@ module Evnt
|
|
153
155
|
# Global validations:
|
154
156
|
##########################################################################
|
155
157
|
|
158
|
+
def _validates_global_equal
|
159
|
+
return if @value.nil? || @_options[:equal].nil?
|
160
|
+
@_result = @_options[:equal] == @value
|
161
|
+
end
|
162
|
+
|
156
163
|
def _validates_global_in
|
157
164
|
return if @value.nil? || @_options[:in].nil?
|
158
165
|
@_result = @_options[:in].include?(@value)
|
@@ -176,6 +183,11 @@ module Evnt
|
|
176
183
|
@_result = @value.length == @_options[:length]
|
177
184
|
end
|
178
185
|
|
186
|
+
def _validates_string_regex
|
187
|
+
return if @value.nil? || @_options[:regex].nil?
|
188
|
+
@_result = @value.match?(@_options[:regex])
|
189
|
+
end
|
190
|
+
|
179
191
|
# Number validations:
|
180
192
|
##########################################################################
|
181
193
|
|
data/lib/evnt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evnt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ideonetwork
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|