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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f1f32aacd75ffad7d36662c3e7abd0b0a851b35b287f444dd63cdebc9db1c00
4
- data.tar.gz: 32d9db803bc5ef274c1838cb961f677863745bb2e2eca105eb17b8ee4f39cea1
3
+ metadata.gz: 95c0244d87cf4f53324931c8a898915c54a520ddf0112c4753ef41b03099122c
4
+ data.tar.gz: d09df39a9b9042fc1c9a118986138fff5436e74d743146776b69d22a300826e5
5
5
  SHA512:
6
- metadata.gz: a655dab4868d9544a0242303da7d26254f3d953ecc5d789c78f7e4553e946b98eebab7f59fa4ee69c736123dfa198417885595db490724b6238fa051b1fb2a87
7
- data.tar.gz: f24fe238a17439e6e0b91e75f816733da49f9e348dd22cc00f3c68938505ca68ba7ed32575a71e9dfc18330a10f2b92fe23ade7679bdb3f0878b37e894fd55aa
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
- # Keep some reasonable exceptions
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 3.4
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', '~> 2.6'
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.38.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.1)
17
- bundler (>= 1.17, < 3.0)
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 (~> 3.4)
20
+ rspec-expectations (>= 3.4, < 5.0)
21
21
  thor (~> 1.0)
22
22
  ast (2.4.3)
23
- async (2.32.0)
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 (3.2.3)
29
+ bigdecimal (4.0.1)
30
30
  builder (3.3.0)
31
31
  colorize (1.1.0)
32
- console (1.34.0)
32
+ console (1.34.2)
33
33
  fiber-annotation
34
34
  fiber-local (~> 1.1)
35
35
  json
36
- contracts (0.17.2)
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.14.0)
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.2)
64
- ffi (1.17.2-arm64-darwin)
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.15.2)
71
- io-event (1.14.0)
72
- io-stream (0.10.0)
73
- json (2.14.1)
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.9.0)
91
+ parser (3.3.10.0)
89
92
  ast (~> 2.4.1)
90
93
  racc
91
- prism (1.5.1)
94
+ prism (1.8.0)
92
95
  racc (1.8.1)
93
96
  rainbow (3.1.1)
94
- rake (13.3.0)
95
- regexp_parser (2.11.2)
96
- rsmp_schema (0.8.9)
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.1)
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.5)
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.5)
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.5)
112
- rubocop (1.81.0)
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.47.1, < 2.0)
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.47.1)
126
+ rubocop-ast (1.49.0)
124
127
  parser (>= 3.3.7.2)
125
- prism (~> 1.4)
126
- rubocop-rspec (3.7.0)
128
+ prism (~> 1.7)
129
+ rubocop-rake (0.7.1)
127
130
  lint_roller (~> 1.1)
128
- rubocop (~> 1.72, >= 1.72.1)
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.1.0)
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 (~> 2.6)
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
- 2.6.3
168
+ 4.0.3
data/lib/rsmp/cli.rb CHANGED
@@ -2,6 +2,7 @@ require 'thor'
2
2
  require_relative '../rsmp'
3
3
 
4
4
  module RSMP
5
+ # CLI commands for running RSMP site and supervisor.
5
6
  class CLI < Thor
6
7
  desc 'version', 'Show version'
7
8
  def version
@@ -1,13 +1,13 @@
1
1
  module RSMP
2
2
  # Match a specific alarm
3
3
  class AlarmMatcher < Matcher
4
- def match?(item)
5
- return false if @want['n'] && @want['n'] != item['n']
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 false if item['v'] !~ @want['v']
8
+ return nil if item['v'] !~ @want['v']
9
9
  elsif @want['v']
10
- return false if item['v'] != @want['v']
10
+ return nil if item['v'] != @want['v']
11
11
  end
12
12
  true
13
13
  end
@@ -1,5 +1,6 @@
1
1
  module RSMP
2
2
  class Collector
3
+ # Logging helpers for Collector instances.
3
4
  module Logging
4
5
  def log_start
5
6
  @distributor.log "#{identifier}: Waiting for #{describe_matcher}".strip, level: :collect
@@ -1,7 +1,7 @@
1
1
  module RSMP
2
2
  # Class for matching a command
3
3
  class CommandMatcher < Matcher
4
- def match_code?(item)
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?(item)
23
- code_match = match_code?(item)
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)
@@ -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? item
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?(item); end
38
+ def match(item); end
39
39
  end
40
40
  end
@@ -1,7 +1,7 @@
1
- # Receives items from a Distributor and keeps them in a queue.
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?(item)
4
- return false if @want['sCI'] && @want['sCI'] != item['sCI']
5
- return false if @want['cO'] && @want['cO'] != item['cO']
6
- return false if @want['n'] && @want['n'] != item['n']
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?(item)
23
- return nil unless match_code?(item)
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 = !!options[:suspended]
28
- @acknowledged = !!options[:acknowledged]
29
- @active = !!options[: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
@@ -1,6 +1,5 @@
1
1
  module RSMP
2
2
  # RSMP component base class.
3
-
4
3
  class ComponentBase
5
4
  include Inspect
6
5
 
@@ -1,6 +1,5 @@
1
- # Things shared between sites and site proxies
2
-
3
1
  module RSMP
2
+ # Things shared between sites and site proxies
4
3
  module Components
5
4
  attr_reader :components, :main
6
5
 
@@ -7,6 +7,8 @@ require 'fileutils'
7
7
  module RSMP
8
8
  module Convert
9
9
  module Export
10
+ # Converts SXL (YAML) structures into JSON Schema files.
11
+ # Converts SXL (YAML) structures into JSON Schema files.
10
12
  module JSONSchema
11
13
  JSON_OPTIONS = {
12
14
  array_nl: "\n",
@@ -7,6 +7,7 @@ require 'fileutils'
7
7
  module RSMP
8
8
  module Convert
9
9
  module Import
10
+ # Importer for SXL in YAML format.
10
11
  module YAML
11
12
  def self.read(path)
12
13
  convert ::YAML.load_file(path)
@@ -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
 
@@ -1,3 +1,4 @@
1
+ # Extensions to Hash providing a `deep_merge` helper.
1
2
  class Hash
2
3
  def deep_merge(other_hash)
3
4
  return self unless other_hash
@@ -8,6 +8,7 @@ module RSMP
8
8
  class MalformedMessage < Error
9
9
  end
10
10
 
11
+ # Raised when schema validation fails.
11
12
  class SchemaError < Error
12
13
  attr_accessor :schemas
13
14
  end
@@ -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|
@@ -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
 
@@ -1,4 +1,5 @@
1
1
  module RSMP
2
+ # Formats and outputs log messages according to configured settings.
2
3
  class Logger
3
4
  include Filtering
4
5
  include Colorization
@@ -3,6 +3,7 @@
3
3
  #
4
4
 
5
5
  module RSMP
6
+ # Logging integration providing `archive` and `logger` helpers.
6
7
  module Logging
7
8
  attr_reader :archive, :logger
8
9
 
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({
@@ -1,6 +1,5 @@
1
- # Base class for sites and supervisors
2
-
3
1
  module RSMP
2
+ # Base class for sites and supervisors.
4
3
  class Node
5
4
  include Logging
6
5
  include Inspect
@@ -1,4 +1,5 @@
1
1
  module RSMP
2
+ # Simple protocol wrapper for reading/writing RSMP framed messages.
2
3
  class Protocol
3
4
  def initialize(stream)
4
5
  @stream = stream
@@ -1,8 +1,5 @@
1
- # RSMP site
2
- # The site initializes the connection to the supervisor.
3
- # Connections to supervisors are handles via supervisor proxies.
4
-
5
1
  module RSMP
2
+ # RSMP site implementation that manages proxies and components.
6
3
  class Site < Node
7
4
  include Components
8
5
 
@@ -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
@@ -2,6 +2,7 @@ module RSMP
2
2
  class Restart < StandardError
3
3
  end
4
4
 
5
+ # Task helpers for starting and managing an Async task lifecycle.
5
6
  module Task
6
7
  attr_reader :task
7
8
 
@@ -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
 
@@ -1,6 +1,5 @@
1
- # Handles a supervisor connection to a remote client
2
-
3
1
  module RSMP
2
+ # Handles a supervisor-side proxy for a connected site.
4
3
  class SiteProxy < Proxy
5
4
  include Components
6
5
  include Modules::Status
@@ -1,8 +1,7 @@
1
- # Handles a site connection to a remote supervisor
2
-
3
1
  require 'digest'
4
2
 
5
3
  module RSMP
4
+ # Proxy used by sites to connect to a remote supervisor.
6
5
  class SupervisorProxy < Proxy
7
6
  include Modules::Status
8
7
  include Modules::Commands
@@ -1,5 +1,6 @@
1
1
  module RSMP
2
2
  module TLC
3
+ # Detector logic component for the TLC.
3
4
  class DetectorLogic < Component
4
5
  attr_reader :forced, :value
5
6
 
@@ -1,5 +1,6 @@
1
1
  module RSMP
2
2
  module TLC
3
+ # Signal group representation for the TLC.
3
4
  class SignalGroup < Component
4
5
  attr_reader :plan, :state
5
6
 
@@ -1,5 +1,6 @@
1
1
  module RSMP
2
2
  module TLC
3
+ # Representation of a priority request for a TLC signal.
3
4
  class SignalPriority
4
5
  attr_reader :state, :node, :id, :level, :eta, :vehicle_type, :age, :updated
5
6
 
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = '0.38.0'.freeze
2
+ VERSION = '0.39.0'.freeze
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.38.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: 3.6.9
251
+ rubygems_version: 4.0.3
252
252
  specification_version: 4
253
253
  summary: RoadSide Message Protocol (RSMP) library.
254
254
  test_files: []