rack-handlers 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/README.md +19 -8
- data/Rakefile +1 -1
- data/lib/rack-handlers.rb +36 -0
- data/lib/rack/handler/rails-server.rb +1 -1
- data/rack-handlers.gemspec +6 -5
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1f85445dc157422692fc335ec353709730565f5
|
4
|
+
data.tar.gz: 7dc71015543eeaf78efd5dbfdd762647d6a11e79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e37e57db9417a09ce77161e88b650e7f66814d2b3a8abc7e85462fc04903b4c2913bf3ee22eda593a4bcbab9fe179c06626e0e63e25e8f44e92a76779ecacda7
|
7
|
+
data.tar.gz: 79bd7d6685695cc3f1fe53760559bde8f7d87a7ee43ff2e9a452a5ba19d206a27868321ef69db0ec3c2e2f8b2d1e8d650cf4c2043c17bb952b8fc416d75977f7
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# CHANGES
|
2
2
|
|
3
|
+
## rack-handlers 0.7.0 -- 2013-08-22
|
4
|
+
|
5
|
+
* Introduced rack-handlers.rb for you that patched `Rack::Handler.default`
|
6
|
+
with the following order: zbatery, rainbows, unicorn, puma, thin, webrick.
|
7
|
+
You would no longer need to require 'rack/handler/rails-server' in order to
|
8
|
+
make `rails s` work for unicorns.
|
9
|
+
|
3
10
|
## rack-handlers 0.6.1 -- 2013-07-11
|
4
11
|
|
5
12
|
* Ditto.
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ by Lin Jen-Shin ([godfat](http://godfat.org))
|
|
10
10
|
|
11
11
|
## DESCRIPTION:
|
12
12
|
|
13
|
-
|
13
|
+
Unicorn family Rack handlers for you. Mostly for `rails s`.
|
14
14
|
|
15
15
|
## REQUIREMENTS:
|
16
16
|
|
@@ -23,19 +23,30 @@ Some Rack handlers which are not included in Rack distribution.
|
|
23
23
|
|
24
24
|
## SYNOPSIS:
|
25
25
|
|
26
|
+
Put `'rack-handlers'` and your favorite unicorns into Gemfile
|
27
|
+
then you could do the followings:
|
28
|
+
|
26
29
|
rails s unicorn
|
27
30
|
rails s rainbows
|
28
31
|
rails s zbatery
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
+
Because requiring `'rack-handlers'` would make `Rack::Handler.default`
|
34
|
+
pick the server with the following order:
|
35
|
+
|
36
|
+
* zbatery
|
37
|
+
* rainbows
|
38
|
+
* unicorn
|
39
|
+
* puma
|
40
|
+
* thin
|
41
|
+
* webrick
|
42
|
+
|
43
|
+
Thus if you have rainbows installed, `rails s` would launch the server with
|
44
|
+
rainbows instead of webrick (the original behaviour).
|
33
45
|
|
34
|
-
|
35
|
-
|
36
|
-
is selected.
|
46
|
+
Additionally, it would also try to load the config via `config/zbatery.rb`,
|
47
|
+
or `config/rainbows.rb` depending on which server is picked.
|
37
48
|
|
38
|
-
For people who likes to
|
49
|
+
For people who likes to run `rails s`!
|
39
50
|
|
40
51
|
## CONTRIBUTORS:
|
41
52
|
|
data/Rakefile
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
# Assume you want a more sensible default, or don't require this file
|
3
|
+
|
4
|
+
require 'rack/handler'
|
5
|
+
|
6
|
+
module Rack::Handler
|
7
|
+
DEFAULT = %w[zbatery rainbows unicorn puma thin webrick]
|
8
|
+
|
9
|
+
def self.default(options = {})
|
10
|
+
# Guess.
|
11
|
+
if ENV.include?("PHP_FCGI_CHILDREN")
|
12
|
+
# We already speak FastCGI
|
13
|
+
options.delete :File
|
14
|
+
options.delete :Port
|
15
|
+
|
16
|
+
Rack::Handler::FastCGI
|
17
|
+
elsif ENV.include?("REQUEST_METHOD")
|
18
|
+
Rack::Handler::CGI
|
19
|
+
else
|
20
|
+
pick DEFAULT # We only change this line
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Copied from rack 1.5.2 for backward compatibility
|
25
|
+
def self.pick(server_names)
|
26
|
+
server_names = Array(server_names)
|
27
|
+
server_names.each do |server_name|
|
28
|
+
begin
|
29
|
+
return get(server_name.to_s)
|
30
|
+
rescue LoadError, NameError
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
raise LoadError, "Couldn't find handler for: #{server_names.join(', ')}."
|
35
|
+
end unless respond_to?(:pick)
|
36
|
+
end
|
data/rack-handlers.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "rack-handlers"
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.7.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Lin Jen-Shin (godfat)"]
|
9
|
-
s.date = "2013-
|
10
|
-
s.description = "
|
9
|
+
s.date = "2013-08-22"
|
10
|
+
s.description = "Unicorn family Rack handlers for you. Mostly for `rails s`."
|
11
11
|
s.email = ["godfat (XD) godfat.org"]
|
12
12
|
s.files = [
|
13
13
|
".gitignore",
|
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
"CHANGES.md",
|
16
16
|
"README.md",
|
17
17
|
"Rakefile",
|
18
|
+
"lib/rack-handlers.rb",
|
18
19
|
"lib/rack/handler/rails-server.rb",
|
19
20
|
"lib/rack/handler/rainbows.rb",
|
20
21
|
"lib/rack/handler/unicorn.rb",
|
@@ -24,8 +25,8 @@ Gem::Specification.new do |s|
|
|
24
25
|
"task/gemgem.rb"]
|
25
26
|
s.homepage = "https://github.com/godfat/rack-handlers"
|
26
27
|
s.require_paths = ["lib"]
|
27
|
-
s.rubygems_version = "2.0.
|
28
|
-
s.summary = "
|
28
|
+
s.rubygems_version = "2.0.6"
|
29
|
+
s.summary = "Unicorn family Rack handlers for you. Mostly for `rails s`."
|
29
30
|
|
30
31
|
if s.respond_to? :specification_version then
|
31
32
|
s.specification_version = 4
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-handlers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lin Jen-Shin (godfat)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description:
|
27
|
+
description: Unicorn family Rack handlers for you. Mostly for `rails s`.
|
28
28
|
email:
|
29
29
|
- godfat (XD) godfat.org
|
30
30
|
executables: []
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- CHANGES.md
|
37
37
|
- README.md
|
38
38
|
- Rakefile
|
39
|
+
- lib/rack-handlers.rb
|
39
40
|
- lib/rack/handler/rails-server.rb
|
40
41
|
- lib/rack/handler/rainbows.rb
|
41
42
|
- lib/rack/handler/unicorn.rb
|
@@ -62,8 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
63
|
version: '0'
|
63
64
|
requirements: []
|
64
65
|
rubyforge_project:
|
65
|
-
rubygems_version: 2.0.
|
66
|
+
rubygems_version: 2.0.6
|
66
67
|
signing_key:
|
67
68
|
specification_version: 4
|
68
|
-
summary:
|
69
|
+
summary: Unicorn family Rack handlers for you. Mostly for `rails s`.
|
69
70
|
test_files: []
|