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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c378c288cbf257e1d42b6ef60317e5792a8d038
4
- data.tar.gz: 87db512db1f61b939cbd5fd3c7d82a3a75a18afc
3
+ metadata.gz: 9b2d40e87c4aa2c5deed564677709545f5b560a0
4
+ data.tar.gz: 35db52f3cd33e69e04454b0599baf43784a7a8fd
5
5
  SHA512:
6
- metadata.gz: fa8ee42109d3b57bffac13ec614c78910513b0a34b3b1390218a463054d99611b3f4b17e246eb5a3cf3517f3ad8c332fd69e51f7e0389484041dead776f0a5ee
7
- data.tar.gz: e1aff58103d1e9439cc27e27d10fb90dc953b0abe4d645e86ec43086e315a324e999dbd4f09e5b134df3bd94d4dc2ad4c651aa8a0b4449166d78967c47c77274
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",
@@ -1,3 +1,3 @@
1
1
  module Apiotics
2
- VERSION = '0.1.129'
2
+ VERSION = '0.1.130'
3
3
  end
@@ -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, and configure a Redis server to permit connections between your application and your local comms server
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
- system("ruby", "#{Rails.root}/lib/scripts/server_control.rb", "start")
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
- system("ruby", "#{Rails.root}/lib/scripts/server_control.rb", "stop")
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
- system("ruby", "#{Rails.root}/lib/scripts/server_control.rb", "restart")
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
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # add the ontop: true option to see the output of the server in the console in which you run rake comms:start
4
+
5
+ require 'daemons'
6
+
7
+ Daemons.run('lib/scripts/server.rb', ontop: true, no_pidfiles: true)
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.129
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-21 00:00:00.000000000 Z
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