unicorn-rails 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/unicorn-rails.rb +1 -33
- data/lib/unicorn/rails.rb +31 -0
- data/lib/unicorn/rails/version.rb +5 -0
- metadata +19 -10
- data/LICENSE +0 -19
- data/README.md +0 -27
- data/lib/unicorn-rails/version.rb +0 -3
data/lib/unicorn-rails.rb
CHANGED
@@ -1,33 +1 @@
|
|
1
|
-
|
2
|
-
require "unicorn-rails/version"
|
3
|
-
end
|
4
|
-
|
5
|
-
require "unicorn"
|
6
|
-
|
7
|
-
module Rack
|
8
|
-
module Handler
|
9
|
-
class Unicorn
|
10
|
-
class << self
|
11
|
-
def run(app, options = {})
|
12
|
-
unicorn_options = {}
|
13
|
-
unicorn_options[:listeners] = ["#{options[:Host]}:#{options[:Port]}"]
|
14
|
-
unicorn_options[:worker_processes] = 3
|
15
|
-
|
16
|
-
if options[:debugger]
|
17
|
-
unicorn_options[:worker_processes] = 1
|
18
|
-
unicorn_options[:timeout] = 120
|
19
|
-
end
|
20
|
-
|
21
|
-
::Unicorn::Launcher.daemonize!(unicorn_options) if options[:daemonize]
|
22
|
-
::Unicorn::HttpServer.new(app, unicorn_options).start.join
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
register "unicorn", "Rack::Handler::Unicorn"
|
28
|
-
|
29
|
-
def self.default(options = {})
|
30
|
-
Rack::Handler::Unicorn
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
1
|
+
require "unicorn/rails"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "unicorn"
|
2
|
+
|
3
|
+
module Unicorn
|
4
|
+
module Rails
|
5
|
+
require "unicorn/rails/version"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
module Rack
|
10
|
+
module Handler
|
11
|
+
class Unicorn
|
12
|
+
class << self
|
13
|
+
def run(app, options = {})
|
14
|
+
unicorn_options = {}
|
15
|
+
unicorn_options[:listeners] = ["#{options[:Host]}:#{options[:Port]}"]
|
16
|
+
unicorn_options[:worker_processes] = 1
|
17
|
+
unicorn_options[:timeout] = 31 * 24 * 60 * 60
|
18
|
+
|
19
|
+
::Unicorn::Launcher.daemonize!(unicorn_options) if options[:daemonize]
|
20
|
+
::Unicorn::HttpServer.new(app, unicorn_options).start.join
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
register "unicorn", "Rack::Handler::Unicorn"
|
26
|
+
|
27
|
+
def self.default(options = {})
|
28
|
+
Rack::Handler::Unicorn
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: unicorn
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: unicorn-rails overrides the Rack::Handler.default method to return Rack::Handler::Unicorn
|
37
47
|
which will cause rack (and rails) to use unicorn by default.
|
38
48
|
email:
|
@@ -41,10 +51,9 @@ executables: []
|
|
41
51
|
extensions: []
|
42
52
|
extra_rdoc_files: []
|
43
53
|
files:
|
44
|
-
- lib/unicorn
|
54
|
+
- lib/unicorn/rails/version.rb
|
55
|
+
- lib/unicorn/rails.rb
|
45
56
|
- lib/unicorn-rails.rb
|
46
|
-
- LICENSE
|
47
|
-
- README.md
|
48
57
|
homepage: https://github.com/samuelkadolph/unicorn-rails
|
49
58
|
licenses: []
|
50
59
|
post_install_message:
|
@@ -65,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
74
|
version: '0'
|
66
75
|
requirements: []
|
67
76
|
rubyforge_project:
|
68
|
-
rubygems_version: 1.8.
|
77
|
+
rubygems_version: 1.8.24
|
69
78
|
signing_key:
|
70
79
|
specification_version: 3
|
71
80
|
summary: unicorn-rails is a simple gem that sets the default server for rack (and
|
data/LICENSE
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright (C) 2011 by Samuel Kadolph
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
5
|
-
in the Software without restriction, including without limitation the rights
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# unicorn-rails
|
2
|
-
|
3
|
-
`unicorn-rails` is a simple gem that sets the default server for rack (and rails) to unicorn.
|
4
|
-
|
5
|
-
## Description
|
6
|
-
|
7
|
-
unicorn-rails overrides the `Rack::Handler.default` method to return `Rack::Handler::Unicorn` which will cause rack (and
|
8
|
-
rails) to use unicorn by default.
|
9
|
-
|
10
|
-
## Installing
|
11
|
-
|
12
|
-
### Recommended
|
13
|
-
|
14
|
-
```
|
15
|
-
gem install unicorn-rails
|
16
|
-
```
|
17
|
-
|
18
|
-
### Edge
|
19
|
-
|
20
|
-
```
|
21
|
-
git clone https://github.com/samuelkadolph/unicorn-rails
|
22
|
-
cd unicorn-rails && rake install
|
23
|
-
```
|
24
|
-
|
25
|
-
## Usage
|
26
|
-
|
27
|
-
Add `gem "unicorn-rails"` to your Gemfile and then run `rails s` and it will use unicorn by default.
|