simbiotes 0.1.5 → 0.1.6

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: 2748f2ee992dd26a149ef03c34b88dc7dc736c17
4
- data.tar.gz: 4901cd16f9c8cb4a1198d46bd65d7447bfc57f10
3
+ metadata.gz: 11ac912cc8133c142cd01724b2226f93ebe60ed8
4
+ data.tar.gz: f8c0895236603f8ed460b391e09f1df1d3115aca
5
5
  SHA512:
6
- metadata.gz: 74162a0926316572c6c2877b0e589feb094b484ef48aa85c9ec0c7b3da4872d3c3f698ea0e6837253c78d7084d0a245f16c5f6578da40b34645a8ea46d7c307f
7
- data.tar.gz: bf8f72b785e6e3443e90240ec5aa77e55b788293553e1c7177d2219a42ae74d4133e4ae5929b2319fcebbcc63be4a9a60d3c45707eda3d9317b0e46449a12e08
6
+ metadata.gz: 15704819f1036cf849fb8a5765b027a7dcbf70f64695270eb1be33102d3eef20036a2ed04153ef0663fa4a8a17ae66e3cc9fb9f06674873b7fcccfed1c23140a
7
+ data.tar.gz: 9667a1f36e352766c7d06b9ab5f6e21a87fcf4420fa653dad2b6e9fb73f1b2042e34c1e6e3976735462710d799aee099601ef4b24e52712e4de5ae9f8cc49890
data/README.md CHANGED
@@ -90,18 +90,44 @@ Next, exit your rails console by typing:
90
90
 
91
91
  The next thing we need to do is establish a communications channel we can use to communicate between our Rails application and the devices in the field. To do this, we use a local server that handles sending communications to the remote devices and handles communications that we will receive from them.
92
92
 
93
- To start it up type:
93
+ To start it up in production:
94
94
 
95
95
  ```bash
96
96
  $ rake comms:start
97
97
  ```
98
98
 
99
- This starts our communications server. If you want to stop the communications server for any reason simply type:
99
+ In development:
100
+
101
+ ```bash
102
+ $ rake dev_comms:start
103
+ ```
104
+
105
+ In test:
106
+
107
+ ```bash
108
+ $ rake test_comms:start
109
+ ```
110
+
111
+ This starts our communications server. If you want to stop the communications server for any reason simply:
112
+
113
+ In production:
100
114
 
101
115
  ```bash
102
116
  $ rake comms:stop
103
117
  ```
104
118
 
119
+ In development:
120
+
121
+ ```bash
122
+ $ rake dev_comms:stop
123
+ ```
124
+
125
+ In test:
126
+
127
+ ```bash
128
+ $ rake test_comms:stop
129
+ ```
130
+
105
131
  Note that you can only communicate with devices if the local communications server is running.
106
132
 
107
133
  ### Creating and uploading scripts.
@@ -10,8 +10,14 @@ module Simbiotes
10
10
  template "script.rb.erb", "lib/scripts/simbiotes/#{parent_file_name}/#{file_name}.rb"
11
11
  end
12
12
  copy_file "server.rb", "lib/scripts/server.rb"
13
+ copy_file "test_server.rb", "lib/scripts/test_server.rb"
14
+ copy_file "dev_server.rb", "lib/scripts/dev_server.rb"
13
15
  copy_file "server_control.rb", "lib/scripts/server_control.rb"
16
+ copy_file "test_server_control.rb", "lib/scripts/test_server_control.rb"
17
+ copy_file "dev_server_control.rb", "lib/scripts/dev_server_control.rb"
14
18
  copy_file "comm_server.rake", "lib/tasks/comm_server.rake"
19
+ copy_file "test_comm_server.rake", "lib/tasks/test_comm_server.rake"
20
+ copy_file "dev_comm_server.rake", "lib/tasks/dev_comm_server.rake"
15
21
  copy_file "publish_script.rake", "lib/tasks/publish_script.rake"
16
22
  FileUtils.chmod 0775, "lib/scripts/server_control.rb"
17
23
  end
@@ -0,0 +1,19 @@
1
+ namespace :dev_comms do
2
+ desc "Start local communication server"
3
+ task start: :environment do
4
+ system("ruby", "#{Rails.root}/lib/scripts/dev_server_control.rb", "start")
5
+ puts $?
6
+ end
7
+
8
+ desc "Stop local communication server"
9
+ task stop: :environment do
10
+ system("ruby", "#{Rails.root}/lib/scripts/dev_server_control.rb", "stop")
11
+ puts $?
12
+ end
13
+
14
+ desc "Restart local communication server"
15
+ task restart: :environment do
16
+ system("ruby", "#{Rails.root}/lib/scripts/dev_server_control.rb", "restart")
17
+ puts $?
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Load Rails
4
+ ENV['RAILS_ENV'] = ARGV[0] || 'development'
5
+ DIR = File.dirname(__FILE__)
6
+ require DIR + '/../../config/environment'
7
+
8
+ Simbiotes::Server.new
@@ -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/dev_server.rb", ontop: false)
@@ -0,0 +1,19 @@
1
+ namespace :test_comms do
2
+ desc "Start local communication server"
3
+ task start: :environment do
4
+ system("ruby", "#{Rails.root}/lib/scripts/dev_server_control.rb", "start")
5
+ puts $?
6
+ end
7
+
8
+ desc "Stop local communication server"
9
+ task stop: :environment do
10
+ system("ruby", "#{Rails.root}/lib/scripts/dev_server_control.rb", "stop")
11
+ puts $?
12
+ end
13
+
14
+ desc "Restart local communication server"
15
+ task restart: :environment do
16
+ system("ruby", "#{Rails.root}/lib/scripts/dev_server_control.rb", "restart")
17
+ puts $?
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Load Rails
4
+ ENV['RAILS_ENV'] = ARGV[0] || 'test'
5
+ DIR = File.dirname(__FILE__)
6
+ require DIR + '/../../config/environment'
7
+
8
+ Simbiotes::Server.new
@@ -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/test_server.rb", ontop: false)
@@ -1,3 +1,3 @@
1
1
  module Simbiotes
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simbiotes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - MicroArx Corporation
@@ -179,10 +179,16 @@ files:
179
179
  - lib/generators/simbiotes/script/USAGE
180
180
  - lib/generators/simbiotes/script/script_generator.rb
181
181
  - lib/generators/simbiotes/script/templates/comm_server.rake
182
+ - lib/generators/simbiotes/script/templates/dev_comm_server.rake
183
+ - lib/generators/simbiotes/script/templates/dev_server.rb
184
+ - lib/generators/simbiotes/script/templates/dev_server_control.rb
182
185
  - lib/generators/simbiotes/script/templates/publish_script.rake
183
186
  - lib/generators/simbiotes/script/templates/script.rb.erb
184
187
  - lib/generators/simbiotes/script/templates/server.rb
185
188
  - lib/generators/simbiotes/script/templates/server_control.rb
189
+ - lib/generators/simbiotes/script/templates/test_comm_server.rake
190
+ - lib/generators/simbiotes/script/templates/test_server.rb
191
+ - lib/generators/simbiotes/script/templates/test_server_control.rb
186
192
  - lib/generators/simbiotes/view/USAGE
187
193
  - lib/generators/simbiotes/view/templates/default.css.erb
188
194
  - lib/generators/simbiotes/view/templates/edit.html.erb