rsmp 0.32.0 → 0.32.2

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: c4dc16f45d38459c4ab31445f39e74c8e0fe71ce906759a4f842ddcc8ca78471
4
- data.tar.gz: 50d8ff8a27a2f16ddba8206236cc17997a582b5b5ec01348a55e9a7b3a8004b7
3
+ metadata.gz: 25b1ee80906e4f8346ddd47e2541a1b3c535c2df0b1d534ff2fcf198ab0cae95
4
+ data.tar.gz: 0ed36d0bc9035d429a9fcdbae3de7208ec36801ba6ed703075229f2744940d0b
5
5
  SHA512:
6
- metadata.gz: 735d346b07fb2ad71cead5a0d934bb415125429e2fa628e9c4aa93a73f7e1e40a8db5cce27b6329fbb520f13f9018fb2f221e4cf60051818043e58cbab2f0523
7
- data.tar.gz: aad8d0d4b871916080c7c981a00fea551fb0c7b62599149b017b955d46e6c810fd246682206d89f2a6a99b5ec19cc0285fb6c68e2cde8b594cbe40402e542834
6
+ metadata.gz: 12384ded80fb0f30d9ac4d4a481249aee54be92d7b3efbdbcad80b435e4220d0add53430db0c05ee12a9d275c748b973e2b39e26f095766da33385479e9422c9
7
+ data.tar.gz: '079712e0c3b2ee6bb579ed71d99fff229d8a06e275080982c71e48ea0c4dbf1aa55bbdf0c1baca9229aa747007aac42a709668b705788cd6071565a7d9f520a3'
@@ -9,13 +9,11 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  os: [ubuntu-latest, macos-latest, windows-latest]
12
- # Due to https://github.com/actions/runner/issues/849, we have to use quotes
13
- ruby: ['3.3']
14
12
  runs-on: ${{ matrix.os }}
15
13
  steps:
16
14
  - uses: actions/checkout@v4
17
15
  - uses: ruby/setup-ruby@v1
18
16
  with:
19
- ruby-version: ${{ matrix.ruby }}
20
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
17
+ ruby-version: 3.3
18
+ bundler-cache: true
21
19
  - run: bundle exec rspec -f d
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.3.2
1
+ ruby 3.3.5
data/Gemfile.lock CHANGED
@@ -1,11 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.32.0)
5
- async (~> 2.12.0)
6
- async-io (~> 1.43.0)
4
+ rsmp (0.32.2)
5
+ async (~> 2.16)
6
+ async-io (~> 1.43)
7
7
  colorize (~> 1.1)
8
- rsmp_schema (~> 0.7.0)
8
+ logger (~> 1.6)
9
+ ostruct (~> 0.6)
10
+ rsmp_schema (~> 0.7)
9
11
 
10
12
  GEM
11
13
  remote: https://rubygems.org/
@@ -16,8 +18,8 @@ GEM
16
18
  cucumber (>= 8.0, < 10.0)
17
19
  rspec-expectations (~> 3.4)
18
20
  thor (~> 1.0)
19
- async (2.12.1)
20
- console (~> 1.25, >= 1.25.2)
21
+ async (2.16.1)
22
+ console (~> 1.26)
21
23
  fiber-annotation
22
24
  io-event (~> 1.6, >= 1.6.5)
23
25
  async-io (1.43.2)
@@ -43,7 +45,7 @@ GEM
43
45
  multi_test (~> 1.1)
44
46
  sys-uname (~> 1.2)
45
47
  cucumber-ci-environment (10.0.1)
46
- cucumber-core (13.0.2)
48
+ cucumber-core (13.0.3)
47
49
  cucumber-gherkin (>= 27, < 28)
48
50
  cucumber-messages (>= 20, < 23)
49
51
  cucumber-tag-expressions (> 5, < 7)
@@ -51,16 +53,12 @@ GEM
51
53
  bigdecimal
52
54
  cucumber-gherkin (27.0.0)
53
55
  cucumber-messages (>= 19.1.4, < 23)
54
- cucumber-html-formatter (21.3.1)
55
- cucumber-messages (> 19, < 25)
56
+ cucumber-html-formatter (21.7.0)
57
+ cucumber-messages (> 19, < 27)
56
58
  cucumber-messages (22.0.0)
57
59
  cucumber-tag-expressions (6.1.0)
58
60
  diff-lcs (1.5.1)
59
61
  ffi (1.17.0)
60
- ffi (1.17.0-arm64-darwin)
61
- ffi (1.17.0-x64-mingw-ucrt)
62
- ffi (1.17.0-x86_64-darwin)
63
- ffi (1.17.0-x86_64-linux-gnu)
64
62
  fiber-annotation (0.2.0)
65
63
  fiber-local (1.1.0)
66
64
  fiber-storage
@@ -73,8 +71,10 @@ GEM
73
71
  hana (~> 1.3)
74
72
  regexp_parser (~> 2.0)
75
73
  simpleidn (~> 0.2)
74
+ logger (1.6.1)
76
75
  mini_mime (1.1.5)
77
76
  multi_test (1.1.0)
77
+ ostruct (0.6.0)
78
78
  rake (13.2.1)
79
79
  regexp_parser (2.9.2)
80
80
  rsmp_schema (0.7.0)
@@ -84,9 +84,9 @@ GEM
84
84
  rspec-core (~> 3.13.0)
85
85
  rspec-expectations (~> 3.13.0)
86
86
  rspec-mocks (~> 3.13.0)
87
- rspec-core (3.13.0)
87
+ rspec-core (3.13.1)
88
88
  rspec-support (~> 3.13.0)
89
- rspec-expectations (3.13.1)
89
+ rspec-expectations (3.13.2)
90
90
  diff-lcs (>= 1.2.0, < 2.0)
91
91
  rspec-support (~> 3.13.0)
92
92
  rspec-mocks (3.13.1)
@@ -111,14 +111,14 @@ PLATFORMS
111
111
  x86_64-linux
112
112
 
113
113
  DEPENDENCIES
114
- aruba (~> 2.2.0)
115
- bundler (~> 2.5.7)
116
- cucumber (~> 9.2.0)
117
- rake (~> 13.2.0)
114
+ aruba (~> 2.2)
115
+ bundler (~> 2.5)
116
+ cucumber (~> 9.2)
117
+ rake (~> 13.2)
118
118
  rsmp!
119
- rspec (~> 3.13.0)
120
- rspec-expectations (~> 3.13.1)
121
- timecop (~> 0.9.9)
119
+ rspec (~> 3.13)
120
+ rspec-expectations (~> 3.13)
121
+ timecop (~> 0.9)
122
122
 
123
123
  BUNDLED WITH
124
- 2.5.11
124
+ 2.5.18
data/config/tlc.yaml CHANGED
@@ -2,7 +2,6 @@ site_id: RN+SI0001
2
2
  supervisors:
3
3
  - ip: 127.0.0.1
4
4
  port: 12111
5
- core_versions: '3.2.2'
6
5
  sxl: tlc
7
6
  sxl_version: '1.2.1'
8
7
  components:
data/lib/rsmp/cli.rb CHANGED
@@ -45,7 +45,7 @@ module RSMP
45
45
  end
46
46
 
47
47
  if options[:core]
48
- settings['core_versions'] = [options[:core]]
48
+ settings['core_version'] = options[:core]
49
49
  end
50
50
 
51
51
  site_class = RSMP::Site
@@ -133,7 +133,7 @@ module RSMP
133
133
 
134
134
  if options[:core]
135
135
  settings['guest'] = {}
136
- settings['guest']['core_versions'] = [options[:core]]
136
+ settings['guest']['core_version'] = options[:core]
137
137
  end
138
138
 
139
139
  if options[:log]
data/lib/rsmp/proxy.rb CHANGED
@@ -474,9 +474,14 @@ module RSMP
474
474
  end
475
475
 
476
476
  def core_versions
477
- return [RSMP::Schema.latest_core_version] if @site_settings["core_versions"] == 'latest'
478
- return RSMP::Schema.core_versions if @site_settings["core_versions"] == 'all'
479
- [@site_settings["core_versions"]].flatten
477
+ version = @site_settings["core_version"]
478
+ if version == 'latest'
479
+ [RSMP::Schema.latest_core_version]
480
+ elsif version
481
+ [version]
482
+ else
483
+ RSMP::Schema.core_versions
484
+ end
480
485
  end
481
486
 
482
487
  def check_core_version message
@@ -486,7 +491,7 @@ module RSMP
486
491
  if candidates.any?
487
492
  @core_version = candidates.sort_by { |v| Gem::Version.new(v) }.last # pick latest version
488
493
  else
489
- reason = "RSMP versions [#{message.versions.join(',')}] requested, but only [#{versions.join(',')}] supported."
494
+ reason = "RSMP versions [#{message.versions.join(', ')}] requested, but only [#{versions.join(', ')}] supported."
490
495
  dont_acknowledge message, "Version message rejected", reason, force: true
491
496
  raise HandshakeError.new reason
492
497
  end
data/lib/rsmp/site.rb CHANGED
@@ -6,7 +6,7 @@ module RSMP
6
6
  class Site < Node
7
7
  include Components
8
8
 
9
- attr_reader :core_versions, :site_settings, :logger, :proxies
9
+ attr_reader :core_version, :site_settings, :logger, :proxies
10
10
 
11
11
  def initialize options={}
12
12
  super options
@@ -32,7 +32,6 @@ module RSMP
32
32
  'supervisors' => [
33
33
  { 'ip' => '127.0.0.1', 'port' => 12111 }
34
34
  ],
35
- 'core_versions' => 'all',
36
35
  'sxl' => 'tlc',
37
36
  'sxl_version' => RSMP::Schema.latest_version(:tlc),
38
37
  'intervals' => {
@@ -57,6 +56,7 @@ module RSMP
57
56
  end
58
57
 
59
58
  @site_settings = defaults.deep_merge options[:site_settings]
59
+
60
60
  check_sxl_version
61
61
  check_core_versions
62
62
  setup_components @site_settings['components']
@@ -69,16 +69,10 @@ module RSMP
69
69
  end
70
70
 
71
71
  def check_core_versions
72
- return if @site_settings['core_versions'] == 'all'
73
- requested = [@site_settings['core_versions']].flatten
74
- invalid = requested - RSMP::Schema::core_versions
75
- if invalid.any?
76
- if invalid.size == 1
77
- error_str = "Unknown core version: #{invalid.first}"
78
- else
79
- error_str = "Unknown core versions: [#{invalid.join(' ')}]"
80
- end
81
-
72
+ version = @site_settings['core_version']
73
+ return unless version
74
+ unless RSMP::Schema::core_versions.include? version
75
+ error_str = "Unknown core version: #{version}"
82
76
  raise RSMP::ConfigurationError.new(error_str)
83
77
  end
84
78
  end
@@ -89,23 +83,13 @@ module RSMP
89
83
 
90
84
  def log_site_starting
91
85
  log "Starting #{site_type_name} #{@site_settings["site_id"]}", level: :info, timestamp: @clock.now
92
-
93
86
  sxl = "Using #{@site_settings["sxl"]} sxl #{@site_settings["sxl_version"]}"
94
-
95
- versions = @site_settings["core_versions"]
96
- if versions.is_a?(Array) && versions.size == 1
97
- versions = versions.first
98
- end
99
- if versions == 'all'
87
+ version = @site_settings["core_version"]
88
+ unless version
100
89
  core = "accepting all core versions [#{RSMP::Schema.core_versions.join(', ')}]"
101
90
  else
102
- if versions.is_a?(String)
103
- core = "accepting only core version #{versions}"
104
- else
105
- core = "accepting core versions [#{versions.join(', ')}]"
106
- end
91
+ core = "accepting only core version #{version}"
107
92
  end
108
-
109
93
  log "#{sxl}, #{core}", level: :info, timestamp: @clock.now
110
94
  end
111
95
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  module RSMP
6
6
  class Supervisor < Node
7
- attr_reader :core_versions, :site_id, :supervisor_settings, :proxies, :logger
7
+ attr_reader :core_version, :site_id, :supervisor_settings, :proxies, :logger
8
8
 
9
9
  def initialize options={}
10
10
  handle_supervisor_settings( options[:supervisor_settings] || {} )
@@ -22,7 +22,6 @@ module RSMP
22
22
  'port' => 12111,
23
23
  'ips' => 'all',
24
24
  'guest' => {
25
- 'core_versions' => 'all',
26
25
  'sxl' => 'tlc',
27
26
  'intervals' => {
28
27
  'timer' => 1,
@@ -37,7 +36,7 @@ module RSMP
37
36
 
38
37
  # merge options into defaults
39
38
  @supervisor_settings = defaults.deep_merge(supervisor_settings)
40
- @core_versions = @supervisor_settings["guest"]["core_versions"]
39
+ @core_version = @supervisor_settings["guest"]["core_version"]
41
40
  check_site_sxl_types
42
41
  end
43
42
 
@@ -43,7 +43,7 @@ module RSMP
43
43
  end
44
44
 
45
45
  def start_handshake
46
- send_version @site_settings['site_id'], @site_settings["core_versions"]
46
+ send_version @site_settings['site_id'], core_versions
47
47
  end
48
48
 
49
49
  # connect to the supervisor and initiate handshake supervisor
@@ -408,7 +408,7 @@ module RSMP
408
408
 
409
409
  def find_plan plan_nr
410
410
  plan = @plans[plan_nr.to_i]
411
- raise InvalidMessage.new "unknown signal plan #{plan_nr}, known only [#{@plans.keys.join(',')}]" unless plan
411
+ raise InvalidMessage.new "unknown signal plan #{plan_nr}, known only [#{@plans.keys.join(', ')}]" unless plan
412
412
  plan
413
413
  end
414
414
 
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.32.0"
2
+ VERSION = "0.32.2"
3
3
  end
data/rsmp.gemspec CHANGED
@@ -30,16 +30,18 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency "async", "~> 2.12.0"
34
- spec.add_dependency "async-io", "~> 1.43.0"
33
+ spec.add_dependency "logger", "~> 1.6"
34
+ spec.add_dependency "ostruct", "~> 0.6"
35
+ spec.add_dependency "async", "~> 2.16"
36
+ spec.add_dependency "async-io", "~> 1.43"
35
37
  spec.add_dependency "colorize", "~> 1.1"
36
- spec.add_dependency "rsmp_schema", "~> 0.7.0"
38
+ spec.add_dependency "rsmp_schema", "~> 0.7"
37
39
 
38
- spec.add_development_dependency "bundler", "~> 2.5.7"
39
- spec.add_development_dependency "rake", "~> 13.2.0"
40
- spec.add_development_dependency "rspec", "~> 3.13.0"
41
- spec.add_development_dependency "rspec-expectations", "~> 3.13.1"
42
- spec.add_development_dependency "timecop", "~> 0.9.9"
43
- spec.add_development_dependency "cucumber", "~> 9.2.0"
44
- spec.add_development_dependency "aruba" , "~> 2.2.0"
40
+ spec.add_development_dependency "bundler", "~> 2.5"
41
+ spec.add_development_dependency "rake", "~> 13.2"
42
+ spec.add_development_dependency "rspec", "~> 3.13"
43
+ spec.add_development_dependency "rspec-expectations", "~> 3.13"
44
+ spec.add_development_dependency "timecop", "~> 0.9"
45
+ spec.add_development_dependency "cucumber", "~> 9.2"
46
+ spec.add_development_dependency "aruba" , "~> 2.2"
45
47
  end
metadata CHANGED
@@ -1,43 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.0
4
+ version: 0.32.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-03 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ostruct
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.6'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: async
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - "~>"
18
46
  - !ruby/object:Gem::Version
19
- version: 2.12.0
47
+ version: '2.16'
20
48
  type: :runtime
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
52
  - - "~>"
25
53
  - !ruby/object:Gem::Version
26
- version: 2.12.0
54
+ version: '2.16'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: async-io
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: 1.43.0
61
+ version: '1.43'
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: 1.43.0
68
+ version: '1.43'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: colorize
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -58,112 +86,112 @@ dependencies:
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: 0.7.0
89
+ version: '0.7'
62
90
  type: :runtime
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: 0.7.0
96
+ version: '0.7'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: bundler
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: 2.5.7
103
+ version: '2.5'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: 2.5.7
110
+ version: '2.5'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rake
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
115
  - - "~>"
88
116
  - !ruby/object:Gem::Version
89
- version: 13.2.0
117
+ version: '13.2'
90
118
  type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
122
  - - "~>"
95
123
  - !ruby/object:Gem::Version
96
- version: 13.2.0
124
+ version: '13.2'
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: rspec
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
129
  - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: 3.13.0
131
+ version: '3.13'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: 3.13.0
138
+ version: '3.13'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: rspec-expectations
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: 3.13.1
145
+ version: '3.13'
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
150
  - - "~>"
123
151
  - !ruby/object:Gem::Version
124
- version: 3.13.1
152
+ version: '3.13'
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: timecop
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: 0.9.9
159
+ version: '0.9'
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: 0.9.9
166
+ version: '0.9'
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: cucumber
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
171
  - - "~>"
144
172
  - !ruby/object:Gem::Version
145
- version: 9.2.0
173
+ version: '9.2'
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
178
  - - "~>"
151
179
  - !ruby/object:Gem::Version
152
- version: 9.2.0
180
+ version: '9.2'
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: aruba
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
185
  - - "~>"
158
186
  - !ruby/object:Gem::Version
159
- version: 2.2.0
187
+ version: '2.2'
160
188
  type: :development
161
189
  prerelease: false
162
190
  version_requirements: !ruby/object:Gem::Requirement
163
191
  requirements:
164
192
  - - "~>"
165
193
  - !ruby/object:Gem::Version
166
- version: 2.2.0
194
+ version: '2.2'
167
195
  description: Easy RSMP site and supervisor communication.
168
196
  email:
169
197
  - zf0f@kk.dk
@@ -265,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
293
  - !ruby/object:Gem::Version
266
294
  version: '0'
267
295
  requirements: []
268
- rubygems_version: 3.5.9
296
+ rubygems_version: 3.5.16
269
297
  signing_key:
270
298
  specification_version: 4
271
299
  summary: RoadSide Message Protocol (RSMP) library.