rsmp 0.53.1 → 0.53.2

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: c18e33005250515e950be688be2ed3d0070c379724885ca10268846a85d0b5d7
4
+ data.tar.gz: e9b7ab8838542eb7d0ece090c3944614dbbcd2d6b83c27e15de9a510bbd60856
5
5
  SHA512:
6
- metadata.gz: e66c0016019dff11724b0989dd3da9d319aa8a24ce8ad3b326068bd03abe73580d212c15023470378cc21690b92cb298666fde785195b1267e28a3b4fe5cbdbd
7
- data.tar.gz: ccd8d17f4eef01bf389f7b17851ffc321b3d64bf2b562e06700809e693065f9b71bac39bc50fb6630a896d1e7fb1ea60a59e7fc6f0182e1cef36e9bb41582310
6
+ metadata.gz: 0cf38acb9093a3939e55d6b21d54ec37459b5950793105ea23a5c8a6633b24e9fb5a2cc53293fa7dc5f1580aa1eb8e412b5fcb987ad6080d6c4a4358a1a9ce13
7
+ data.tar.gz: 533839b68ef17834741085c7d0e7d1d023f7d997b335608e5f00365c45ba6e28af13d9deab55b1062f58f2f9f323aa1f0a463de09a34febac6ff32c909c18b1c
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.2)
5
5
  async (~> 2.45)
6
6
  colorize (~> 1.1)
7
7
  io-endpoint (~> 0.17)
@@ -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
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = '0.53.1'.freeze
2
+ VERSION = '0.53.2'.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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin