rsmp_schema 0.2.2 → 0.2.3

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: 8c5718eb96e00289525b0997cc296fcc93b029966d40c80a544d7b075d4c870b
4
- data.tar.gz: c64cabf0d6cf081bd1434401eb9794691ac126dcf2fe64316ddbfe3fbef31f5e
3
+ metadata.gz: e82b6ea883b37ce64d134d66ba9980891dd9ecf8f1f7fc12df75df212b77d7a1
4
+ data.tar.gz: 242013a26a727cb7ec5281c3e3d60f68e2799999238503ad2701e209fb7112ec
5
5
  SHA512:
6
- metadata.gz: 454414a51cf1e8ffa4f978a997ca702726058d82a0e1e0e6645fc74122e945d42584b38926a97a464ecbb591ec3afaf23e85a4639f704815abf431895c3e2f52
7
- data.tar.gz: a48f7a8aa43283cd5448376c7f26f7c060d10fda7caf7e95f1b0f6e54c81432af867a9cbfa25ff6cb7608d1868e04fa1c9b6b5677e7550358e11073b18539634
6
+ metadata.gz: '046758412e06b7b8ddea3ecb050cd0d0d32d55f901f85b74a2cd1032def20417d7dacdeea9710234730ef2b03b6e29152f230be6ac6eda295154beeaa925b2a5'
7
+ data.tar.gz: f27d0648c9023b301caca1a5d311ef02577afe6c8adf54ca07c2ba3dc3b8f71b114dd451a7464e61a93be5d560b6b4a2e07b2c02df15392a60fa6a4d2c777b54
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp_schema (0.2.2)
4
+ rsmp_schema (0.2.3)
5
5
  json_schemer (~> 0.2.21)
6
6
  thor (~> 1.2.1)
7
7
 
@@ -108,13 +108,19 @@ module RSMP
108
108
  # convert yaml values to jsons schema enum
109
109
  def self.handle_enum item, out
110
110
  if item["values"]
111
- case item["values"]
111
+ out["enum"] = case item["values"]
112
112
  when Hash
113
- out["enum"] = item["values"].keys.sort
113
+ item["values"].keys.sort
114
114
  when Array
115
- out["enum"] = item["values"].sort
115
+ item["values"].sort
116
116
  else
117
- raise "Error: Values must be specified as either a Hash or an Array"
117
+ raise "Error: Values must be specified as either a Hash or an Array, got #{item["values"].class}"
118
+ end.map do |v|
119
+ if v.is_a?(Integer) || v.is_a?(Float)
120
+ v.to_s
121
+ else
122
+ v
123
+ end
118
124
  end
119
125
  end
120
126
  end
@@ -1,5 +1,5 @@
1
1
  module RSMP
2
2
  module Schema
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
@@ -26,11 +26,10 @@
26
26
  "s" : {
27
27
  "allOf" : [
28
28
  {
29
- "description" : "0: Nobody logged in \n1: Operator logged in at level 1 (read only) \n2: Operator logged in at level 2 (read/write)",
30
29
  "enum" : [
31
- 0,
32
- 1,
33
- 2
30
+ "0",
31
+ "1",
32
+ "2"
34
33
  ]
35
34
  },
36
35
  {
@@ -26,11 +26,10 @@
26
26
  "s" : {
27
27
  "allOf" : [
28
28
  {
29
- "description" : "0: Nobody logged in \n1: Operator logged in at level 1 (read only) \n2: Operator logged in at level 2 (read/write)",
30
29
  "enum" : [
31
- 0,
32
- 1,
33
- 2
30
+ "0",
31
+ "1",
32
+ "2"
34
33
  ]
35
34
  },
36
35
  {
@@ -781,8 +781,7 @@ objects:
781
781
  arguments:
782
782
  user:
783
783
  type: integer
784
- values: [0,1,2]
785
- description: |-
784
+ values:
786
785
  0: Nobody logged in
787
786
  1: Operator logged in at level 1 (read only)
788
787
  2: Operator logged in at level 2 (read/write)
@@ -793,8 +792,7 @@ objects:
793
792
  arguments:
794
793
  user:
795
794
  type: integer
796
- values: [0,1,2]
797
- description: |-
795
+ values:
798
796
  0: Nobody logged in
799
797
  1: Operator logged in at level 1 (read only)
800
798
  2: Operator logged in at level 2 (read/write)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin