evnt 3.6.3 → 3.6.4
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/evnt/command.rb +4 -3
- data/lib/evnt/event.rb +24 -18
- 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: 48a269bcba5e53791dc505227f9dc91aab4b0ed4124d8e86c3b58667355e33e8
|
4
|
+
data.tar.gz: 993d4e0eb8dd418d469796add41b7df78000fc2bef25ac9c339143eb9cc8b2d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d82983ce2a886410416941fa0b148e0617a7226dcc1f50f0fc144f9f54c9860a44c02379691503e9ab954a493c8f408f6534f198f52ff3c384863a266d87d0fb
|
7
|
+
data.tar.gz: d70d16ef3d6470d9b77d15ffa811e2b2cd272da31566d4ea2e96d0fb684e120d8d5fb2de146a551a9b05c3ac669b885d3308eb66d17fbe7afe632f3d5d6b1b92
|
data/lib/evnt/command.rb
CHANGED
@@ -213,10 +213,11 @@ module Evnt
|
|
213
213
|
|
214
214
|
# This function sets the single validation request for a command parameter.
|
215
215
|
def validates(param, options)
|
216
|
-
|
217
|
-
|
216
|
+
@validations ||= []
|
217
|
+
@validations.push(param: param, options: options)
|
218
|
+
command_validations = @validations
|
218
219
|
|
219
|
-
define_method('_validations', -> {
|
220
|
+
define_method('_validations', -> { return command_validations })
|
220
221
|
end
|
221
222
|
|
222
223
|
# This function sets the normalize params function for the command.
|
data/lib/evnt/event.rb
CHANGED
@@ -217,10 +217,11 @@ module Evnt
|
|
217
217
|
|
218
218
|
# This function sets the default options that should be used by the event.
|
219
219
|
def default_options(options)
|
220
|
-
|
221
|
-
|
220
|
+
@options ||= {}
|
221
|
+
@options.merge!(options)
|
222
|
+
event_options = @options
|
222
223
|
|
223
|
-
define_method('_default_options', -> {
|
224
|
+
define_method('_default_options', -> { return event_options })
|
224
225
|
end
|
225
226
|
|
226
227
|
# This function sets the name for the event.
|
@@ -230,34 +231,38 @@ module Evnt
|
|
230
231
|
|
231
232
|
# This function sets the list of payload attributes for the event.
|
232
233
|
def payload_attributes_are(*attributes)
|
233
|
-
|
234
|
-
|
234
|
+
@payload_attributes ||= []
|
235
|
+
@payload_attributes.concat(attributes).uniq!
|
236
|
+
event_payload_attributes = @payload_attributes
|
235
237
|
|
236
|
-
define_method('_payload_attributes', -> {
|
238
|
+
define_method('_payload_attributes', -> { return event_payload_attributes })
|
237
239
|
end
|
238
240
|
|
239
241
|
# This function sets the list of extras attributes for the event.
|
240
242
|
def extras_attributes_are(*attributes)
|
241
|
-
|
242
|
-
|
243
|
+
@extras_attributes ||= []
|
244
|
+
@extras_attributes.concat(attributes).uniq!
|
245
|
+
event_extras_attributes = @extras_attributes
|
243
246
|
|
244
|
-
define_method('_extras_attributes', -> {
|
247
|
+
define_method('_extras_attributes', -> { return event_extras_attributes })
|
245
248
|
end
|
246
249
|
|
247
250
|
# DEPRECATED: This function sets the list of attributes for the event.
|
248
251
|
def attributes_are(*attributes)
|
249
|
-
|
250
|
-
|
252
|
+
@payload_attributes ||= []
|
253
|
+
@payload_attributes.concat(attributes).uniq!
|
254
|
+
event_payload_attributes = @payload_attributes
|
251
255
|
|
252
|
-
define_method('_payload_attributes', -> {
|
256
|
+
define_method('_payload_attributes', -> { return event_payload_attributes })
|
253
257
|
end
|
254
258
|
|
255
259
|
# This function sets the list of handlers for the event.
|
256
260
|
def handlers_are(handlers)
|
257
|
-
|
258
|
-
|
261
|
+
@handlers ||= []
|
262
|
+
@handlers.concat(handlers)
|
263
|
+
event_handlers = @handlers
|
259
264
|
|
260
|
-
define_method('_handlers', -> {
|
265
|
+
define_method('_handlers', -> { return event_handlers })
|
261
266
|
end
|
262
267
|
|
263
268
|
# This function sets the write event function for the event.
|
@@ -267,10 +272,11 @@ module Evnt
|
|
267
272
|
|
268
273
|
# This function is used to add a new handler to the event from the external.
|
269
274
|
def add_handler(handler)
|
270
|
-
|
271
|
-
|
275
|
+
@handlers ||= []
|
276
|
+
@handlers.push(handler)
|
277
|
+
event_handlers = @handlers
|
272
278
|
|
273
|
-
define_method('_handlers', -> {
|
279
|
+
define_method('_handlers', -> { return event_handlers })
|
274
280
|
end
|
275
281
|
|
276
282
|
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.6.
|
4
|
+
version: 3.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ideonetwork
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|