server-starter 0.1.4 → 0.1.5

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: f33629e940e4557cc6d5847438d0cf62d2818335
4
- data.tar.gz: 143bf7f144423f6c9d30dfdfabe5a65ab1b38349
3
+ metadata.gz: 68c36a989a31dbedc64dbf0151ae27ba31b62423
4
+ data.tar.gz: 4cf2050173783280a3c4a0f649af09badb8715b6
5
5
  SHA512:
6
- metadata.gz: 51007aded32b09936333af26fb87de6942dd93504dce01302b5c9f253c8dd4d56b6fc7e853bed16ac7fb696bb8f3cc67f1027bc0b1abf5745cb52aa1979cec91
7
- data.tar.gz: e50558d8b5a45b34720c79307579dbcde0a909a82367a380e9682f46a25b7aa25636d143d9bad82cd6fd1ed915011897c526a99a07bf86fc1a5bdc463b5161af
6
+ metadata.gz: 4f40f2dfcb2b27c656948cabd4971dfec25ecc190fbce8373c0483736bac0c19396be8afa46e19657cca01f8bedb5bca67ff7587933c006ab382fe1123dc236a
7
+ data.tar.gz: b5e563e113f13c990aefae3a29caa4d638a289d44ed3fc94d284c2da9c56645a87fac77de13f3c16501b7675eb3233490e274ffafb67edd216a6287a642579d0
data/.gitignore CHANGED
@@ -13,6 +13,6 @@ coverage
13
13
  .ruby-version
14
14
  pkg/*
15
15
  .tags
16
- unicorn.stat
16
+ start_server.stat
17
17
  start_server.pid
18
18
  start_server.log
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.5 (2016/04/03)
2
+
3
+ Fixes:
4
+
5
+ * Remove Timeout.timeout warning
6
+
1
7
  ## 0.1.4 (2015/04/06)
2
8
 
3
9
  Fixes:
data/README.md CHANGED
@@ -24,8 +24,8 @@ Following is an example to run unicorn server under ```Server::Starter```.
24
24
  The command line example:
25
25
 
26
26
  ```
27
- bundle exec start_server.rb --status-file=/path/to/app/log/unicorn.stat \
28
- --port=10080 --signal-on-hup=CONT --dir=/path/to/app -- \
27
+ bundle exec start_server.rb --port=10080 --signal-on-hup=CONT --dir=/path/to/app \
28
+ --status-file=/path/to/app/log/start_server.stat --pid-file=/path/to/app/log/start_server.pid -- \
29
29
  bundle exec --keep-file-descriptors unicorn -c config/unicorn.conf.rb config.ru
30
30
  ```
31
31
 
@@ -39,7 +39,7 @@ worker_processes 2
39
39
  preload_app true
40
40
 
41
41
  APP_ROOT = File.expand_path('../..', __FILE__)
42
- status_file = File.join(APP_ROOT, 'log/unicorn.stat')
42
+ status_file = File.join(APP_ROOT, 'log/start_server.stat')
43
43
 
44
44
  fd = listener.listen
45
45
  unless fd
@@ -5,7 +5,7 @@ worker_processes 2
5
5
  preload_app true
6
6
 
7
7
  APP_ROOT = File.expand_path('../..', __FILE__)
8
- status_file = File.join(APP_ROOT, 'log/unicorn.stat')
8
+ status_file = File.join(APP_ROOT, 'log/start_server.stat')
9
9
 
10
10
  fd = listener.listen
11
11
  unless fd
@@ -1,2 +1,2 @@
1
1
  #!/bin/sh
2
- bundle exec start_server.rb --restart --pid-file=log/start_server.pid --status-file=log/unicorn.stat
2
+ bundle exec start_server.rb --restart --pid-file=log/start_server.pid --status-file=log/start_server.stat
data/example/start_server CHANGED
@@ -6,7 +6,7 @@ bundle exec start_server.rb \
6
6
  --signal-on-hup=CONT \
7
7
  --signal-on-TERM=TERM \
8
8
  --pid-file=$(pwd)/log/start_server.pid \
9
- --status-file=$(pwd)/log/unicorn.stat \
9
+ --status-file=$(pwd)/log/start_server.stat \
10
10
  --envdir=env \
11
11
  --enable-auto-restart \
12
12
  --auto-restart-interval=100 \
@@ -27,10 +27,17 @@ class Server
27
27
  ENV.update(orig_env)
28
28
  end
29
29
 
30
+ # A small tweaked version of Bundler.with_clean_env
31
+ #
32
+ # Bundler has Bundler.with_clean_env by its own, but the method
33
+ # replace ENV with ENV captured on starting.
34
+ # cf. https://github.com/bundler/bundler/blob/e8c962ef2a3215cdc6fd411b6724f091a16793d6/lib/bundler.rb#L230
35
+ # Server::Starter changes ENV during running to communicate
36
+ # with child processes, so we need to keep the changed ENV.
37
+ # This is why I needed this small tweaked version
30
38
  def bundler_with_clean_env(&block)
31
39
  if defined?(Bundler)
32
40
  begin
33
- # Bundler.with_clean_env resets ENV to initial env on loading ruby
34
41
  orig_env = ENV.to_hash
35
42
  ENV.delete_if { |k,_| k[0,7] == 'BUNDLE_' }
36
43
  if ENV.has_key? 'RUBYOPT'
@@ -1,5 +1,5 @@
1
1
  class Server
2
2
  class Starter
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
5
5
  end
@@ -213,7 +213,7 @@ class Server::Starter
213
213
  @signal_wait_thread = Thread.start do
214
214
  if flags != 0 && ENV['ENABLE_AUTO_RESTART']
215
215
  begin
216
- timeout(1) do
216
+ Timeout.timeout(1) do
217
217
  pid = Process.waitpid(-1, flags)
218
218
  r = [pid, $?.exitstatus] if pid
219
219
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server-starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-06 00:00:00.000000000 Z
11
+ date: 2016-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  requirements: []
73
73
  rubyforge_project:
74
- rubygems_version: 2.2.2
74
+ rubygems_version: 2.5.1
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: a superdaemon for hot-deploying server programs (ruby port of p5-Server-Starter)