unicorn-rails 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unicorn_rails.rb +9 -2
- data/lib/unicorn_rails/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: be441611f4be3c457fe383d9a7eb7e79b3e75b14
|
4
|
+
data.tar.gz: 001b9519af7d23c92df2e6f1cf8a1757f22d7a2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06b6612a02a1138f530174de67981c0bfe07fa313129f6f9b1ed8330209fdb1688ef00051e72e9611beb35bc4a39a511e31b24f4347e34603872f7d42fa64ef6
|
7
|
+
data.tar.gz: b784f16e273d614da9eb76ab70f3e2252322fd53e9e4f747c225021934a38da060483d633eae2b4cafd4866bafb03ed6ee42897f3b46146218da7feb73ff18d6
|
data/lib/unicorn_rails.rb
CHANGED
@@ -10,18 +10,25 @@ module Rack
|
|
10
10
|
class Unicorn
|
11
11
|
class << self
|
12
12
|
def run(app, options = {})
|
13
|
-
unicorn_options = {
|
13
|
+
unicorn_options = {
|
14
|
+
:listeners => ["#{options[:Host]}:#{options[:Port]}"]
|
15
|
+
}
|
14
16
|
|
15
17
|
if ::File.exist?("config/unicorn/#{environment}.rb")
|
16
18
|
unicorn_options[:config_file] = "config/unicorn/#{environment}.rb"
|
17
19
|
elsif ::File.exist?("config/unicorn.rb")
|
18
20
|
unicorn_options[:config_file] = "config/unicorn.rb"
|
19
21
|
else
|
20
|
-
unicorn_options[:listeners] = ["#{options[:Host]}:#{options[:Port]}"]
|
21
22
|
unicorn_options[:timeout] = 31 * 24 * 60 * 60
|
22
23
|
unicorn_options[:worker_processes] = (ENV["UNICORN_WORKERS"] || "1").to_i
|
23
24
|
end
|
24
25
|
|
26
|
+
if unicorn_options[:config_file]
|
27
|
+
if ::File.read(unicorn_options[:config_file]) =~ /^(\s+)listen\s/
|
28
|
+
unicorn_options.delete(:listeners)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
25
32
|
::Unicorn::Launcher.daemonize!(unicorn_options) if options[:daemonize]
|
26
33
|
::Unicorn::HttpServer.new(app, unicorn_options).start.join
|
27
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Kadolph
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|