rsmp 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rsmp/component.rb +9 -8
- data/lib/rsmp/error.rb +3 -0
- data/lib/rsmp/message.rb +1 -1
- 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: 7ffe9f097053c9814ad119cbd6a01192cd20c02d3ca1fffa6269dbdf534f419b
|
4
|
+
data.tar.gz: 9848398d419a76f16fa8eb1f527d4c6b055b17886a5ee689b7607c891103d5a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d974b915cbc32bee428cc7f39a1e26134c6db34f72590ad9bd67400ad71ce831037a82341601369aa6582c1e4b5ecf8d4e6f8c3249a4375716bc877ca1cc7cec
|
7
|
+
data.tar.gz: 301eb51aecb05c57fc3395f3a06df33846e24fdd863db2ff65e81e9fc1b7c23c4e6b40e508b15a3ec0c92e87595ce78317773cfca6e13ec72ca9609d037cb1f1
|
data/Gemfile.lock
CHANGED
data/lib/rsmp/component.rb
CHANGED
@@ -79,16 +79,17 @@ module RSMP
|
|
79
79
|
|
80
80
|
def handle_alarm message
|
81
81
|
code = message.attribute('aCId')
|
82
|
-
|
83
|
-
if
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
82
|
+
previous = @alarms[code]
|
83
|
+
if previous
|
84
|
+
unless message.differ?(previous)
|
85
|
+
raise RepeatedAlarmError.new("no changes from previous alarm #{previous.m_id_short}")
|
86
|
+
end
|
87
|
+
if Time.parse(message.attribute('aTs')) < Time.parse(previous.attribute('aTs'))
|
88
|
+
raise RepeatedAlarmError.new("timestamp is earlier than previous alarm #{previous.m_id_short}")
|
88
89
|
end
|
89
|
-
else
|
90
|
-
@alarms[code] = message
|
91
90
|
end
|
91
|
+
ensure
|
92
|
+
@alarms[code] = message
|
92
93
|
end
|
93
94
|
|
94
95
|
# Handle an incoming status respone, by storing the values
|
data/lib/rsmp/error.rb
CHANGED
data/lib/rsmp/message.rb
CHANGED
@@ -126,7 +126,7 @@ module RSMP
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def initialize attributes = {}
|
129
|
-
@timestamp = Time.now # this timestamp is for internal use, and does not the clock
|
129
|
+
@timestamp = Time.now # this timestamp is for internal use, and does not use the clock
|
130
130
|
# in the node, which can be set by an rsmp supervisor
|
131
131
|
|
132
132
|
@attributes = { "mType"=> "rSMsg" }.merge attributes
|
data/lib/rsmp/version.rb
CHANGED