soaring 0.1.12 → 0.1.13

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: a7e57cbfb088ad00f9579dc731f5c225b163c206
4
- data.tar.gz: 9643299e22f6ae3c695fa25256b6b1f4e297b592
3
+ metadata.gz: 503051fded1b4029754fa4c1b3b1109b3e46a3e4
4
+ data.tar.gz: 28bafd2427c9d3fa9ae58ac665679d918a1b79f6
5
5
  SHA512:
6
- metadata.gz: a40b83e786e752acf7c0a5fbe9e44c91d0c64fca67e3240104324fc233e669194d018f9a24b77d81d1bef4816eee34d5f425738036fc13449cddc0985617ec11
7
- data.tar.gz: 737a813d0ef755cd77c385056c032d9151ae20110db1681bbe245dbc93cc7ce803273aed98c7200d865980af20ed32ddb011b0f797b57fea529ba3fe1f320342
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
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Soaring
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
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.12
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-21 00:00:00.000000000 Z
11
+ date: 2016-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler