soaring 0.1.12 → 0.1.13
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 +4 -4
- data/lib/soaring/cli.rb +1 -0
- data/lib/soaring/initializer.rb +10 -0
- data/lib/soaring/runner.rb +23 -2
- data/lib/soaring/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 503051fded1b4029754fa4c1b3b1109b3e46a3e4
|
4
|
+
data.tar.gz: 28bafd2427c9d3fa9ae58ac665679d918a1b79f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6a1ee83928c44203a70b029753bdfb8b8db42d19cf13af4c0935976ff348c92668bbc11b763deeb816480e5f89fc91c9e4538db995fdbd6ad0eb5ddddf7dde
|
7
|
+
data.tar.gz: 9522e72b3352a3720af203fc9169dbbd9e86f2fb746a2380a8fe8d0930a0f99205fbd601a43a7916a5ab5188dfda91cbcfae93f655aabb0921ecff6867a8df2c
|
data/lib/soaring/cli.rb
CHANGED
@@ -25,6 +25,7 @@ module Soaring
|
|
25
25
|
option :project_root, :default => Dir.pwd, :desc => 'Root folder of the soar project, defaults to current folder'
|
26
26
|
option :environment, :aliases => '-e', :default => 'development', :desc => 'Environment in which to execute [development,production]'
|
27
27
|
option :port, :aliases => '-p', :default => '9393', :desc => 'Bind service component server to this port for local run, defaults to 9393'
|
28
|
+
option :autorestart, :desc => 'Keep the service running if it was killed externally or due to exit/exception'
|
28
29
|
def start
|
29
30
|
runner = Runner.new(options)
|
30
31
|
runner.run
|
data/lib/soaring/initializer.rb
CHANGED
@@ -19,7 +19,17 @@ module Soaring
|
|
19
19
|
`yes | cp -rf #{temporary_soar_sc_folder}/.ruby-gemset #{@options[:project_root]}`
|
20
20
|
`yes | cp -rf #{temporary_soar_sc_folder}/.ruby-version #{@options[:project_root]}`
|
21
21
|
`yes | cp -rf #{temporary_soar_sc_folder}/.gitignore #{@options[:project_root]}`
|
22
|
+
`yes | cp -rf #{temporary_soar_sc_folder}/.ebextensions #{@options[:project_root]}`
|
23
|
+
`yes | cp -rf #{temporary_soar_sc_folder}/jewels #{@options[:project_root]}`
|
22
24
|
}
|
25
|
+
|
26
|
+
create_symlink_to_public_folder
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_symlink_to_public_folder
|
30
|
+
Dir.chdir(@options[:project_root]) do
|
31
|
+
`ln -s lib/web/public public`
|
32
|
+
end
|
23
33
|
end
|
24
34
|
end
|
25
35
|
end
|
data/lib/soaring/runner.rb
CHANGED
@@ -5,10 +5,31 @@ module Soaring
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def run
|
8
|
+
if @options[:autorestart]
|
9
|
+
run_repeatedly
|
10
|
+
else
|
11
|
+
run_once
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def run_repeatedly
|
18
|
+
while true do
|
19
|
+
$stderr.puts "starting rackup repeatedly with parameters #{compile_rackup_parameters}" if @options[:verbose]
|
20
|
+
response, exit_status = Executor::execute("cd #{@options[:project_root]}; bundle exec rackup #{compile_rackup_parameters}")
|
21
|
+
sleep(0.5)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def run_once
|
26
|
+
$stderr.puts "starting rackup once with parameters #{compile_rackup_parameters}" if @options[:verbose]
|
27
|
+
exec("cd #{@options[:project_root]}; bundle exec rackup #{compile_rackup_parameters}")
|
28
|
+
end
|
29
|
+
|
30
|
+
def compile_rackup_parameters
|
8
31
|
bind_address = '0.0.0.0'
|
9
32
|
rackup_parameters = "-E #{@options[:environment]} ./config.ru -p #{@options[:port]} --host #{bind_address}"
|
10
|
-
puts "starting rackup with parameters #{rackup_parameters}" if @options[:verbose]
|
11
|
-
exec("bundle exec rackup #{rackup_parameters}")
|
12
33
|
end
|
13
34
|
|
14
35
|
end
|
data/lib/soaring/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barney de Villiers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|