rsmp 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rsmp/collect/matcher.rb +3 -3
- data/lib/rsmp/collect/query.rb +6 -4
- data/lib/rsmp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b82a88e9cd80aeb3bf0bc89b774727155dc8c6418520493c34a852809eb29e94
|
4
|
+
data.tar.gz: 16cb2331281e470233ff28fcf6ac1e89124a88628d920f8f3d7e486b0a076b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47d08d2fab1e0dd76dc5e988b3ee4e56a3110258402ffc9d1d8213ca7cbd889e94d08119100b785dfc5803dfd5f0618ac25c2597e1499cebd7fbd2db500614d5
|
7
|
+
data.tar.gz: 321f695677507a66fa03a81fc2bdc87350df51278e53e95bb6f75e5eeea180ea3e1503f0ee072aea425970d32e7a814a8a683cd33abdf7d832cd8c83e216ff97
|
data/lib/rsmp/collect/matcher.rb
CHANGED
@@ -87,16 +87,16 @@ module RSMP
|
|
87
87
|
end
|
88
88
|
|
89
89
|
# Check if a messages matches our criteria.
|
90
|
-
#
|
91
|
-
# Breaks as soon as where done matching all queries
|
90
|
+
# Match each query against each item in the message
|
92
91
|
def check_match message
|
93
92
|
return unless match?(message)
|
94
93
|
@queries.each do |query| # look through queries
|
95
|
-
get_items(message).each do |item| # look through
|
94
|
+
get_items(message).each do |item| # look through items in message
|
96
95
|
matched = query.check_match(item,message)
|
97
96
|
if matched != nil
|
98
97
|
type = {true=>'match',false=>'mismatch'}[matched]
|
99
98
|
@proxy.log "#{@title.capitalize} #{message.m_id_short} collect #{type} #{query.want}, item #{item}", level: :debug
|
99
|
+
break
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
data/lib/rsmp/collect/query.rb
CHANGED
@@ -17,12 +17,14 @@ module RSMP
|
|
17
17
|
end
|
18
18
|
|
19
19
|
# Check an item and set @done to true if it matches
|
20
|
-
#
|
20
|
+
# Store the item and corresponding message if there's a positive or negative match
|
21
21
|
def check_match item, message
|
22
|
-
@message = message
|
23
|
-
@got = item
|
24
22
|
matched = match? item
|
25
|
-
|
23
|
+
if matched != nil
|
24
|
+
@message = message
|
25
|
+
@got = item
|
26
|
+
@done = matched
|
27
|
+
end
|
26
28
|
matched
|
27
29
|
end
|
28
30
|
|
data/lib/rsmp/version.rb
CHANGED