rsmp 0.14.2 → 0.14.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 +3 -3
- data/lib/rsmp/message.rb +7 -7
- data/lib/rsmp/proxy.rb +23 -6
- data/lib/rsmp/version.rb +1 -1
- data/rsmp.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc8c1358c2384e82da85e53b6332604fd92904376ddb33bbea713a490f327b5
|
4
|
+
data.tar.gz: 03713be97106faeac939889d921967d24f7857ebf80c2dabb1c3c1ed861409a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 646773a660c80b3f5fa6bc3627181c803435f9969b0c5c342212ada28e959efdf0690737f8adea59fa4e9966fa0c18f440751a14f9744f29305400ea51ba20ae
|
7
|
+
data.tar.gz: 875271f96982e6833861c14686ad03167bcf15cd85a6bcee97cdd2fc4c95f16de4561d7fa9b9b5c078a3b07460ec063b105d5c8e0aaaffa5af665c3be2bcc293
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rsmp (0.14.
|
4
|
+
rsmp (0.14.5)
|
5
5
|
async (~> 1.30.3)
|
6
6
|
async-io (~> 1.33.0)
|
7
7
|
colorize (~> 0.8.1)
|
8
|
-
rsmp_schema (~> 0.
|
8
|
+
rsmp_schema (~> 0.2.2)
|
9
9
|
thor (~> 1.2.1)
|
10
10
|
|
11
11
|
GEM
|
@@ -80,7 +80,7 @@ GEM
|
|
80
80
|
nio4r (2.5.8)
|
81
81
|
rake (13.0.6)
|
82
82
|
regexp_parser (2.5.0)
|
83
|
-
rsmp_schema (0.
|
83
|
+
rsmp_schema (0.2.2)
|
84
84
|
json_schemer (~> 0.2.21)
|
85
85
|
thor (~> 1.2.1)
|
86
86
|
rspec (3.10.0)
|
data/lib/rsmp/message.rb
CHANGED
@@ -61,21 +61,21 @@ module RSMP
|
|
61
61
|
|
62
62
|
def self.build_alarm attributes
|
63
63
|
case attributes["aSp"]
|
64
|
-
when
|
64
|
+
when /^Issue$/i
|
65
65
|
AlarmIssue.new attributes
|
66
|
-
when
|
66
|
+
when /^Request$/i
|
67
67
|
AlarmRequest.new attributes
|
68
|
-
when
|
68
|
+
when /^Acknowledge$/i
|
69
69
|
AlarmAcknowledged.new attributes
|
70
|
-
when
|
71
|
-
if attributes['sS'] =~
|
70
|
+
when /^Suspend$/i
|
71
|
+
if attributes['sS'] =~ /^suspended$/i
|
72
72
|
AlarmSuspended.new attributes
|
73
|
-
elsif attributes['sS'] =~
|
73
|
+
elsif attributes['sS'] =~ /^notSuspended$/i
|
74
74
|
AlarmResumed.new attributes
|
75
75
|
else
|
76
76
|
AlarmSuspend.new attributes
|
77
77
|
end
|
78
|
-
when
|
78
|
+
when /^Resume$/i
|
79
79
|
AlarmResume.new attributes
|
80
80
|
else
|
81
81
|
Alarm.new attributes
|
data/lib/rsmp/proxy.rb
CHANGED
@@ -313,12 +313,29 @@ module RSMP
|
|
313
313
|
super str, options.merge(ip: @ip, port: @port, site_id: @site_id)
|
314
314
|
end
|
315
315
|
|
316
|
+
def self.latest_core_version
|
317
|
+
RSMP::Schema.schemas[:core].keys.last
|
318
|
+
end
|
319
|
+
|
320
|
+
def self.all_core_versions
|
321
|
+
RSMP::Schema.schemas[:core].keys
|
322
|
+
end
|
323
|
+
|
324
|
+
def self.latest_sxl_tlc_version
|
325
|
+
RSMP::Schema.schemas[:tlc].keys.last
|
326
|
+
end
|
327
|
+
|
328
|
+
def self.all_sxl_tlc_versions
|
329
|
+
RSMP::Schema.schemas[:tlc].keys
|
330
|
+
end
|
331
|
+
|
316
332
|
def get_schemas
|
317
333
|
# normally we have an sxl, but during connection, it hasn't been established yet
|
318
334
|
# at these times we only validate against the core schema
|
319
335
|
# TODO
|
320
|
-
# what schema should we use to validate the
|
321
|
-
schemas = { core:
|
336
|
+
# what schema should we use to validate the initial Version and MessageAck messages?
|
337
|
+
schemas = { core: latest_core_version } # use latest core
|
338
|
+
p schemas
|
322
339
|
schemas[sxl] = RSMP::Schema.sanitize_version(sxl_version) if sxl && sxl_version
|
323
340
|
schemas
|
324
341
|
end
|
@@ -458,8 +475,8 @@ module RSMP
|
|
458
475
|
end
|
459
476
|
|
460
477
|
def rsmp_versions
|
461
|
-
return [
|
462
|
-
return
|
478
|
+
return [latest_core_version] if @site_settings["rsmp_versions"] == 'latest'
|
479
|
+
return all_core_versions if @site_settings["rsmp_versions"] == 'all'
|
463
480
|
@site_settings["rsmp_versions"]
|
464
481
|
end
|
465
482
|
|
@@ -510,9 +527,9 @@ module RSMP
|
|
510
527
|
|
511
528
|
def send_version site_id, rsmp_versions
|
512
529
|
if rsmp_versions=='latest'
|
513
|
-
versions = [
|
530
|
+
versions = [latest_core_version]
|
514
531
|
elsif rsmp_versions=='all'
|
515
|
-
versions =
|
532
|
+
versions = all_core_versions
|
516
533
|
else
|
517
534
|
versions = [rsmp_versions].flatten
|
518
535
|
end
|
data/lib/rsmp/version.rb
CHANGED
data/rsmp.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "async-io", "~> 1.33.0"
|
35
35
|
spec.add_dependency "colorize", "~> 0.8.1"
|
36
36
|
spec.add_dependency "thor", "~> 1.2.1"
|
37
|
-
spec.add_dependency "rsmp_schema", "~> 0.
|
37
|
+
spec.add_dependency "rsmp_schema", "~> 0.2.2"
|
38
38
|
|
39
39
|
spec.add_development_dependency "bundler", "~> 2.3.7"
|
40
40
|
spec.add_development_dependency "rake", "~> 13.0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.2.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.2.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|