rsmp 0.38.0 → 0.39.0
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 +4 -4
- data/.rubocop.yml +5 -16
- data/.tool-versions +1 -1
- data/Gemfile +2 -1
- data/Gemfile.lock +40 -38
- data/lib/rsmp/cli.rb +1 -0
- data/lib/rsmp/collect/alarm_matcher.rb +4 -4
- data/lib/rsmp/collect/collector/logging.rb +1 -0
- data/lib/rsmp/collect/command_matcher.rb +3 -3
- data/lib/rsmp/collect/matcher.rb +3 -3
- data/lib/rsmp/collect/queue.rb +3 -3
- data/lib/rsmp/collect/receiver.rb +2 -4
- data/lib/rsmp/collect/status_matcher.rb +7 -6
- data/lib/rsmp/component/alarm_state.rb +3 -4
- data/lib/rsmp/component/component_base.rb +0 -1
- data/lib/rsmp/component/components.rb +1 -2
- data/lib/rsmp/convert/export/json_schema.rb +2 -0
- data/lib/rsmp/convert/import/yaml.rb +1 -0
- data/lib/rsmp/helpers/clock.rb +3 -5
- data/lib/rsmp/helpers/deep_merge.rb +1 -0
- data/lib/rsmp/helpers/error.rb +1 -0
- data/lib/rsmp/helpers/inspect.rb +11 -12
- data/lib/rsmp/log/archive.rb +2 -3
- data/lib/rsmp/log/logger.rb +1 -0
- data/lib/rsmp/log/logging.rb +1 -0
- data/lib/rsmp/message.rb +26 -0
- data/lib/rsmp/node/node.rb +1 -2
- data/lib/rsmp/node/protocol.rb +1 -0
- data/lib/rsmp/node/site/site.rb +1 -4
- data/lib/rsmp/node/supervisor/supervisor.rb +1 -4
- data/lib/rsmp/node/task.rb +1 -0
- data/lib/rsmp/proxy/proxy.rb +2 -4
- data/lib/rsmp/proxy/site/site_proxy.rb +1 -2
- data/lib/rsmp/proxy/supervisor/supervisor_proxy.rb +1 -2
- data/lib/rsmp/tlc/detector_logic.rb +1 -0
- data/lib/rsmp/tlc/signal_group.rb +1 -0
- data/lib/rsmp/tlc/signal_priority.rb +1 -0
- data/lib/rsmp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 95c0244d87cf4f53324931c8a898915c54a520ddf0112c4753ef41b03099122c
|
|
4
|
+
data.tar.gz: d09df39a9b9042fc1c9a118986138fff5436e74d743146776b69d22a300826e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96bfd44c55d893634aebbed5eb0a8d830190b0fc7abdeb644f2fe9da1fecae60b1e1a723806d93cdfb124e33e3a89e7e0ca28e2ba14111b43346741e9dfd4086
|
|
7
|
+
data.tar.gz: 32dc5721a03a4d2a5161954e5c0a2b9273c3b245dcb1769902b13001582cc34ba13bc8e301954bad68b3d336e7be8bbf565aede3edcfc8e7e3f504504dcf44be
|
data/.rubocop.yml
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
plugins:
|
|
2
|
+
- rubocop-rspec
|
|
3
|
+
- rubocop-rake
|
|
4
|
+
|
|
1
5
|
AllCops:
|
|
2
6
|
NewCops: enable
|
|
3
7
|
TargetRubyVersion: 3.4
|
|
@@ -43,17 +47,10 @@ Metrics/BlockLength:
|
|
|
43
47
|
- 'features/**/*'
|
|
44
48
|
- '*.gemspec'
|
|
45
49
|
|
|
46
|
-
#
|
|
47
|
-
Style/Documentation:
|
|
48
|
-
Enabled: false
|
|
49
|
-
|
|
50
|
+
# From Ruby 3.4, frozen string literals are the default anyways
|
|
50
51
|
Style/FrozenStringLiteralComment:
|
|
51
52
|
Enabled: false
|
|
52
53
|
|
|
53
|
-
# Allow double negation for boolean coercion - common Ruby pattern
|
|
54
|
-
Style/DoubleNegation:
|
|
55
|
-
Enabled: false
|
|
56
|
-
|
|
57
54
|
# Allow mix-in usage at top level in test files
|
|
58
55
|
Style/MixinUsage:
|
|
59
56
|
Exclude:
|
|
@@ -65,14 +62,6 @@ Lint/ConstantDefinitionInBlock:
|
|
|
65
62
|
Exclude:
|
|
66
63
|
- 'spec/**/*'
|
|
67
64
|
|
|
68
|
-
# Keep critical domain-specific logic intact
|
|
69
|
-
Style/ReturnNilInPredicateMethodDefinition:
|
|
70
|
-
Enabled: false
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
plugins:
|
|
74
|
-
- rubocop-rspec
|
|
75
|
-
|
|
76
65
|
RSpec/MultipleExpectations:
|
|
77
66
|
Max: 20
|
|
78
67
|
|
data/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ruby
|
|
1
|
+
ruby 4
|
data/Gemfile
CHANGED
|
@@ -6,12 +6,13 @@ gemspec
|
|
|
6
6
|
|
|
7
7
|
group :development do
|
|
8
8
|
gem 'aruba', '~> 2.3'
|
|
9
|
-
gem 'bundler', '~>
|
|
9
|
+
gem 'bundler', '~> 4.0'
|
|
10
10
|
gem 'cucumber', '~> 9.2'
|
|
11
11
|
gem 'rake', '~> 13.2'
|
|
12
12
|
gem 'rspec', '~> 3.13'
|
|
13
13
|
gem 'rspec-expectations', '~> 3.13'
|
|
14
14
|
gem 'rubocop', '~> 1.65'
|
|
15
|
+
gem 'rubocop-rake', require: false
|
|
15
16
|
gem 'rubocop-rspec', require: false
|
|
16
17
|
gem 'timecop', '~> 0.9'
|
|
17
18
|
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rsmp (0.
|
|
4
|
+
rsmp (0.39.0)
|
|
5
5
|
async (~> 2.32)
|
|
6
6
|
colorize (~> 1.1)
|
|
7
7
|
io-endpoint (~> 0.15)
|
|
@@ -13,27 +13,27 @@ PATH
|
|
|
13
13
|
GEM
|
|
14
14
|
remote: https://rubygems.org/
|
|
15
15
|
specs:
|
|
16
|
-
aruba (2.3.
|
|
17
|
-
bundler (>= 1.17
|
|
16
|
+
aruba (2.3.3)
|
|
17
|
+
bundler (>= 1.17)
|
|
18
18
|
contracts (>= 0.16.0, < 0.18.0)
|
|
19
19
|
cucumber (>= 8.0, < 11.0)
|
|
20
|
-
rspec-expectations (
|
|
20
|
+
rspec-expectations (>= 3.4, < 5.0)
|
|
21
21
|
thor (~> 1.0)
|
|
22
22
|
ast (2.4.3)
|
|
23
|
-
async (2.
|
|
23
|
+
async (2.35.2)
|
|
24
24
|
console (~> 1.29)
|
|
25
25
|
fiber-annotation
|
|
26
26
|
io-event (~> 1.11)
|
|
27
27
|
metrics (~> 0.12)
|
|
28
28
|
traces (~> 0.18)
|
|
29
|
-
bigdecimal (
|
|
29
|
+
bigdecimal (4.0.1)
|
|
30
30
|
builder (3.3.0)
|
|
31
31
|
colorize (1.1.0)
|
|
32
|
-
console (1.34.
|
|
32
|
+
console (1.34.2)
|
|
33
33
|
fiber-annotation
|
|
34
34
|
fiber-local (~> 1.1)
|
|
35
35
|
json
|
|
36
|
-
contracts (0.17.
|
|
36
|
+
contracts (0.17.3)
|
|
37
37
|
cucumber (9.2.1)
|
|
38
38
|
builder (~> 3.2)
|
|
39
39
|
cucumber-ci-environment (> 9, < 11)
|
|
@@ -55,22 +55,25 @@ GEM
|
|
|
55
55
|
bigdecimal
|
|
56
56
|
cucumber-gherkin (27.0.0)
|
|
57
57
|
cucumber-messages (>= 19.1.4, < 23)
|
|
58
|
-
cucumber-html-formatter (21.
|
|
58
|
+
cucumber-html-formatter (21.15.1)
|
|
59
59
|
cucumber-messages (> 19, < 28)
|
|
60
60
|
cucumber-messages (22.0.0)
|
|
61
61
|
cucumber-tag-expressions (6.1.2)
|
|
62
62
|
diff-lcs (1.6.2)
|
|
63
|
-
ffi (1.17.
|
|
64
|
-
ffi (1.17.
|
|
63
|
+
ffi (1.17.3)
|
|
64
|
+
ffi (1.17.3-arm64-darwin)
|
|
65
|
+
ffi (1.17.3-x64-mingw-ucrt)
|
|
66
|
+
ffi (1.17.3-x86_64-darwin)
|
|
67
|
+
ffi (1.17.3-x86_64-linux-gnu)
|
|
65
68
|
fiber-annotation (0.2.0)
|
|
66
69
|
fiber-local (1.1.0)
|
|
67
70
|
fiber-storage
|
|
68
71
|
fiber-storage (1.0.1)
|
|
69
72
|
hana (1.3.7)
|
|
70
|
-
io-endpoint (0.
|
|
71
|
-
io-event (1.14.
|
|
72
|
-
io-stream (0.
|
|
73
|
-
json (2.
|
|
73
|
+
io-endpoint (0.16.0)
|
|
74
|
+
io-event (1.14.2)
|
|
75
|
+
io-stream (0.11.1)
|
|
76
|
+
json (2.18.0)
|
|
74
77
|
json_schemer (2.4.0)
|
|
75
78
|
bigdecimal
|
|
76
79
|
hana (~> 1.3)
|
|
@@ -85,31 +88,31 @@ GEM
|
|
|
85
88
|
multi_test (1.1.0)
|
|
86
89
|
ostruct (0.6.3)
|
|
87
90
|
parallel (1.27.0)
|
|
88
|
-
parser (3.3.
|
|
91
|
+
parser (3.3.10.0)
|
|
89
92
|
ast (~> 2.4.1)
|
|
90
93
|
racc
|
|
91
|
-
prism (1.
|
|
94
|
+
prism (1.8.0)
|
|
92
95
|
racc (1.8.1)
|
|
93
96
|
rainbow (3.1.1)
|
|
94
|
-
rake (13.3.
|
|
95
|
-
regexp_parser (2.11.
|
|
96
|
-
rsmp_schema (0.
|
|
97
|
+
rake (13.3.1)
|
|
98
|
+
regexp_parser (2.11.3)
|
|
99
|
+
rsmp_schema (0.9.1)
|
|
97
100
|
json_schemer (~> 2.4.0)
|
|
98
101
|
thor (~> 1.4.0)
|
|
99
|
-
rspec (3.13.
|
|
102
|
+
rspec (3.13.2)
|
|
100
103
|
rspec-core (~> 3.13.0)
|
|
101
104
|
rspec-expectations (~> 3.13.0)
|
|
102
105
|
rspec-mocks (~> 3.13.0)
|
|
103
|
-
rspec-core (3.13.
|
|
106
|
+
rspec-core (3.13.6)
|
|
104
107
|
rspec-support (~> 3.13.0)
|
|
105
108
|
rspec-expectations (3.13.5)
|
|
106
109
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
107
110
|
rspec-support (~> 3.13.0)
|
|
108
|
-
rspec-mocks (3.13.
|
|
111
|
+
rspec-mocks (3.13.7)
|
|
109
112
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
110
113
|
rspec-support (~> 3.13.0)
|
|
111
|
-
rspec-support (3.13.
|
|
112
|
-
rubocop (1.
|
|
114
|
+
rspec-support (3.13.6)
|
|
115
|
+
rubocop (1.82.1)
|
|
113
116
|
json (~> 2.3)
|
|
114
117
|
language_server-protocol (~> 3.17.0.2)
|
|
115
118
|
lint_roller (~> 1.1.0)
|
|
@@ -117,15 +120,18 @@ GEM
|
|
|
117
120
|
parser (>= 3.3.0.2)
|
|
118
121
|
rainbow (>= 2.2.2, < 4.0)
|
|
119
122
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
120
|
-
rubocop-ast (>= 1.
|
|
123
|
+
rubocop-ast (>= 1.48.0, < 2.0)
|
|
121
124
|
ruby-progressbar (~> 1.7)
|
|
122
125
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
123
|
-
rubocop-ast (1.
|
|
126
|
+
rubocop-ast (1.49.0)
|
|
124
127
|
parser (>= 3.3.7.2)
|
|
125
|
-
prism (~> 1.
|
|
126
|
-
rubocop-
|
|
128
|
+
prism (~> 1.7)
|
|
129
|
+
rubocop-rake (0.7.1)
|
|
127
130
|
lint_roller (~> 1.1)
|
|
128
|
-
rubocop (
|
|
131
|
+
rubocop (>= 1.72.1)
|
|
132
|
+
rubocop-rspec (3.9.0)
|
|
133
|
+
lint_roller (~> 1.1)
|
|
134
|
+
rubocop (~> 1.81)
|
|
129
135
|
ruby-progressbar (1.13.0)
|
|
130
136
|
simpleidn (0.2.3)
|
|
131
137
|
sys-uname (1.4.1)
|
|
@@ -136,31 +142,27 @@ GEM
|
|
|
136
142
|
traces (0.18.2)
|
|
137
143
|
unicode-display_width (3.2.0)
|
|
138
144
|
unicode-emoji (~> 4.1)
|
|
139
|
-
unicode-emoji (4.
|
|
145
|
+
unicode-emoji (4.2.0)
|
|
140
146
|
|
|
141
147
|
PLATFORMS
|
|
142
|
-
arm64-darwin-22
|
|
143
148
|
arm64-darwin-23
|
|
144
149
|
arm64-darwin-24
|
|
145
150
|
x64-mingw-ucrt
|
|
146
|
-
x64-mingw32
|
|
147
|
-
x86_64-darwin-19
|
|
148
|
-
x86_64-darwin-20
|
|
149
|
-
x86_64-darwin-21
|
|
150
151
|
x86_64-darwin-22
|
|
151
152
|
x86_64-linux
|
|
152
153
|
|
|
153
154
|
DEPENDENCIES
|
|
154
155
|
aruba (~> 2.3)
|
|
155
|
-
bundler (~>
|
|
156
|
+
bundler (~> 4.0)
|
|
156
157
|
cucumber (~> 9.2)
|
|
157
158
|
rake (~> 13.2)
|
|
158
159
|
rsmp!
|
|
159
160
|
rspec (~> 3.13)
|
|
160
161
|
rspec-expectations (~> 3.13)
|
|
161
162
|
rubocop (~> 1.65)
|
|
163
|
+
rubocop-rake
|
|
162
164
|
rubocop-rspec
|
|
163
165
|
timecop (~> 0.9)
|
|
164
166
|
|
|
165
167
|
BUNDLED WITH
|
|
166
|
-
|
|
168
|
+
4.0.3
|
data/lib/rsmp/cli.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module RSMP
|
|
2
2
|
# Match a specific alarm
|
|
3
3
|
class AlarmMatcher < Matcher
|
|
4
|
-
def match
|
|
5
|
-
return
|
|
4
|
+
def match(item)
|
|
5
|
+
return nil if @want['n'] && @want['n'] != item['n']
|
|
6
6
|
|
|
7
7
|
if @want['v'].is_a? Regexp
|
|
8
|
-
return
|
|
8
|
+
return nil if item['v'] !~ @want['v']
|
|
9
9
|
elsif @want['v']
|
|
10
|
-
return
|
|
10
|
+
return nil if item['v'] != @want['v']
|
|
11
11
|
end
|
|
12
12
|
true
|
|
13
13
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module RSMP
|
|
2
2
|
# Class for matching a command
|
|
3
3
|
class CommandMatcher < Matcher
|
|
4
|
-
def match_code
|
|
4
|
+
def match_code(item)
|
|
5
5
|
return nil if @want['cCI'] && @want['cCI'] != item['cCI']
|
|
6
6
|
return nil if @want['n'] && @want['n'] != item['n']
|
|
7
7
|
|
|
@@ -19,8 +19,8 @@ module RSMP
|
|
|
19
19
|
true
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def match
|
|
23
|
-
code_match = match_code
|
|
22
|
+
def match(item)
|
|
23
|
+
code_match = match_code(item)
|
|
24
24
|
return code_match if code_match.nil?
|
|
25
25
|
|
|
26
26
|
match_value?(item)
|
data/lib/rsmp/collect/matcher.rb
CHANGED
|
@@ -9,7 +9,7 @@ module RSMP
|
|
|
9
9
|
@message = nil
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
# Are we done, i.e. did the last checked item match
|
|
12
|
+
# Are we done, i.e. did the last checked item match
|
|
13
13
|
def done?
|
|
14
14
|
@got != nil
|
|
15
15
|
end
|
|
@@ -17,7 +17,7 @@ module RSMP
|
|
|
17
17
|
# Check an item and set @done to true if it matches
|
|
18
18
|
# Store the item and corresponding message if there's a positive or negative match
|
|
19
19
|
def perform_match(item, _message, block)
|
|
20
|
-
matched = match
|
|
20
|
+
matched = match item
|
|
21
21
|
if !matched.nil? && block
|
|
22
22
|
status = block.call(nil, item)
|
|
23
23
|
matched = status if [true, false].include?(status)
|
|
@@ -35,6 +35,6 @@ module RSMP
|
|
|
35
35
|
@got = nil
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
def match
|
|
38
|
+
def match(item); end
|
|
39
39
|
end
|
|
40
40
|
end
|
data/lib/rsmp/collect/queue.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
# The client can wait for mesages and will get them one by one.
|
|
3
|
-
|
|
1
|
+
# Top-level RSMP namespace.
|
|
4
2
|
module RSMP
|
|
3
|
+
# Receives items from a Distributor and keeps them in a queue.
|
|
4
|
+
# The client can wait for messages and will get them one by one.
|
|
5
5
|
class Queue
|
|
6
6
|
include Receiver
|
|
7
7
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
# Receives items from a Distributor, as long as it's
|
|
2
|
-
# installed as a receiver.
|
|
3
|
-
# Optionally filter mesage using a Filter.
|
|
4
|
-
|
|
5
1
|
module RSMP
|
|
2
|
+
# Receives items from a Distributor when included as a receiver.
|
|
3
|
+
# Optionally filter messages using a Filter.
|
|
6
4
|
module Receiver
|
|
7
5
|
include Inspect
|
|
8
6
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
module RSMP
|
|
2
|
+
# Match a specific status
|
|
2
3
|
class StatusMatcher < Matcher
|
|
3
|
-
def match_code
|
|
4
|
-
return
|
|
5
|
-
return
|
|
6
|
-
return
|
|
4
|
+
def match_code(item)
|
|
5
|
+
return nil if @want['sCI'] && @want['sCI'] != item['sCI']
|
|
6
|
+
return nil if @want['cO'] && @want['cO'] != item['cO']
|
|
7
|
+
return nil if @want['n'] && @want['n'] != item['n']
|
|
7
8
|
|
|
8
9
|
true
|
|
9
10
|
end
|
|
@@ -19,8 +20,8 @@ module RSMP
|
|
|
19
20
|
true
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def match
|
|
23
|
-
return nil unless match_code
|
|
23
|
+
def match(item)
|
|
24
|
+
return nil unless match_code(item)
|
|
24
25
|
|
|
25
26
|
match_value?(item)
|
|
26
27
|
end
|
|
@@ -3,7 +3,6 @@ module RSMP
|
|
|
3
3
|
# The alarm state is for a particular alarm code,
|
|
4
4
|
# a component typically have an alarm state for each
|
|
5
5
|
# alarm code that is defined for the component type.
|
|
6
|
-
|
|
7
6
|
class AlarmState
|
|
8
7
|
attr_reader :component_id, :code, :acknowledged, :suspended, :active, :timestamp, :category, :priority, :rvs
|
|
9
8
|
|
|
@@ -24,9 +23,9 @@ module RSMP
|
|
|
24
23
|
@component = component
|
|
25
24
|
@component_id = component.c_id
|
|
26
25
|
@code = code
|
|
27
|
-
@suspended =
|
|
28
|
-
@acknowledged =
|
|
29
|
-
@active =
|
|
26
|
+
@suspended = options[:suspended] == true
|
|
27
|
+
@acknowledged = options[:acknowledged] == true
|
|
28
|
+
@active = options[:active] == true
|
|
30
29
|
@timestamp = options[:timestamp]
|
|
31
30
|
@category = options[:category] || 'D'
|
|
32
31
|
@priority = options[:priority] || 2
|
data/lib/rsmp/helpers/clock.rb
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
# Get the current time in UTC, with optional adjustment
|
|
2
|
-
# Convertion to string uses the RSMP format 2015-06-08T12:01:39.654Z
|
|
3
|
-
# Note that using to_s on a my_clock.to_s will not produce an RSMP formatted timestamp,
|
|
4
|
-
# you need to use Clock.to_s my_clock
|
|
5
|
-
|
|
6
1
|
require 'time'
|
|
7
2
|
|
|
8
3
|
module RSMP
|
|
4
|
+
# Get the current time in UTC, with optional adjustment.
|
|
5
|
+
# Conversion to string uses the RSMP format 2015-06-08T12:01:39.654Z
|
|
6
|
+
# Use `Clock.to_s` to format times in RSMP format.
|
|
9
7
|
class Clock
|
|
10
8
|
attr_reader :adjustment
|
|
11
9
|
|
data/lib/rsmp/helpers/error.rb
CHANGED
data/lib/rsmp/helpers/inspect.rb
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
# Costume inspect, to reduce noise
|
|
2
|
-
#
|
|
3
|
-
# Instance variables of classes starting with Async or RSMP are shown
|
|
4
|
-
# with only their class name and object id, which reduces output,
|
|
5
|
-
# especially for deep object structures.
|
|
6
|
-
# Additionally, a list of variables to shown in short format can be passed.
|
|
7
|
-
#
|
|
8
|
-
# The short form is generated by using to_s() insted of inspect()
|
|
9
|
-
#
|
|
10
|
-
# Array#to_s and Hash#to_s usually show items, but here we show just number
|
|
11
|
-
# of items, when the short form is requested.
|
|
12
|
-
|
|
13
1
|
module RSMP
|
|
2
|
+
# Custom inspect, to reduce noise
|
|
3
|
+
#
|
|
4
|
+
# Instance variables of classes starting with Async or RSMP are shown
|
|
5
|
+
# with only their class name and object id, which reduces output,
|
|
6
|
+
# especially for deep object structures.
|
|
7
|
+
# Additionally, a list of variables to shown in short format can be passed.
|
|
8
|
+
#
|
|
9
|
+
# The short form is generated by using to_s() insted of inspect()
|
|
10
|
+
#
|
|
11
|
+
# Array#to_s and Hash#to_s usually show items, but here we show just number
|
|
12
|
+
# of items, when the short form is requested.
|
|
14
13
|
module Inspect
|
|
15
14
|
def inspector *short_items
|
|
16
15
|
instance_variables.map do |var_name|
|
data/lib/rsmp/log/archive.rb
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
# Archive of log items, which can be messages or info items.
|
|
2
|
-
# All items are timestamped, and stored chronologically.
|
|
3
|
-
|
|
4
1
|
module RSMP
|
|
2
|
+
# Archive of log items, which can be messages or info items.
|
|
3
|
+
# All items are timestamped, and stored chronologically.
|
|
5
4
|
class Archive
|
|
6
5
|
include Inspect
|
|
7
6
|
|
data/lib/rsmp/log/logger.rb
CHANGED
data/lib/rsmp/log/logging.rb
CHANGED
data/lib/rsmp/message.rb
CHANGED
|
@@ -2,6 +2,7 @@ require 'rsmp_schema'
|
|
|
2
2
|
|
|
3
3
|
# rsmp messages
|
|
4
4
|
module RSMP
|
|
5
|
+
# Base RSMP message class used to represent parsed and built messages.
|
|
5
6
|
class Message
|
|
6
7
|
include Inspect
|
|
7
8
|
|
|
@@ -191,6 +192,7 @@ module RSMP
|
|
|
191
192
|
end
|
|
192
193
|
end
|
|
193
194
|
|
|
195
|
+
# Represents a malformed message with invalid attributes.
|
|
194
196
|
class Malformed < Message
|
|
195
197
|
# rubocop:disable Lint/MissingSuper
|
|
196
198
|
def initialize(attributes = {})
|
|
@@ -201,6 +203,7 @@ module RSMP
|
|
|
201
203
|
# rubocop:enable Lint/MissingSuper
|
|
202
204
|
end
|
|
203
205
|
|
|
206
|
+
# Version message, lists supported versions and SXL information.
|
|
204
207
|
class Version < Message
|
|
205
208
|
def initialize(attributes = {})
|
|
206
209
|
super({
|
|
@@ -213,9 +216,11 @@ module RSMP
|
|
|
213
216
|
end
|
|
214
217
|
end
|
|
215
218
|
|
|
219
|
+
# Unknown message type wrapper.
|
|
216
220
|
class Unknown < Message
|
|
217
221
|
end
|
|
218
222
|
|
|
223
|
+
# AggregatedStatus message type.
|
|
219
224
|
class AggregatedStatus < Message
|
|
220
225
|
def initialize(attributes = {})
|
|
221
226
|
super({
|
|
@@ -224,6 +229,7 @@ module RSMP
|
|
|
224
229
|
end
|
|
225
230
|
end
|
|
226
231
|
|
|
232
|
+
# AggregatedStatusRequest message type.
|
|
227
233
|
class AggregatedStatusRequest < Message
|
|
228
234
|
def initialize(attributes = {})
|
|
229
235
|
super({
|
|
@@ -232,6 +238,7 @@ module RSMP
|
|
|
232
238
|
end
|
|
233
239
|
end
|
|
234
240
|
|
|
241
|
+
# Alarm base message type.
|
|
235
242
|
class Alarm < Message
|
|
236
243
|
def initialize(attributes = {})
|
|
237
244
|
super({
|
|
@@ -253,6 +260,7 @@ module RSMP
|
|
|
253
260
|
end
|
|
254
261
|
end
|
|
255
262
|
|
|
263
|
+
# Alarm issue specialization.
|
|
256
264
|
class AlarmIssue < Alarm
|
|
257
265
|
def initialize(attributes = {})
|
|
258
266
|
super({
|
|
@@ -261,6 +269,7 @@ module RSMP
|
|
|
261
269
|
end
|
|
262
270
|
end
|
|
263
271
|
|
|
272
|
+
# Alarm request specialization.
|
|
264
273
|
class AlarmRequest < Alarm
|
|
265
274
|
def initialize(attributes = {})
|
|
266
275
|
super({
|
|
@@ -269,6 +278,7 @@ module RSMP
|
|
|
269
278
|
end
|
|
270
279
|
end
|
|
271
280
|
|
|
281
|
+
# Alarm acknowledge message.
|
|
272
282
|
class AlarmAcknowledge < Alarm
|
|
273
283
|
def initialize(attributes = {})
|
|
274
284
|
super({
|
|
@@ -277,6 +287,7 @@ module RSMP
|
|
|
277
287
|
end
|
|
278
288
|
end
|
|
279
289
|
|
|
290
|
+
# Alarm acknowledged (acknowledged state) message.
|
|
280
291
|
class AlarmAcknowledged < Alarm
|
|
281
292
|
def initialize(attributes = {})
|
|
282
293
|
super({
|
|
@@ -286,6 +297,7 @@ module RSMP
|
|
|
286
297
|
end
|
|
287
298
|
end
|
|
288
299
|
|
|
300
|
+
# Alarm suspend message.
|
|
289
301
|
class AlarmSuspend < Alarm
|
|
290
302
|
def initialize(attributes = {})
|
|
291
303
|
super({
|
|
@@ -294,6 +306,7 @@ module RSMP
|
|
|
294
306
|
end
|
|
295
307
|
end
|
|
296
308
|
|
|
309
|
+
# Alarm suspended (suspended state) message.
|
|
297
310
|
class AlarmSuspended < Alarm
|
|
298
311
|
def initialize(attributes = {})
|
|
299
312
|
super({
|
|
@@ -303,6 +316,7 @@ module RSMP
|
|
|
303
316
|
end
|
|
304
317
|
end
|
|
305
318
|
|
|
319
|
+
# Alarm resume message.
|
|
306
320
|
class AlarmResume < Alarm
|
|
307
321
|
def initialize(attributes = {})
|
|
308
322
|
super({
|
|
@@ -311,6 +325,7 @@ module RSMP
|
|
|
311
325
|
end
|
|
312
326
|
end
|
|
313
327
|
|
|
328
|
+
# Alarm resumed (not suspended) message.
|
|
314
329
|
class AlarmResumed < Alarm
|
|
315
330
|
def initialize(attributes = {})
|
|
316
331
|
super({
|
|
@@ -320,6 +335,7 @@ module RSMP
|
|
|
320
335
|
end
|
|
321
336
|
end
|
|
322
337
|
|
|
338
|
+
# Watchdog message type.
|
|
323
339
|
class Watchdog < Message
|
|
324
340
|
def initialize(attributes = {})
|
|
325
341
|
super({
|
|
@@ -328,6 +344,7 @@ module RSMP
|
|
|
328
344
|
end
|
|
329
345
|
end
|
|
330
346
|
|
|
347
|
+
# Base class for acking messages (MessageAck / MessageNotAck).
|
|
331
348
|
class MessageAcking < Message
|
|
332
349
|
attr_reader :original
|
|
333
350
|
|
|
@@ -348,6 +365,7 @@ module RSMP
|
|
|
348
365
|
end
|
|
349
366
|
end
|
|
350
367
|
|
|
368
|
+
# Acknowledgement for a received message.
|
|
351
369
|
class MessageAck < MessageAcking
|
|
352
370
|
def initialize(attributes = {})
|
|
353
371
|
super({
|
|
@@ -360,6 +378,7 @@ module RSMP
|
|
|
360
378
|
end
|
|
361
379
|
end
|
|
362
380
|
|
|
381
|
+
# Negative acknowledgement for a received message.
|
|
363
382
|
class MessageNotAck < MessageAcking
|
|
364
383
|
def initialize(attributes = {})
|
|
365
384
|
super({
|
|
@@ -370,6 +389,7 @@ module RSMP
|
|
|
370
389
|
end
|
|
371
390
|
end
|
|
372
391
|
|
|
392
|
+
# Command request message type.
|
|
373
393
|
class CommandRequest < Message
|
|
374
394
|
def initialize(attributes = {})
|
|
375
395
|
super({
|
|
@@ -378,6 +398,7 @@ module RSMP
|
|
|
378
398
|
end
|
|
379
399
|
end
|
|
380
400
|
|
|
401
|
+
# Command response message type.
|
|
381
402
|
class CommandResponse < Message
|
|
382
403
|
def initialize(attributes = {})
|
|
383
404
|
super({
|
|
@@ -386,6 +407,7 @@ module RSMP
|
|
|
386
407
|
end
|
|
387
408
|
end
|
|
388
409
|
|
|
410
|
+
# Status request message type.
|
|
389
411
|
class StatusRequest < Message
|
|
390
412
|
def initialize(attributes = {})
|
|
391
413
|
super({
|
|
@@ -394,6 +416,7 @@ module RSMP
|
|
|
394
416
|
end
|
|
395
417
|
end
|
|
396
418
|
|
|
419
|
+
# Status response message type.
|
|
397
420
|
class StatusResponse < Message
|
|
398
421
|
def initialize(attributes = {})
|
|
399
422
|
super({
|
|
@@ -402,6 +425,7 @@ module RSMP
|
|
|
402
425
|
end
|
|
403
426
|
end
|
|
404
427
|
|
|
428
|
+
# Status subscribe message type.
|
|
405
429
|
class StatusSubscribe < Message
|
|
406
430
|
def initialize(attributes = {})
|
|
407
431
|
super({
|
|
@@ -410,6 +434,7 @@ module RSMP
|
|
|
410
434
|
end
|
|
411
435
|
end
|
|
412
436
|
|
|
437
|
+
# Status unsubscribe message type.
|
|
413
438
|
class StatusUnsubscribe < Message
|
|
414
439
|
def initialize(attributes = {})
|
|
415
440
|
super({
|
|
@@ -418,6 +443,7 @@ module RSMP
|
|
|
418
443
|
end
|
|
419
444
|
end
|
|
420
445
|
|
|
446
|
+
# Status update message type.
|
|
421
447
|
class StatusUpdate < Message
|
|
422
448
|
def initialize(attributes = {})
|
|
423
449
|
super({
|
data/lib/rsmp/node/node.rb
CHANGED
data/lib/rsmp/node/protocol.rb
CHANGED
data/lib/rsmp/node/site/site.rb
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
# RSMP supervisor (server)
|
|
2
|
-
# The supervisor waits for sites to connect.
|
|
3
|
-
# Connections to sites are handles via site proxies.
|
|
4
|
-
|
|
5
1
|
module RSMP
|
|
2
|
+
# RSMP supervisor (server) that accepts site connections.
|
|
6
3
|
class Supervisor < Node
|
|
7
4
|
include Modules::Configuration
|
|
8
5
|
include Modules::Connection
|
data/lib/rsmp/node/task.rb
CHANGED
data/lib/rsmp/proxy/proxy.rb
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
# A connection to a remote site or supervisor.
|
|
2
|
-
# Uses the Task module to handle asyncronous work, but adds
|
|
3
|
-
# the concept of a connection that can be connected or disconnected.
|
|
4
|
-
|
|
5
1
|
require 'rubygems'
|
|
6
2
|
|
|
7
3
|
module RSMP
|
|
4
|
+
# Represents a connection to a remote site or supervisor.
|
|
5
|
+
# Provides common connection lifecycle and message handling.
|
|
8
6
|
class Proxy
|
|
9
7
|
WRAPPING_DELIMITER = "\f".freeze
|
|
10
8
|
|
data/lib/rsmp/version.rb
CHANGED
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
|
+
version: 0.39.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Emil Tin
|
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
248
248
|
- !ruby/object:Gem::Version
|
|
249
249
|
version: '0'
|
|
250
250
|
requirements: []
|
|
251
|
-
rubygems_version:
|
|
251
|
+
rubygems_version: 4.0.3
|
|
252
252
|
specification_version: 4
|
|
253
253
|
summary: RoadSide Message Protocol (RSMP) library.
|
|
254
254
|
test_files: []
|