apiotics-test 0.1.55 → 0.1.65

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: 2552aee48f14663b8d29ec7d69ce89fa92cd145c
4
- data.tar.gz: 0c05d01e3fcb4c364e6975ef23b900a82a6bf9ac
3
+ metadata.gz: 37d4c27684825fa654595d9bba61cdef11ab706f
4
+ data.tar.gz: e061cd820ff791170d416237a5cffb3000b6f30f
5
5
  SHA512:
6
- metadata.gz: 494bb1ee372a5707714235de66b6535861b742e8a1ec94149318eff5113575d21e5fe637b8adb8a141c063b5bf6ddaaccca2ab24522eb16cf36400b0a9497a7e
7
- data.tar.gz: f061856f5a2397a72b6fe096da2ae6b7ac04dbeff477f2764d4c95437526afb88ca878c3693fa59d19f1d3695d3b9c749454b785d5395c2780756a886eb53deb
6
+ metadata.gz: 8b6c2a96edc5a02ec5c2a79c28edf8b13e60f625fdf6c6e015d4315eab23731576ff620ae9480df920e6fadd458459d0ae94fd92bf8e78f7fdfe3a0be1e3f576
7
+ data.tar.gz: 549b450770a37dbe8fb6d215ad59801e96d1245d030c38591a2ef53ca27be6b107c0cfc5e9bfa0eb7c963d11ec0f57b97e3102891a69e5db84c64b9a93a893cf
@@ -6,7 +6,7 @@ module Apiotics
6
6
  def initialize
7
7
  @public_key = nil
8
8
  @private_key = nil
9
- @local_logging = true
9
+ @local_logging = false
10
10
  @targets = nil
11
11
  @local_port = 8001
12
12
  @server = "rgs.microarx.com"
@@ -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.parents != {}
18
- interfaces.each do |k,v|
19
- if Apiotics.configuration.parents[object.class.parent.demodulize][object.class.demodulize][k] != nil
20
- m = "#{object.class.parent}".demodulize.underscore.gsub(" ","_").downcase
21
- target_class = Apiotics.configuration.parents[object.class.parent.demodulize][object.class.demodulize][k]["driver"].downcase.constantize
22
- target = object.m.target_class
23
- i = Apiotics.configuration.parents[object.class.parent.demodulize][object.class.demodulize][k]["interface"].downcase.constantize
24
- if Apiotics.configuration.parents[object.class.parent.demodulize][object.class.demodulize][k].keys < 3
25
- target.i = v
26
- target.skip_extract = true
27
- target.save
28
- target.skip_extract = false
29
- else
30
- target.i = Apiotics.configuration.parents[object.class.parent.demodulize][object.class.demodulize][k][v]
31
- target.skip_extract = true
32
- target.save
33
- target.skip_extract = false
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.to_s][object.class.name.demodulize.to_s].include?(k) || Apiotics.configuration.targets[object.class.parent.to_s][object.class.name.demodulize.to_s].include?(k.titleize)
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.to_s] != nil
62
- k = "#{object.class.parent}::#{object.class.parent}".constantize
63
- i = "#{object.class.parent}".demodulize.underscore.gsub(" ","_").downcase + "_id"
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,
@@ -1,3 +1,3 @@
1
1
  module Apiotics
2
- VERSION = '0.1.55'
2
+ VERSION = '0.1.65'
3
3
  end
@@ -1,8 +1,12 @@
1
1
  module <%= module_name %>
2
2
  class <%= module_name %> < ApplicationRecord
3
- <% @targets[module_name].keys.each do |key| %>
4
- has_one :<%= key.underscore.downcase.gsub(" ", "_")%>, dependent: :destroy
5
- accepts_nested_attributes_for :<%= key.underscore.downcase.gsub(" ", "_")%>
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.55
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-04 00:00:00.000000000 Z
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.6.10
252
+ rubygems_version: 2.2.2
253
253
  signing_key:
254
254
  specification_version: 4
255
255
  summary: IoT For Everybody.