apiotics-test 0.1.55 → 0.1.65
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37d4c27684825fa654595d9bba61cdef11ab706f
|
4
|
+
data.tar.gz: e061cd820ff791170d416237a5cffb3000b6f30f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b6c2a96edc5a02ec5c2a79c28edf8b13e60f625fdf6c6e015d4315eab23731576ff620ae9480df920e6fadd458459d0ae94fd92bf8e78f7fdfe3a0be1e3f576
|
7
|
+
data.tar.gz: 549b450770a37dbe8fb6d215ad59801e96d1245d030c38591a2ef53ca27be6b107c0cfc5e9bfa0eb7c963d11ec0f57b97e3102891a69e5db84c64b9a93a893cf
|
data/lib/apiotics/extract.rb
CHANGED
@@ -14,23 +14,25 @@ module Apiotics
|
|
14
14
|
end
|
15
15
|
if interfaces != {}
|
16
16
|
Extract.fire(object, interfaces, "set-request")
|
17
|
-
if Apiotics.configuration.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
17
|
+
if Apiotics.configuration.portal == "https://test.apiotics.com" #not a permanent solution.
|
18
|
+
if Apiotics.configuration.parents != {}
|
19
|
+
interfaces.each do |k,v|
|
20
|
+
if Apiotics.configuration.parents[object.class.parent.name][object.class.name.demodulize][k.to_s] != nil
|
21
|
+
m = "#{object.class.parent}".underscore.gsub(" ","_").downcase
|
22
|
+
target_class = Apiotics.configuration.parents[object.class.parent.name][object.class.name.demodulize][k.to_s]["driver"].downcase.constantize
|
23
|
+
target = object.m.target_class
|
24
|
+
i = Apiotics.configuration.parents[object.class.parent.name][object.class.name.demodulize][k.to_s]["interface"].downcase.constantize
|
25
|
+
if Apiotics.configuration.parents[object.class.parent.name][object.class.name.demodulize][k.to_s].keys < 3
|
26
|
+
target.i = v
|
27
|
+
target.skip_extract = true
|
28
|
+
target.save
|
29
|
+
target.skip_extract = false
|
30
|
+
else
|
31
|
+
target.i = Apiotics.configuration.parents[object.class.parent.name][object.class.name.demodulize][k.to_s][v.to_s]
|
32
|
+
target.skip_extract = true
|
33
|
+
target.save
|
34
|
+
target.skip_extract = false
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
36
38
|
end
|
@@ -39,7 +41,7 @@ module Apiotics
|
|
39
41
|
end
|
40
42
|
|
41
43
|
def self.is_target(object, k)
|
42
|
-
if Apiotics.configuration.targets[object.class.parent.
|
44
|
+
if Apiotics.configuration.targets[object.class.parent.name][object.class.name.demodulize.to_s].include?(k) || Apiotics.configuration.targets[object.class.parent.name][object.class.name.demodulize.to_s].include?(k.titleize)
|
43
45
|
return true
|
44
46
|
else
|
45
47
|
return false
|
@@ -58,9 +60,9 @@ module Apiotics
|
|
58
60
|
end
|
59
61
|
|
60
62
|
def self.fire(object, interfaces, a, time0= nil, time1= nil)
|
61
|
-
if Apiotics.configuration.targets[object.class.parent.
|
62
|
-
k = "#{object.class.parent}::#{object.class.parent}".constantize
|
63
|
-
i = "#{object.class.parent}".
|
63
|
+
if Apiotics.configuration.targets[object.class.parent.name] != nil
|
64
|
+
k = "#{object.class.parent.name}::#{object.class.parent.name}".constantize
|
65
|
+
i = "#{object.class.parent.name}".underscore.gsub(" ","_").downcase + "_id"
|
64
66
|
msg = {
|
65
67
|
"action" => a,
|
66
68
|
"instance" => k.find(object.send(i)).apiotics_instance,
|
data/lib/apiotics/version.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
module <%= module_name %>
|
2
2
|
class <%= module_name %> < ApplicationRecord
|
3
|
-
<% @targets
|
4
|
-
|
5
|
-
|
3
|
+
<% unless @targets == nil %>
|
4
|
+
<% unless @targets[module_name] == nil %>
|
5
|
+
<% @targets[module_name].keys.each do |key| %>
|
6
|
+
has_one :<%= key.underscore.downcase.gsub(" ", "_")%>, dependent: :destroy
|
7
|
+
accepts_nested_attributes_for :<%= key.underscore.downcase.gsub(" ", "_")%>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
6
10
|
<% end %>
|
7
11
|
end
|
8
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apiotics-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.65
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MicroArx Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
249
|
version: '0'
|
250
250
|
requirements: []
|
251
251
|
rubyforge_project:
|
252
|
-
rubygems_version: 2.
|
252
|
+
rubygems_version: 2.2.2
|
253
253
|
signing_key:
|
254
254
|
specification_version: 4
|
255
255
|
summary: IoT For Everybody.
|