rsmp 0.53.1 → 0.53.3

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: 753bf9789b6bf177b83fb54c6fb95856b5f6ceed515a9ff17ba4993109a88d29
4
- data.tar.gz: 0ab04b23c2e57490c605f26bb2962d79a88dc6a1e4b165085dedbc4dab52a834
3
+ metadata.gz: 6c48475e71b559098bd7e9d1f5b7839fff9159a889322c5e93d52be87464d3b7
4
+ data.tar.gz: 340338647b8e8f5d95fa5d82335596ad5ed2e4b7d45c41b10f75aaf6aed92d54
5
5
  SHA512:
6
- metadata.gz: e66c0016019dff11724b0989dd3da9d319aa8a24ce8ad3b326068bd03abe73580d212c15023470378cc21690b92cb298666fde785195b1267e28a3b4fe5cbdbd
7
- data.tar.gz: ccd8d17f4eef01bf389f7b17851ffc321b3d64bf2b562e06700809e693065f9b71bac39bc50fb6630a896d1e7fb1ea60a59e7fc6f0182e1cef36e9bb41582310
6
+ metadata.gz: 496ce34aaca4d14a011a44a02680284be45865ba8c72b9d1961e50f5ff2c708040ccb475ebe968716d5704180f7faa0fb930e750b3caa90c3d296966b6d10170
7
+ data.tar.gz: 7129e21dc9a85b063edaf793d1ef2bf605205f5c8e0492a83eccd6b3b3c21946c65761696a95fd8579e341e96f679b30b269a5905d1738854fe83339d809a39a
data/CHANGELOG.md CHANGED
@@ -740,4 +740,8 @@ Initial release.
740
740
  - allow fractional status subscription intervals for all older core versions to align with their specs.
741
741
 
742
742
  ## 0.53.1
743
- - skip repeated status value checks for buffered values (`q=old`) and unknown subscription settings
743
+ - skip repeated status value checks for buffered values (`q=old`) and unknown subscription settings
744
+
745
+ ## 0.53.2
746
+ - fix issues with Alarm enum casing
747
+ - update TLC schemas
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.53.1)
4
+ rsmp (0.53.3)
5
5
  async (~> 2.45)
6
6
  colorize (~> 1.1)
7
7
  io-endpoint (~> 0.17)
@@ -87,6 +87,7 @@ GEM
87
87
  PLATFORMS
88
88
  arm64-darwin-23
89
89
  arm64-darwin-24
90
+ arm64-darwin-25
90
91
  x64-mingw-ucrt
91
92
  x86_64-darwin-22
92
93
  x86_64-linux
@@ -1,6 +1,8 @@
1
1
  module RSMP
2
2
  # Class for waiting for specific command responses
3
3
  class AlarmCollector < Collector
4
+ ENUM_ATTRIBUTES = %w[aSp ack aS sS cat pri].freeze
5
+
4
6
  def initialize(proxy, options = {})
5
7
  @matcher = options[:matcher] || {}
6
8
  super(proxy, options.merge(
@@ -27,12 +29,17 @@ module RSMP
27
29
  when Regexp
28
30
  return false if got !~ want
29
31
  when String
30
- return false if got != want
32
+ return false unless string_attribute_matches?(key, want, got)
31
33
  end
32
34
  end
33
35
  true
34
36
  end
35
37
 
38
+ def string_attribute_matches?(key, want, got)
39
+ # Schemas enforce wire casing; enum matching also supports older Core versions.
40
+ ENUM_ATTRIBUTES.include?(key) ? want.casecmp?(got) : want == got
41
+ end
42
+
36
43
  def rvs_attributes_match?(message)
37
44
  return true unless @matcher['rvs']
38
45
 
@@ -9,9 +9,9 @@ module RSMP
9
9
  def self.create_from_message(component, message)
10
10
  options = {
11
11
  timestamp: RSMP::Clock.parse(message.attribute('aTs')),
12
- acknowledged: message.attribute('ack') == 'Acknowledged',
13
- suspended: message.attribute('aS') == 'Suspended',
14
- active: message.attribute('sS') == 'Active',
12
+ acknowledged: message.attribute('ack').downcase == 'acknowledged',
13
+ suspended: message.attribute('sS').downcase == 'suspended',
14
+ active: message.attribute('aS').downcase == 'active',
15
15
  category: message.attribute('cat'),
16
16
  priority: message.attribute('pri').to_i,
17
17
  rvs: message.attribute('rvs')
@@ -121,9 +121,9 @@ module RSMP
121
121
  raise TimestampError, "timestamp is earlier than previous alarm #{message.m_id_short}" if older_message? message
122
122
  ensure
123
123
  @timestamp = RSMP::Clock.parse message.attribute('aTs')
124
- @acknowledged = message.attribute('ack') == 'True'
125
- @suspended = message.attribute('sS') == 'True'
126
- @active = message.attribute('aS') == 'True'
124
+ @acknowledged = message.attribute('ack').downcase == 'acknowledged'
125
+ @suspended = message.attribute('sS').downcase == 'suspended'
126
+ @active = message.attribute('aS').downcase == 'active'
127
127
  @category = message.attribute('cat')
128
128
  @priority = message.attribute('pri').to_i
129
129
  @rvs = message.attribute('rvs')
data/lib/rsmp/message.rb CHANGED
@@ -329,7 +329,7 @@ module RSMP
329
329
  def initialize(attributes = {})
330
330
  super({
331
331
  'aSp' => 'Acknowledge',
332
- 'ack' => 'acknowledged'
332
+ 'ack' => 'Acknowledged'
333
333
  }.merge attributes)
334
334
  end
335
335
  end
@@ -27,7 +27,6 @@ module RSMP
27
27
  end
28
28
 
29
29
  def handshake_complete
30
- build_sxl_interfaces
31
30
  self.state = :ready
32
31
  end
33
32
  end
@@ -7,6 +7,7 @@ module RSMP
7
7
  else
8
8
  select_legacy_sxl message
9
9
  end
10
+ build_sxl_interfaces
10
11
  rescue RSMP::Schema::UnknownSchemaError => e
11
12
  dont_acknowledge message, "Rejected #{message.type} message,", e.to_s
12
13
  end
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = '0.53.1'.freeze
2
+ VERSION = '0.53.3'.freeze
3
3
  end
@@ -13,7 +13,7 @@
13
13
  "sS" : {
14
14
  "description" : "Suspend status",
15
15
  "type" : "string",
16
- "enum" : [ "suspended", "notSuspended" ]
16
+ "enum" : [ "Suspended", "notSuspended" ]
17
17
  },
18
18
  "aTs" : { "$ref": "definitions.json#/timestamp" },
19
19
  "cat" : {
@@ -13,7 +13,7 @@
13
13
  "sS" : {
14
14
  "description" : "Suspend status",
15
15
  "type" : "string",
16
- "enum" : [ "suspended", "notSuspended" ]
16
+ "enum" : [ "Suspended", "notSuspended" ]
17
17
  },
18
18
  "aTs" : { "$ref": "definitions.json#/timestamp" },
19
19
  "cat" : {
@@ -13,7 +13,7 @@
13
13
  "sS" : {
14
14
  "description" : "Suspend status",
15
15
  "type" : "string",
16
- "enum" : [ "suspended", "notSuspended" ]
16
+ "enum" : [ "Suspended", "notSuspended" ]
17
17
  },
18
18
  "aTs" : { "$ref": "definitions.json#/timestamp" },
19
19
  "cat" : {
@@ -13,7 +13,7 @@
13
13
  "sS" : {
14
14
  "description" : "Suspend status",
15
15
  "type" : "string",
16
- "enum" : [ "suspended", "notSuspended" ]
16
+ "enum" : [ "Suspended", "notSuspended" ]
17
17
  },
18
18
  "aTs" : { "$ref": "definitions.json#/timestamp" },
19
19
  "cat" : {
@@ -68,9 +68,23 @@
68
68
  ]
69
69
  },
70
70
  "component_id": {
71
- "description" : "Compoment id",
71
+ "description" : "Component ID",
72
72
  "allOf" : [
73
- { "$ref" : "#/rsmp_string" }
73
+ { "$ref" : "#/rsmp_string" },
74
+ { "pattern" : "^[A-Za-z0-9_+=-]+(?:/[A-Za-z0-9_+=-]+)*$" }
75
+ ]
76
+ },
77
+ "component_id_selector": {
78
+ "description" : "Component selector",
79
+ "anyOf" : [
80
+ { "$ref" : "#/component_id" },
81
+ {
82
+ "allOf" : [
83
+ { "$ref" : "#/rsmp_string" },
84
+ { "pattern" : "^[A-Za-z0-9_+=-]+(?:/[A-Za-z0-9_+=-]+)*/$" }
85
+ ]
86
+ },
87
+ { "enum" : [ "/", "", null ] }
74
88
  ]
75
89
  },
76
90
  "component_type": {
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.53.1
4
+ version: 0.53.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin