rsmp 0.4.3 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 499cc4c58205e41108099bd05cd2c3bc792f962abf4bdbe3082345a2e3953094
4
- data.tar.gz: 7cca20987f24697c9def7d638ebd89b99ecbc006f6d7bb8f8445d5b50d5cad23
3
+ metadata.gz: b82a88e9cd80aeb3bf0bc89b774727155dc8c6418520493c34a852809eb29e94
4
+ data.tar.gz: 16cb2331281e470233ff28fcf6ac1e89124a88628d920f8f3d7e486b0a076b2f
5
5
  SHA512:
6
- metadata.gz: f585bdc07e8ca52f1d809779894dab0a6e61c85f6fcfdd61bac593808e5e04ec0a006af662f47f16d2bd9f720096809d9412caff46ff3532a4fc687f99ede730
7
- data.tar.gz: 88c2c437f41c22e5e9d3a8a281ec01a02379b70b9e46cdecb9f36d97753eb77d075c79a859d71fa6cd8ae1ce0ed310936891124dec9984b699979378510e6006
6
+ metadata.gz: 47d08d2fab1e0dd76dc5e988b3ee4e56a3110258402ffc9d1d8213ca7cbd889e94d08119100b785dfc5803dfd5f0618ac25c2597e1499cebd7fbd2db500614d5
7
+ data.tar.gz: 321f695677507a66fa03a81fc2bdc87350df51278e53e95bb6f75e5eeea180ea3e1503f0ee072aea425970d32e7a814a8a683cd33abdf7d832cd8c83e216ff97
@@ -87,16 +87,16 @@ module RSMP
87
87
  end
88
88
 
89
89
  # Check if a messages matches our criteria.
90
- # We iterate through each of the status items or return values in the message
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 status items in message
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
@@ -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
- # Always store the item and corresponding message.
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
- @done = matched if matched != nil
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
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin