apiotics 0.1.129 → 0.1.130
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apiotics/configuration.rb +2 -1
- data/lib/apiotics/version.rb +1 -1
- data/lib/generators/apiotics/initializer/templates/apiotics.rb.erb +2 -1
- data/lib/generators/apiotics/script/script_generator.rb +2 -0
- data/lib/generators/apiotics/script/templates/comm_server.rake +15 -3
- data/lib/generators/apiotics/script/templates/heroku_server_control.rb +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b2d40e87c4aa2c5deed564677709545f5b560a0
|
4
|
+
data.tar.gz: 35db52f3cd33e69e04454b0599baf43784a7a8fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 221aac3e9249c432391a4ebc3fdd8504212afb80c59a38f248e55ef98633927a8ae878f6a275bbe05c813da43b2e4169af8075da452a7848155627641ca5013f
|
7
|
+
data.tar.gz: 63b0e5fa65a95f93444d10ebe7a48368171da531d4141f136f3ef866b9484590f366cf39c95b9a631c9eb5d08a5c9fc25603ad8bd05ee8297e340118b6a5d458
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Apiotics
|
2
2
|
class Configuration
|
3
3
|
|
4
|
-
attr_accessor :public_key, :private_key, :local_logging, :targets, :local_port, :server, :server_port, :portal, :push, :tls, :verify_peer, :handshake, :parents, :reduced_metadata, :redis_comms_connection, :interface_kinds, :max_missed_heartbeats, :heartbeat_interval, :create_heartbeat_error
|
4
|
+
attr_accessor :public_key, :private_key, :local_logging, :targets, :local_port, :server, :server_port, :portal, :push, :tls, :verify_peer, :handshake, :parents, :reduced_metadata, :redis_comms_connection, :interface_kinds, :max_missed_heartbeats, :heartbeat_interval, :heroku, :create_heartbeat_error
|
5
5
|
|
6
6
|
def initialize
|
7
7
|
@public_key = nil
|
@@ -22,6 +22,7 @@ module Apiotics
|
|
22
22
|
@max_missed_heartbeats = 3
|
23
23
|
@heartbeat_interval = 5
|
24
24
|
@create_heartbeat_error = false
|
25
|
+
@heroku = false
|
25
26
|
@interface_kinds = {
|
26
27
|
"string" => "string",
|
27
28
|
"text" => "string",
|
data/lib/apiotics/version.rb
CHANGED
@@ -7,8 +7,9 @@ Apiotics.configure do |config|
|
|
7
7
|
config.local_port = 8001
|
8
8
|
|
9
9
|
# If you are deploying to a hosting service like Heroku, which does not easily permit local TCP connections, turn the redis comms connection
|
10
|
-
# on,
|
10
|
+
# on, configure a Redis server to permit connections between your application and your local comms server, and set the heroku variable to true
|
11
11
|
config.redis_comms_connection = false
|
12
|
+
config.heroku = false
|
12
13
|
|
13
14
|
# The remote port at Apiotics to initially connect to. There should be very few reasons to change this.
|
14
15
|
config.server_port = 8000
|
@@ -13,6 +13,7 @@ module Apiotics
|
|
13
13
|
copy_file "test_server.rb", "lib/scripts/test_server.rb"
|
14
14
|
copy_file "dev_server.rb", "lib/scripts/dev_server.rb"
|
15
15
|
copy_file "server_control.rb", "lib/scripts/server_control.rb"
|
16
|
+
copy_file "heroku_server_control.rb", "lib/scripts/heroku_server_control.rb"
|
16
17
|
copy_file "test_server_control.rb", "lib/scripts/test_server_control.rb"
|
17
18
|
copy_file "dev_server_control.rb", "lib/scripts/dev_server_control.rb"
|
18
19
|
copy_file "comm_server.rake", "lib/tasks/comm_server.rake"
|
@@ -21,6 +22,7 @@ module Apiotics
|
|
21
22
|
copy_file "publish_script.rake", "lib/tasks/publish_script.rake"
|
22
23
|
copy_file "install_firmware.rake", "lib/tasks/install_firmware.rake"
|
23
24
|
FileUtils.chmod 0775, "lib/scripts/server_control.rb"
|
25
|
+
FileUtils.chmod 0775, "lib/scripts/heroku_server_control.rb"
|
24
26
|
end
|
25
27
|
|
26
28
|
private
|
@@ -1,19 +1,31 @@
|
|
1
1
|
namespace :comms do
|
2
2
|
desc "Start local communication server"
|
3
3
|
task start: :environment do
|
4
|
-
|
4
|
+
if Apiotics.configuration.heroku == true
|
5
|
+
system("ruby", "#{Rails.root}/lib/scripts/heroku_server_control.rb", "start")
|
6
|
+
else
|
7
|
+
system("ruby", "#{Rails.root}/lib/scripts/server_control.rb", "start")
|
8
|
+
end
|
5
9
|
puts $?
|
6
10
|
end
|
7
11
|
|
8
12
|
desc "Stop local communication server"
|
9
13
|
task stop: :environment do
|
10
|
-
|
14
|
+
if Apiotics.configuration.heroku == true
|
15
|
+
system("ruby", "#{Rails.root}/lib/scripts/heroku_server_control.rb", "stop")
|
16
|
+
else
|
17
|
+
system("ruby", "#{Rails.root}/lib/scripts/server_control.rb", "stop")
|
18
|
+
end
|
11
19
|
puts $?
|
12
20
|
end
|
13
21
|
|
14
22
|
desc "Restart local communication server"
|
15
23
|
task restart: :environment do
|
16
|
-
|
24
|
+
if Apiotics.configuration.heroku == true
|
25
|
+
system("ruby", "#{Rails.root}/lib/scripts/heroku_server_control.rb", "restart")
|
26
|
+
else
|
27
|
+
system("ruby", "#{Rails.root}/lib/scripts/server_control.rb", "restart")
|
28
|
+
end
|
17
29
|
puts $?
|
18
30
|
end
|
19
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apiotics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.130
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MicroArx Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- lib/generators/apiotics/script/templates/dev_comm_server.rake
|
215
215
|
- lib/generators/apiotics/script/templates/dev_server.rb
|
216
216
|
- lib/generators/apiotics/script/templates/dev_server_control.rb
|
217
|
+
- lib/generators/apiotics/script/templates/heroku_server_control.rb
|
217
218
|
- lib/generators/apiotics/script/templates/install_firmware.rake
|
218
219
|
- lib/generators/apiotics/script/templates/publish_script.rake
|
219
220
|
- lib/generators/apiotics/script/templates/script.rb.erb
|