rsmp 0.37.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.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/devcontainer.json +22 -0
  3. data/.github/workflows/rubocop.yaml +17 -0
  4. data/.gitignore +5 -6
  5. data/.rubocop.yml +69 -0
  6. data/.tool-versions +1 -1
  7. data/Gemfile +14 -1
  8. data/Gemfile.lock +64 -29
  9. data/Rakefile +3 -3
  10. data/lib/rsmp/cli.rb +148 -124
  11. data/lib/rsmp/collect/ack_collector.rb +8 -7
  12. data/lib/rsmp/collect/aggregated_status_collector.rb +4 -4
  13. data/lib/rsmp/collect/alarm_collector.rb +31 -23
  14. data/lib/rsmp/collect/alarm_matcher.rb +6 -6
  15. data/lib/rsmp/collect/collector/logging.rb +18 -0
  16. data/lib/rsmp/collect/collector/reporting.rb +44 -0
  17. data/lib/rsmp/collect/collector/status.rb +34 -0
  18. data/lib/rsmp/collect/collector.rb +69 -150
  19. data/lib/rsmp/collect/command_matcher.rb +19 -6
  20. data/lib/rsmp/collect/command_response_collector.rb +7 -7
  21. data/lib/rsmp/collect/distributor.rb +14 -11
  22. data/lib/rsmp/collect/filter.rb +31 -15
  23. data/lib/rsmp/collect/matcher.rb +9 -13
  24. data/lib/rsmp/collect/queue.rb +7 -7
  25. data/lib/rsmp/collect/receiver.rb +11 -15
  26. data/lib/rsmp/collect/state_collector.rb +116 -77
  27. data/lib/rsmp/collect/status_collector.rb +6 -6
  28. data/lib/rsmp/collect/status_matcher.rb +15 -4
  29. data/lib/rsmp/{alarm_state.rb → component/alarm_state.rb} +76 -38
  30. data/lib/rsmp/{component.rb → component/component.rb} +15 -15
  31. data/lib/rsmp/component/component_base.rb +88 -0
  32. data/lib/rsmp/component/component_proxy.rb +75 -0
  33. data/lib/rsmp/component/components.rb +62 -0
  34. data/lib/rsmp/convert/export/json_schema.rb +118 -110
  35. data/lib/rsmp/convert/import/yaml.rb +22 -18
  36. data/lib/rsmp/{rsmp.rb → helpers/clock.rb} +8 -11
  37. data/lib/rsmp/{deep_merge.rb → helpers/deep_merge.rb} +3 -1
  38. data/lib/rsmp/helpers/error.rb +72 -0
  39. data/lib/rsmp/helpers/inspect.rb +41 -0
  40. data/lib/rsmp/log/archive.rb +97 -0
  41. data/lib/rsmp/log/colorization.rb +41 -0
  42. data/lib/rsmp/log/filtering.rb +54 -0
  43. data/lib/rsmp/log/logger.rb +207 -0
  44. data/lib/rsmp/{logging.rb → log/logging.rb} +6 -7
  45. data/lib/rsmp/message.rb +185 -148
  46. data/lib/rsmp/{node.rb → node/node.rb} +20 -19
  47. data/lib/rsmp/{protocol.rb → node/protocol.rb} +6 -3
  48. data/lib/rsmp/node/site/site.rb +192 -0
  49. data/lib/rsmp/node/supervisor/modules/configuration.rb +59 -0
  50. data/lib/rsmp/node/supervisor/modules/connection.rb +140 -0
  51. data/lib/rsmp/node/supervisor/modules/sites.rb +64 -0
  52. data/lib/rsmp/node/supervisor/supervisor.rb +69 -0
  53. data/lib/rsmp/{task.rb → node/task.rb} +13 -14
  54. data/lib/rsmp/proxy/modules/acknowledgements.rb +144 -0
  55. data/lib/rsmp/proxy/modules/receive.rb +119 -0
  56. data/lib/rsmp/proxy/modules/send.rb +76 -0
  57. data/lib/rsmp/proxy/modules/state.rb +25 -0
  58. data/lib/rsmp/proxy/modules/tasks.rb +105 -0
  59. data/lib/rsmp/proxy/modules/versions.rb +69 -0
  60. data/lib/rsmp/proxy/modules/watchdogs.rb +66 -0
  61. data/lib/rsmp/proxy/proxy.rb +197 -0
  62. data/lib/rsmp/proxy/site/modules/aggregated_status.rb +52 -0
  63. data/lib/rsmp/proxy/site/modules/alarms.rb +27 -0
  64. data/lib/rsmp/proxy/site/modules/commands.rb +31 -0
  65. data/lib/rsmp/proxy/site/modules/status.rb +110 -0
  66. data/lib/rsmp/proxy/site/site_proxy.rb +204 -0
  67. data/lib/rsmp/proxy/supervisor/modules/aggregated_status.rb +47 -0
  68. data/lib/rsmp/proxy/supervisor/modules/alarms.rb +73 -0
  69. data/lib/rsmp/proxy/supervisor/modules/commands.rb +53 -0
  70. data/lib/rsmp/proxy/supervisor/modules/status.rb +204 -0
  71. data/lib/rsmp/proxy/supervisor/supervisor_proxy.rb +177 -0
  72. data/lib/rsmp/tlc/detector_logic.rb +19 -34
  73. data/lib/rsmp/tlc/input_states.rb +126 -0
  74. data/lib/rsmp/tlc/modules/detector_logics.rb +50 -0
  75. data/lib/rsmp/tlc/modules/display.rb +78 -0
  76. data/lib/rsmp/tlc/modules/helpers.rb +41 -0
  77. data/lib/rsmp/tlc/modules/inputs.rb +173 -0
  78. data/lib/rsmp/tlc/modules/modes.rb +253 -0
  79. data/lib/rsmp/tlc/modules/outputs.rb +30 -0
  80. data/lib/rsmp/tlc/modules/plans.rb +218 -0
  81. data/lib/rsmp/tlc/modules/signal_groups.rb +109 -0
  82. data/lib/rsmp/tlc/modules/startup_sequence.rb +22 -0
  83. data/lib/rsmp/tlc/modules/system.rb +140 -0
  84. data/lib/rsmp/tlc/modules/traffic_data.rb +49 -0
  85. data/lib/rsmp/tlc/signal_group.rb +38 -41
  86. data/lib/rsmp/tlc/signal_plan.rb +14 -11
  87. data/lib/rsmp/tlc/signal_priority.rb +40 -35
  88. data/lib/rsmp/tlc/startup_sequence.rb +59 -0
  89. data/lib/rsmp/tlc/traffic_controller.rb +38 -1010
  90. data/lib/rsmp/tlc/traffic_controller_site.rb +58 -57
  91. data/lib/rsmp/version.rb +1 -1
  92. data/lib/rsmp.rb +82 -48
  93. data/rsmp.gemspec +24 -31
  94. metadata +79 -139
  95. data/lib/rsmp/archive.rb +0 -76
  96. data/lib/rsmp/collect/message_matchers.rb +0 -0
  97. data/lib/rsmp/component_base.rb +0 -87
  98. data/lib/rsmp/component_proxy.rb +0 -57
  99. data/lib/rsmp/components.rb +0 -65
  100. data/lib/rsmp/error.rb +0 -71
  101. data/lib/rsmp/inspect.rb +0 -46
  102. data/lib/rsmp/logger.rb +0 -216
  103. data/lib/rsmp/proxy.rb +0 -693
  104. data/lib/rsmp/site.rb +0 -188
  105. data/lib/rsmp/site_proxy.rb +0 -389
  106. data/lib/rsmp/supervisor.rb +0 -302
  107. data/lib/rsmp/supervisor_proxy.rb +0 -510
  108. data/lib/rsmp/tlc/inputs.rb +0 -134
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f2687b5748524376a9316cadcf6776a6d9a9ccddbb8b763ea222246f7efb602
4
- data.tar.gz: 942347899e8f26aae13eb6ead6dce7c2b2d17020c0e11b04af530a5e91904ed5
3
+ metadata.gz: 95c0244d87cf4f53324931c8a898915c54a520ddf0112c4753ef41b03099122c
4
+ data.tar.gz: d09df39a9b9042fc1c9a118986138fff5436e74d743146776b69d22a300826e5
5
5
  SHA512:
6
- metadata.gz: 77ba8af9b9be03e22bef3fa9a83c28f407c2371f7b6c3064e00396f8f9e2a1e088d52afb9c06270352c602cea91b88468e8674a5555b6a7383cd8b389f5a2567
7
- data.tar.gz: 1f17f3055a0c88a2848fc5ef0b1fe93fd7ad02e321cdfbe90824f418c61054c6085940e5c3c87a186ab46ed7e6c5e8bceb0dc905e0109d055d484519cb030659
6
+ metadata.gz: 96bfd44c55d893634aebbed5eb0a8d830190b0fc7abdeb644f2fe9da1fecae60b1e1a723806d93cdfb124e33e3a89e7e0ca28e2ba14111b43346741e9dfd4086
7
+ data.tar.gz: 32dc5721a03a4d2a5161954e5c0a2b9273c3b245dcb1769902b13001582cc34ba13bc8e301954bad68b3d336e7be8bbf565aede3edcfc8e7e3f504504dcf44be
@@ -0,0 +1,22 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
+ {
4
+ "name": "Ruby",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/ruby:3.4",
7
+
8
+ // Features to add to the dev container. More info: https://containers.dev/features.
9
+ // "features": {},
10
+
11
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
12
+ // "forwardPorts": [],
13
+
14
+ // A command to run when creating the container and rerun when the workspace content was updated while creating the container
15
+ "updateContentCommand": "bundle install"
16
+
17
+ // Configure tool-specific properties.
18
+ // "customizations": {},
19
+
20
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21
+ // "remoteUser": "root"
22
+ }
@@ -0,0 +1,17 @@
1
+ # This workflow runs RSpec tests
2
+
3
+ name: Rubocop
4
+ on: [push]
5
+ jobs:
6
+ test:
7
+ timeout-minutes: 10
8
+ strategy:
9
+ fail-fast: false
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: ruby/setup-ruby@v1
14
+ with:
15
+ bundler-cache: true
16
+ - run: bundle exec rubocop
17
+
data/.gitignore CHANGED
@@ -1,10 +1,9 @@
1
- ignore
2
- log
3
- .DS_Store
4
- .rspec_status
5
-
1
+ /.DS_Store
2
+ /.rspec_status
3
+ /ignore/
4
+ /log/
6
5
  /.bundle/
7
- /.yardoc
6
+ /.yardoc/
8
7
  /_yardoc/
9
8
  /coverage/
10
9
  /doc/
data/.rubocop.yml ADDED
@@ -0,0 +1,69 @@
1
+ plugins:
2
+ - rubocop-rspec
3
+ - rubocop-rake
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+ TargetRubyVersion: 3.4
8
+ Exclude:
9
+ - 'vendor/**/*'
10
+ - 'bin/**/*'
11
+ - '.bundle/**/*'
12
+ - 'ignore/**/*'
13
+ - 'config/private/**/*'
14
+
15
+ # Allow longer line lengths for tests with long JSON strings
16
+ Layout/LineLength:
17
+ Max: 120
18
+ Exclude:
19
+ - 'spec/**/*'
20
+
21
+ # Allow some reasonable flexibility for domain-specific code
22
+ Metrics/MethodLength:
23
+ Max: 25
24
+
25
+ Metrics/ClassLength:
26
+ Max: 200
27
+
28
+ Metrics/ModuleLength:
29
+ Max: 200
30
+
31
+ Metrics/AbcSize:
32
+ Max: 20
33
+
34
+ Metrics/CyclomaticComplexity:
35
+ Max: 10
36
+
37
+ Metrics/PerceivedComplexity:
38
+ Max: 10
39
+
40
+ Metrics/ParameterLists:
41
+ Max: 5
42
+
43
+ # Allow some blocks to be longer for complex configurations and tests
44
+ Metrics/BlockLength:
45
+ Exclude:
46
+ - 'spec/**/*'
47
+ - 'features/**/*'
48
+ - '*.gemspec'
49
+
50
+ # From Ruby 3.4, frozen string literals are the default anyways
51
+ Style/FrozenStringLiteralComment:
52
+ Enabled: false
53
+
54
+ # Allow mix-in usage at top level in test files
55
+ Style/MixinUsage:
56
+ Exclude:
57
+ - 'spec/**/*'
58
+ - 'features/**/*'
59
+
60
+ # Allow constant definition in blocks for test helpers
61
+ Lint/ConstantDefinitionInBlock:
62
+ Exclude:
63
+ - 'spec/**/*'
64
+
65
+ RSpec/MultipleExpectations:
66
+ Max: 20
67
+
68
+ RSpec/ExampleLength:
69
+ Max: 50
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.4
1
+ ruby 4
data/Gemfile CHANGED
@@ -1,5 +1,18 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rsmp.gemspec
4
4
 
5
5
  gemspec
6
+
7
+ group :development do
8
+ gem 'aruba', '~> 2.3'
9
+ gem 'bundler', '~> 4.0'
10
+ gem 'cucumber', '~> 9.2'
11
+ gem 'rake', '~> 13.2'
12
+ gem 'rspec', '~> 3.13'
13
+ gem 'rspec-expectations', '~> 3.13'
14
+ gem 'rubocop', '~> 1.65'
15
+ gem 'rubocop-rake', require: false
16
+ gem 'rubocop-rspec', require: false
17
+ gem 'timecop', '~> 0.9'
18
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.37.0)
4
+ rsmp (0.39.0)
5
5
  async (~> 2.32)
6
6
  colorize (~> 1.1)
7
7
  io-endpoint (~> 0.15)
@@ -13,26 +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
- async (2.32.0)
22
+ ast (2.4.3)
23
+ async (2.35.2)
23
24
  console (~> 1.29)
24
25
  fiber-annotation
25
26
  io-event (~> 1.11)
26
27
  metrics (~> 0.12)
27
28
  traces (~> 0.18)
28
- bigdecimal (3.2.3)
29
+ bigdecimal (4.0.1)
29
30
  builder (3.3.0)
30
31
  colorize (1.1.0)
31
- console (1.34.0)
32
+ console (1.34.2)
32
33
  fiber-annotation
33
34
  fiber-local (~> 1.1)
34
35
  json
35
- contracts (0.17.2)
36
+ contracts (0.17.3)
36
37
  cucumber (9.2.1)
37
38
  builder (~> 3.2)
38
39
  cucumber-ci-environment (> 9, < 11)
@@ -54,51 +55,84 @@ GEM
54
55
  bigdecimal
55
56
  cucumber-gherkin (27.0.0)
56
57
  cucumber-messages (>= 19.1.4, < 23)
57
- cucumber-html-formatter (21.14.0)
58
+ cucumber-html-formatter (21.15.1)
58
59
  cucumber-messages (> 19, < 28)
59
60
  cucumber-messages (22.0.0)
60
61
  cucumber-tag-expressions (6.1.2)
61
62
  diff-lcs (1.6.2)
62
- ffi (1.17.2)
63
- 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)
64
68
  fiber-annotation (0.2.0)
65
69
  fiber-local (1.1.0)
66
70
  fiber-storage
67
71
  fiber-storage (1.0.1)
68
72
  hana (1.3.7)
69
- io-endpoint (0.15.2)
70
- io-event (1.14.0)
71
- io-stream (0.10.0)
72
- 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)
73
77
  json_schemer (2.4.0)
74
78
  bigdecimal
75
79
  hana (~> 1.3)
76
80
  regexp_parser (~> 2.0)
77
81
  simpleidn (~> 0.2)
82
+ language_server-protocol (3.17.0.5)
83
+ lint_roller (1.1.0)
78
84
  logger (1.7.0)
79
85
  memoist3 (1.0.0)
80
86
  metrics (0.15.0)
81
87
  mini_mime (1.1.5)
82
88
  multi_test (1.1.0)
83
89
  ostruct (0.6.3)
84
- rake (13.3.0)
85
- regexp_parser (2.11.2)
86
- rsmp_schema (0.8.9)
90
+ parallel (1.27.0)
91
+ parser (3.3.10.0)
92
+ ast (~> 2.4.1)
93
+ racc
94
+ prism (1.8.0)
95
+ racc (1.8.1)
96
+ rainbow (3.1.1)
97
+ rake (13.3.1)
98
+ regexp_parser (2.11.3)
99
+ rsmp_schema (0.9.1)
87
100
  json_schemer (~> 2.4.0)
88
101
  thor (~> 1.4.0)
89
- rspec (3.13.1)
102
+ rspec (3.13.2)
90
103
  rspec-core (~> 3.13.0)
91
104
  rspec-expectations (~> 3.13.0)
92
105
  rspec-mocks (~> 3.13.0)
93
- rspec-core (3.13.5)
106
+ rspec-core (3.13.6)
94
107
  rspec-support (~> 3.13.0)
95
108
  rspec-expectations (3.13.5)
96
109
  diff-lcs (>= 1.2.0, < 2.0)
97
110
  rspec-support (~> 3.13.0)
98
- rspec-mocks (3.13.5)
111
+ rspec-mocks (3.13.7)
99
112
  diff-lcs (>= 1.2.0, < 2.0)
100
113
  rspec-support (~> 3.13.0)
101
- rspec-support (3.13.5)
114
+ rspec-support (3.13.6)
115
+ rubocop (1.82.1)
116
+ json (~> 2.3)
117
+ language_server-protocol (~> 3.17.0.2)
118
+ lint_roller (~> 1.1.0)
119
+ parallel (~> 1.10)
120
+ parser (>= 3.3.0.2)
121
+ rainbow (>= 2.2.2, < 4.0)
122
+ regexp_parser (>= 2.9.3, < 3.0)
123
+ rubocop-ast (>= 1.48.0, < 2.0)
124
+ ruby-progressbar (~> 1.7)
125
+ unicode-display_width (>= 2.4.0, < 4.0)
126
+ rubocop-ast (1.49.0)
127
+ parser (>= 3.3.7.2)
128
+ prism (~> 1.7)
129
+ rubocop-rake (0.7.1)
130
+ lint_roller (~> 1.1)
131
+ rubocop (>= 1.72.1)
132
+ rubocop-rspec (3.9.0)
133
+ lint_roller (~> 1.1)
134
+ rubocop (~> 1.81)
135
+ ruby-progressbar (1.13.0)
102
136
  simpleidn (0.2.3)
103
137
  sys-uname (1.4.1)
104
138
  ffi (~> 1.1)
@@ -106,28 +140,29 @@ GEM
106
140
  thor (1.4.0)
107
141
  timecop (0.9.10)
108
142
  traces (0.18.2)
143
+ unicode-display_width (3.2.0)
144
+ unicode-emoji (~> 4.1)
145
+ unicode-emoji (4.2.0)
109
146
 
110
147
  PLATFORMS
111
- arm64-darwin-22
112
148
  arm64-darwin-23
113
149
  arm64-darwin-24
114
150
  x64-mingw-ucrt
115
- x64-mingw32
116
- x86_64-darwin-19
117
- x86_64-darwin-20
118
- x86_64-darwin-21
119
151
  x86_64-darwin-22
120
152
  x86_64-linux
121
153
 
122
154
  DEPENDENCIES
123
155
  aruba (~> 2.3)
124
- bundler (~> 2.6)
156
+ bundler (~> 4.0)
125
157
  cucumber (~> 9.2)
126
158
  rake (~> 13.2)
127
159
  rsmp!
128
160
  rspec (~> 3.13)
129
161
  rspec-expectations (~> 3.13)
162
+ rubocop (~> 1.65)
163
+ rubocop-rake
164
+ rubocop-rspec
130
165
  timecop (~> 0.9)
131
166
 
132
167
  BUNDLED WITH
133
- 2.6.3
168
+ 4.0.3
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec