rsmp 0.3.7 → 0.3.8

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: 63163e8e010e001deffd0bba691e343c028ae5edbf3a5c9022529d319c36035e
4
- data.tar.gz: 07225c7538b514c3b74dbc307a432f32eb1fe839faaeef4483208206b29e103a
3
+ metadata.gz: 5e0675af3b49828fa77194f4dbec427378e6cf79e8a4923ed452cf28a39052a2
4
+ data.tar.gz: d0a681be3741ac8a87c4d1b17d1db75218cae8d8df34a0f6365052ff59578235
5
5
  SHA512:
6
- metadata.gz: 6eed25d057be1a6766b94d1127b41f498b4e3532bf5650d7c888321dfe48bafaf2af69ff2d871cc437fc44ae9286d898da2387bc2e267d451aca332d3695159f
7
- data.tar.gz: 011f89ceb76bbfdc521ca0730c2d7f1c48663e4faf35576e4e72bee83831813745bc0ce0c45aab4201c1874f1ee21a5c1f6235dbab0c16feab1e3970acc56d3b
6
+ metadata.gz: 4012fd3e7f6c4c39c6f473ac09b115fbf67bf1651803c421e10f37e9e17b78b3d096dc7a4c36e125117f30daf5baf2e0e755bd83a06926a143ae7cb4bed91def
7
+ data.tar.gz: be15a086298d27b3cd8530685a8b654519540ac3d64f1aecd62399d513bc4c323f200e9d606c0afa28e1efc57a8d6e51c9f7dd77c4893ceb493c2613792c6567
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.3.7)
4
+ rsmp (0.3.8)
5
5
  async (~> 1.29.1)
6
6
  async-io (~> 1.32.1)
7
7
  colorize (~> 0.8.1)
@@ -335,20 +335,12 @@ module RSMP
335
335
  @supervisor.notify_error e, options if @supervisor
336
336
  end
337
337
 
338
- def wait_for_alarm parent_task, options={}
339
- matching_alarm = nil
340
- message = collect(parent_task,options.merge(type: "Alarm", with_message: true, num: 1)) do |message|
341
- # TODO check components
342
- matching_alarm = nil
343
- alarm = message
338
+ def collect_alarms parent_task, options={}
339
+ collect(parent_task,options.merge(type: "Alarm")) do |alarm|
344
340
  next if options[:aCId] && options[:aCId] != alarm.attribute("aCId")
345
341
  next if options[:aSp] && options[:aSp] != alarm.attribute("aSp")
346
342
  next if options[:aS] && options[:aS] != alarm.attribute("aS")
347
- matching_alarm = alarm
348
- break
349
- end
350
- if item
351
- { message: message, status: matching_alarm }
343
+ true
352
344
  end
353
345
  end
354
346
 
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
data/test.rb ADDED
@@ -0,0 +1,27 @@
1
+ class A
2
+ def go &block
3
+ @block = block # block will be converted automatically to a Proc
4
+ indirect
5
+ end
6
+
7
+ def call
8
+ @block.call
9
+ end
10
+
11
+ def indirect
12
+ call
13
+ end
14
+
15
+ end
16
+
17
+ a = A.new
18
+
19
+ a.go do
20
+ break # this is ok. break causes the block to exit, and the encasing method to return - go() will exit
21
+ end
22
+
23
+ # this raises an error. the block we passed to go() will be called again, and it tries to break
24
+ # but we're not inside a method we can exit from
25
+
26
+
27
+ a.indirect
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.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2021-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -231,6 +231,7 @@ files:
231
231
  - lib/rsmp/version.rb
232
232
  - lib/rsmp/wait.rb
233
233
  - rsmp.gemspec
234
+ - test.rb
234
235
  homepage: https://github.com/rsmp-nordic/rsmp
235
236
  licenses:
236
237
  - MIT