rsmp 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fa8cde971466041262bd390c93f4f976cb0942ca6d78aadd2707e87e90fddb2
4
- data.tar.gz: f7970833a69ea2ed5741a5b7f6d3619bfca25df8343f0b6a02a304dc7a74fce7
3
+ metadata.gz: b4eb81e9be58fe5645d41ffe88fad923aac8ba5db14382ce0532d17721b18b0c
4
+ data.tar.gz: 806810e243027d1349631b1b0153c452557e9b7ad01470ff51376c6a181a3810
5
5
  SHA512:
6
- metadata.gz: d3a857d4b29b9b1e2f9bbf0181ed86586ade1b15eedbbbd79fbc4ca0a3f65b5e67c8f96224b55a87a3c05622a75353fc7fb29d61e1ecfb8af464c99873cc0bae
7
- data.tar.gz: 499d7c02e691e0a3aa0fdf2f1f000f30bbda8bc9240836f00c6e8ca0114298666a92ffd20953d57887f359bec45ca983cf12624fc0b49eee952eb24eea8b80ca
6
+ metadata.gz: cfa09b0e9692c42999c97866166631e5e805c16741af046b21670a5cdaad862afa9fd532d266877da1c623b0ebb42f4d23854bac9dcb1884e095dabf6027b97a
7
+ data.tar.gz: 493156ab24d418536dd57a5d0a68d008320b9c896e99b33e9ed6023c061f597467569865645895b106f3e13423c686f5c3c89c2177cafbd28a1707c387a5a00c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.9.2)
4
+ rsmp (0.9.3)
5
5
  async (~> 1.29.1)
6
6
  async-io (~> 1.32.2)
7
7
  colorize (~> 0.8.1)
@@ -0,0 +1,20 @@
1
+ module RSMP
2
+ # Class for waiting for specific command responses
3
+ class AlarmCollector < Collector
4
+ def initialize proxy, want, options={}
5
+ @want = want
6
+ super proxy, options.merge(
7
+ type: 'Alarm',
8
+ title:'alarm'
9
+ )
10
+ end
11
+
12
+ def type_match? message
13
+ return false if super(message) == false
14
+ [:aCId, :aSp, :ack, :aS, :sS, :cat, :pri].each do |key|
15
+ return false if @want[key] && @want[key] != message.attribute(key.to_s)
16
+ end
17
+ true
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,15 @@
1
+ module RSMP
2
+ # Match a specific alarm
3
+ class AlarmQuery < Query
4
+ # Match an alarm value against a query
5
+ def match? item
6
+ return false if @want['n'] && @want['n'] != item['n']
7
+ if @want['v'].is_a? Regexp
8
+ return false if item['v'] !~ @want['v']
9
+ elsif @want['v']
10
+ return false if item['v'] != @want['v']
11
+ end
12
+ true
13
+ end
14
+ end
15
+ end
@@ -346,14 +346,5 @@ module RSMP
346
346
  @supervisor.notify_error e, options if @supervisor
347
347
  distribute_error e, options
348
348
  end
349
-
350
- def collect_alarms options={}
351
- collect(@task,options.merge(type: "Alarm")) do |alarm|
352
- next if options[:aCId] && options[:aCId] != alarm.attribute("aCId")
353
- next if options[:aSp] && options[:aSp] != alarm.attribute("aSp")
354
- next if options[:aS] && options[:aS] != alarm.attribute("aS")
355
- :keep
356
- end
357
- end
358
349
  end
359
350
  end
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
data/lib/rsmp.rb CHANGED
@@ -25,9 +25,11 @@ require 'rsmp/collect/filter'
25
25
  require 'rsmp/collect/query'
26
26
  require 'rsmp/collect/status_query'
27
27
  require 'rsmp/collect/command_query'
28
+ require 'rsmp/collect/alarm_query'
28
29
  require 'rsmp/collect/status_collector'
29
30
  require 'rsmp/collect/command_response_collector'
30
31
  require 'rsmp/collect/aggregated_status_collector'
32
+ require 'rsmp/collect/alarm_collector'
31
33
  require 'rsmp/component'
32
34
  require 'rsmp/site'
33
35
  require 'rsmp/proxy'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -211,6 +211,8 @@ files:
211
211
  - lib/rsmp/archive.rb
212
212
  - lib/rsmp/cli.rb
213
213
  - lib/rsmp/collect/aggregated_status_collector.rb
214
+ - lib/rsmp/collect/alarm_collector.rb
215
+ - lib/rsmp/collect/alarm_query.rb
214
216
  - lib/rsmp/collect/collector.rb
215
217
  - lib/rsmp/collect/command_query.rb
216
218
  - lib/rsmp/collect/command_response_collector.rb