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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1e2d67195fb3e46f8376736a2b745ead885b1ff
4
- data.tar.gz: 548b9cfac1b06c8b5c7327260d6dc043a9cda51e
3
+ metadata.gz: be441611f4be3c457fe383d9a7eb7e79b3e75b14
4
+ data.tar.gz: 001b9519af7d23c92df2e6f1cf8a1757f22d7a2b
5
5
  SHA512:
6
- metadata.gz: a7b0192d1ac7e248cdf58d1abe1438c9f391ccb57b39b17f833091bd07fbc3fba980717ad8c94015a28545e96c1c6721b41c0e0c9c31bbd9d097378221c10466
7
- data.tar.gz: c234fdbdc91bf3c181b3b7db4d2d376c33dac39f144b043666781b73665418ef248ca56e60d797098639ea585c453bc6da2f4077fe202cf7cffc696b2fb7e25f
6
+ metadata.gz: 06b6612a02a1138f530174de67981c0bfe07fa313129f6f9b1ed8330209fdb1688ef00051e72e9611beb35bc4a39a511e31b24f4347e34603872f7d42fa64ef6
7
+ data.tar.gz: b784f16e273d614da9eb76ab70f3e2252322fd53e9e4f747c225021934a38da060483d633eae2b4cafd4866bafb03ed6ee42897f3b46146218da7feb73ff18d6
@@ -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
@@ -1,3 +1,3 @@
1
1
  module UnicornRails
2
- VERSION = "2.1.1"
2
+ VERSION = "2.2.0"
3
3
  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.1.1
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-28 00:00:00.000000000 Z
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack