apiotics 0.1.67 → 0.1.68

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
  SHA1:
3
- metadata.gz: 7f8c5fa9974f62bba22d59db4a67b8e6f47c291f
4
- data.tar.gz: 69f53443382647702eb2e5e48f30e2fb0bfe1c02
3
+ metadata.gz: b473a8358e708bfb40ab3b936f13b5cc570187bb
4
+ data.tar.gz: 2dfd0a46fde8496e8d25f4cca997033ae33b79df
5
5
  SHA512:
6
- metadata.gz: 561b033c281d963c11aba4dd628cbd4c12be7cb5d27f517c5ba4d4b9a94dd58c848c952eeb6086cd7e2560eafbcdbc10f7e318cebf383dca2eefa7fd81f67b5d
7
- data.tar.gz: efe63dfb647b4e83012afc6857f262c9a97fc407510672cc112e067a6fd06627809a27579531a1918b5ea51584c51aafc5bb62716f7cb41874a54a28b823aa18
6
+ metadata.gz: 08ced548439143220604f11e197cb064e07e1759478275a6f31fa21a6729561be18e9f8adae3b35a92e129d1ba8cdee32456a35ab9975869fc04d3e6c5d218e2
7
+ data.tar.gz: cc9acdee24064f6279be224d208e4349ea15f6934d5dc24fcca1ae33bc9366fd47397dbc9b9b8389b9896ed3985f0ac2ffe3e22f7f4abd03efb096dae9fe2ed9
@@ -12,43 +12,47 @@ module Apiotics
12
12
 
13
13
  def self.parse_drivers_and_scripts(hash, parent_name, model_name)
14
14
  attributes_hash = nil
15
- hash["workers"][parent_name]["drivers"].each do |k,v|
16
- name = v["metadata"]["common name"].classify
17
- if name == model_name.classify
18
- attributes_hash = Hash.new
19
- attributes_hash[:kind] = "driver"
20
- attributes_hash[:attributes] = Hash.new
21
- v["interfaces"].each do |k,v|
22
- attributes_hash[:attributes][k] = {
23
- type: v["type"],
24
- accessor: v["accessor type"],
25
- units: v["units"],
26
- noise: v["noise threshold"],
27
- values: v["values"],
28
- range: v["range"]
29
- }
30
- end
31
- end
15
+ if hash["workers"][parent_name]["drivers"] != nil
16
+ hash["workers"][parent_name]["drivers"].each do |k,v|
17
+ name = v["metadata"]["common name"].classify
18
+ if name == model_name.classify
19
+ attributes_hash = Hash.new
20
+ attributes_hash[:kind] = "driver"
21
+ attributes_hash[:attributes] = Hash.new
22
+ v["interfaces"].each do |k,v|
23
+ attributes_hash[:attributes][k] = {
24
+ type: v["type"],
25
+ accessor: v["accessor type"],
26
+ units: v["units"],
27
+ noise: v["noise threshold"],
28
+ values: v["values"],
29
+ range: v["range"]
30
+ }
31
+ end
32
+ end
33
+ end
32
34
  end
33
- hash["workers"][parent_name]["scripts"].each do |k,v|
34
- name = v["metadata"]["common name"].classify
35
- if name == model_name.classify
36
- attributes_hash = Hash.new
37
- attributes_hash[:kind] = "script"
38
- attributes_hash[:attributes] = Hash.new
39
- v["interfaces"].each do |key,value|
40
- attributes_hash[:attributes][key] = {
41
- type: value["type"],
42
- accessor: value["accessor type"],
43
- units: value["units"],
44
- noise: value["noise threshold"],
45
- values: value["values"],
46
- range: value["range"]
47
- }
48
- end
49
- attributes_hash[:inputs] = Hash.new
50
- v["inputs"].each do |key,value|
51
- attributes_hash[:inputs][key] = value
35
+ if hash["workers"][parent_name]["scripts"] != nil
36
+ hash["workers"][parent_name]["scripts"].each do |k,v|
37
+ name = v["metadata"]["common name"].classify
38
+ if name == model_name.classify
39
+ attributes_hash = Hash.new
40
+ attributes_hash[:kind] = "script"
41
+ attributes_hash[:attributes] = Hash.new
42
+ v["interfaces"].each do |key,value|
43
+ attributes_hash[:attributes][key] = {
44
+ type: value["type"],
45
+ accessor: value["accessor type"],
46
+ units: value["units"],
47
+ noise: value["noise threshold"],
48
+ values: value["values"],
49
+ range: value["range"]
50
+ }
51
+ end
52
+ attributes_hash[:inputs] = Hash.new
53
+ v["inputs"].each do |key,value|
54
+ attributes_hash[:inputs][key] = value
55
+ end
52
56
  end
53
57
  end
54
58
  end
@@ -1,3 +1,3 @@
1
1
  module Apiotics
2
- VERSION = '0.1.67'
2
+ VERSION = '0.1.68'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiotics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.67
4
+ version: 0.1.68
5
5
  platform: ruby
6
6
  authors:
7
7
  - MicroArx Corporation