evnt 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/evnt/command.rb +1 -1
- data/lib/evnt/validator.rb +34 -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: b47e9514c1003fc6c670c61af7b5d19974e479e27282ce09328abb2738fa7508
|
4
|
+
data.tar.gz: 9e47da764eb7806cb411c120332280b4bd8bf5a6d0ff4bd8f16f0dabfe9e5be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f318bbaace2c47ede9c46efbdf87c5cbe85a67c021ddec28db6a879c458770c2e2cde0cb47c66bfae2351408aa49aad4040e860bd31374bfe5384b339120f870
|
7
|
+
data.tar.gz: a3275d02c0ed51b194c04452f654bca1202b7f47dde5f2bd707b35d096c229c6246e283f492bac3b5896ca6c9ff4173b6f361cd338f5765c23cdd54f9caa3291
|
data/lib/evnt/command.rb
CHANGED
data/lib/evnt/validator.rb
CHANGED
@@ -73,12 +73,23 @@ module Evnt
|
|
73
73
|
_validates_string_blank if @_result
|
74
74
|
_validates_string_length if @_result
|
75
75
|
_validates_string_regex if @_result
|
76
|
+
_validates_string_min_length if @_result
|
77
|
+
_validates_string_max_length if @_result
|
76
78
|
when :integer
|
77
79
|
_validates_number_min if @_result
|
78
80
|
_validates_number_max if @_result
|
79
81
|
when :float
|
80
82
|
_validates_number_min if @_result
|
81
83
|
_validates_number_max if @_result
|
84
|
+
when :time
|
85
|
+
_validates_time_min if @_result
|
86
|
+
_validates_time_max if @_result
|
87
|
+
when :date
|
88
|
+
_validates_time_min if @_result
|
89
|
+
_validates_time_max if @_result
|
90
|
+
when :datetime
|
91
|
+
_validates_time_min if @_result
|
92
|
+
_validates_time_max if @_result
|
82
93
|
end
|
83
94
|
end
|
84
95
|
|
@@ -183,6 +194,16 @@ module Evnt
|
|
183
194
|
@_result = @value.length == @_options[:length]
|
184
195
|
end
|
185
196
|
|
197
|
+
def _validates_string_min_length
|
198
|
+
return if @value.nil? || @_options[:min_length].nil?
|
199
|
+
@_result = @value.length >= @_options[:min_length]
|
200
|
+
end
|
201
|
+
|
202
|
+
def _validates_string_max_length
|
203
|
+
return if @value.nil? || @_options[:max_length].nil?
|
204
|
+
@_result = @value.length <= @_options[:max_length]
|
205
|
+
end
|
206
|
+
|
186
207
|
def _validates_string_regex
|
187
208
|
return if @value.nil? || @_options[:regex].nil?
|
188
209
|
@_result = @value.match?(@_options[:regex])
|
@@ -201,6 +222,19 @@ module Evnt
|
|
201
222
|
@_result = @value <= @_options[:max]
|
202
223
|
end
|
203
224
|
|
225
|
+
# Time validations:
|
226
|
+
##########################################################################
|
227
|
+
|
228
|
+
def _validates_time_min
|
229
|
+
return if @value.nil? || @_options[:min].nil?
|
230
|
+
@_result = @value >= @_options[:min]
|
231
|
+
end
|
232
|
+
|
233
|
+
def _validates_time_max
|
234
|
+
return if @value.nil? || @_options[:max].nil?
|
235
|
+
@_result = @value <= @_options[:max]
|
236
|
+
end
|
237
|
+
|
204
238
|
end
|
205
239
|
|
206
240
|
end
|
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.2
|
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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|