unicorn 4.3.1 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +2 -29
- data/lib/unicorn.rb +1 -1
- data/lib/unicorn/const.rb +1 -1
- data/lib/unicorn/http_server.rb +12 -1
- data/lib/unicorn/socket_helper.rb +7 -7
- data/lib/unicorn/util.rb +1 -0
- data/script/isolate_for_tests +0 -18
- data/t/listener_names.ru +4 -0
- data/t/t0022-listener_names-preload_app.sh +32 -0
- data/test/exec/test_exec.rb +72 -86
- data/test/unit/test_util.rb +7 -8
- metadata +7 -103
- data/t/rails3-app/.gitignore +0 -4
- data/t/rails3-app/Gemfile +0 -26
- data/t/rails3-app/Rakefile +0 -10
- data/t/rails3-app/app/controllers/application_controller.rb +0 -4
- data/t/rails3-app/app/helpers/application_helper.rb +0 -2
- data/t/rails3-app/app/views/layouts/application.html.erb +0 -14
- data/t/rails3-app/config.ru +0 -4
- data/t/rails3-app/config/application.rb +0 -46
- data/t/rails3-app/config/boot.rb +0 -6
- data/t/rails3-app/config/database.yml +0 -22
- data/t/rails3-app/config/environment.rb +0 -5
- data/t/rails3-app/config/environments/development.rb +0 -19
- data/t/rails3-app/config/environments/production.rb +0 -42
- data/t/rails3-app/config/environments/test.rb +0 -32
- data/t/rails3-app/config/initializers/backtrace_silencers.rb +0 -7
- data/t/rails3-app/config/initializers/inflections.rb +0 -10
- data/t/rails3-app/config/initializers/mime_types.rb +0 -5
- data/t/rails3-app/config/initializers/secret_token.rb +0 -7
- data/t/rails3-app/config/initializers/session_store.rb +0 -8
- data/t/rails3-app/config/locales/en.yml +0 -5
- data/t/rails3-app/config/routes.rb +0 -58
- data/t/rails3-app/db/seeds.rb +0 -7
- data/t/rails3-app/doc/README_FOR_APP +0 -2
- data/t/rails3-app/lib/tasks/.gitkeep +0 -0
- data/t/rails3-app/public/404.html +0 -1
- data/t/rails3-app/public/500.html +0 -1
- data/t/rails3-app/public/x.txt +0 -1
- data/t/rails3-app/script/rails +0 -9
- data/t/rails3-app/test/performance/browsing_test.rb +0 -9
- data/t/rails3-app/test/test_helper.rb +0 -13
- data/t/rails3-app/vendor/plugins/.gitkeep +0 -0
- data/t/t0300-rails3-basic.sh +0 -28
- data/t/t0301-rails3-missing-config-ru.sh +0 -33
- data/t/t0302-rails3-alt-working_directory.sh +0 -32
- data/t/t0303-rails3-alt-working_directory_config.ru.sh +0 -56
- data/t/t0304-rails3-alt-working_directory_no_embed_cli.sh +0 -52
- data/t/test-rails3.sh +0 -27
- data/test/rails/app-1.2.3/.gitignore +0 -2
- data/test/rails/app-1.2.3/Rakefile +0 -7
- data/test/rails/app-1.2.3/app/controllers/application.rb +0 -6
- data/test/rails/app-1.2.3/app/controllers/foo_controller.rb +0 -36
- data/test/rails/app-1.2.3/app/helpers/application_helper.rb +0 -4
- data/test/rails/app-1.2.3/config/boot.rb +0 -11
- data/test/rails/app-1.2.3/config/database.yml +0 -12
- data/test/rails/app-1.2.3/config/environment.rb +0 -13
- data/test/rails/app-1.2.3/config/environments/development.rb +0 -9
- data/test/rails/app-1.2.3/config/environments/production.rb +0 -5
- data/test/rails/app-1.2.3/config/routes.rb +0 -6
- data/test/rails/app-1.2.3/db/.gitignore +0 -0
- data/test/rails/app-1.2.3/public/404.html +0 -1
- data/test/rails/app-1.2.3/public/500.html +0 -1
- data/test/rails/app-2.0.2/.gitignore +0 -2
- data/test/rails/app-2.0.2/Rakefile +0 -7
- data/test/rails/app-2.0.2/app/controllers/application.rb +0 -4
- data/test/rails/app-2.0.2/app/controllers/foo_controller.rb +0 -36
- data/test/rails/app-2.0.2/app/helpers/application_helper.rb +0 -4
- data/test/rails/app-2.0.2/config/boot.rb +0 -11
- data/test/rails/app-2.0.2/config/database.yml +0 -12
- data/test/rails/app-2.0.2/config/environment.rb +0 -17
- data/test/rails/app-2.0.2/config/environments/development.rb +0 -8
- data/test/rails/app-2.0.2/config/environments/production.rb +0 -5
- data/test/rails/app-2.0.2/config/routes.rb +0 -6
- data/test/rails/app-2.0.2/db/.gitignore +0 -0
- data/test/rails/app-2.0.2/public/404.html +0 -1
- data/test/rails/app-2.0.2/public/500.html +0 -1
- data/test/rails/app-2.1.2/.gitignore +0 -2
- data/test/rails/app-2.1.2/Rakefile +0 -7
- data/test/rails/app-2.1.2/app/controllers/application.rb +0 -4
- data/test/rails/app-2.1.2/app/controllers/foo_controller.rb +0 -36
- data/test/rails/app-2.1.2/app/helpers/application_helper.rb +0 -4
- data/test/rails/app-2.1.2/config/boot.rb +0 -111
- data/test/rails/app-2.1.2/config/database.yml +0 -12
- data/test/rails/app-2.1.2/config/environment.rb +0 -17
- data/test/rails/app-2.1.2/config/environments/development.rb +0 -7
- data/test/rails/app-2.1.2/config/environments/production.rb +0 -5
- data/test/rails/app-2.1.2/config/routes.rb +0 -6
- data/test/rails/app-2.1.2/db/.gitignore +0 -0
- data/test/rails/app-2.1.2/public/404.html +0 -1
- data/test/rails/app-2.1.2/public/500.html +0 -1
- data/test/rails/app-2.2.2/.gitignore +0 -2
- data/test/rails/app-2.2.2/Rakefile +0 -7
- data/test/rails/app-2.2.2/app/controllers/application.rb +0 -4
- data/test/rails/app-2.2.2/app/controllers/foo_controller.rb +0 -36
- data/test/rails/app-2.2.2/app/helpers/application_helper.rb +0 -4
- data/test/rails/app-2.2.2/config/boot.rb +0 -111
- data/test/rails/app-2.2.2/config/database.yml +0 -12
- data/test/rails/app-2.2.2/config/environment.rb +0 -17
- data/test/rails/app-2.2.2/config/environments/development.rb +0 -7
- data/test/rails/app-2.2.2/config/environments/production.rb +0 -5
- data/test/rails/app-2.2.2/config/routes.rb +0 -6
- data/test/rails/app-2.2.2/db/.gitignore +0 -0
- data/test/rails/app-2.2.2/public/404.html +0 -1
- data/test/rails/app-2.2.2/public/500.html +0 -1
- data/test/rails/test_rails.rb +0 -287
@@ -1,11 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
unless defined?(RAILS_ROOT)
|
4
|
-
root_path = File.join(File.dirname(__FILE__), '..')
|
5
|
-
RAILS_ROOT = root_path
|
6
|
-
end
|
7
|
-
|
8
|
-
unless defined?(Rails::Initializer)
|
9
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
10
|
-
Rails::Initializer.run(:set_load_path)
|
11
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
unless defined? RAILS_GEM_VERSION
|
4
|
-
RAILS_GEM_VERSION = ENV['UNICORN_RAILS_VERSION'] # || '1.2.3'
|
5
|
-
end
|
6
|
-
|
7
|
-
# Bootstrap the Rails environment, frameworks, and default configuration
|
8
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
9
|
-
|
10
|
-
Rails::Initializer.run do |config|
|
11
|
-
config.frameworks -= [ :action_web_service, :action_mailer ]
|
12
|
-
config.action_controller.session_store = :active_record_store
|
13
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
config.cache_classes = false
|
4
|
-
config.whiny_nils = true
|
5
|
-
config.breakpoint_server = true
|
6
|
-
config.action_controller.consider_all_requests_local = true
|
7
|
-
config.action_controller.perform_caching = false
|
8
|
-
config.action_view.cache_template_extensions = false
|
9
|
-
config.action_view.debug_rjs = true
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
404 Not Found
|
@@ -1 +0,0 @@
|
|
1
|
-
500 Internal Server Error
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
require 'digest/sha1'
|
4
|
-
class FooController < ApplicationController
|
5
|
-
def index
|
6
|
-
render :text => "FOO\n"
|
7
|
-
end
|
8
|
-
|
9
|
-
def xcookie
|
10
|
-
cookies["foo"] = "cookie #$$"
|
11
|
-
render :text => ""
|
12
|
-
end
|
13
|
-
|
14
|
-
def xnotice
|
15
|
-
flash[:notice] = "session #$$"
|
16
|
-
render :text => ""
|
17
|
-
end
|
18
|
-
|
19
|
-
def xpost
|
20
|
-
if request.post?
|
21
|
-
digest = Digest::SHA1.new
|
22
|
-
out = "params: #{params.inspect}\n"
|
23
|
-
if file = params[:file]
|
24
|
-
loop do
|
25
|
-
buf = file.read(4096) or break
|
26
|
-
digest.update(buf)
|
27
|
-
end
|
28
|
-
out << "sha1: #{digest.to_s}\n"
|
29
|
-
end
|
30
|
-
headers['content-type'] = 'text/plain'
|
31
|
-
render :text => out
|
32
|
-
else
|
33
|
-
render :status => 403, :text => "need post\n"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
unless defined?(RAILS_ROOT)
|
4
|
-
root_path = File.join(File.dirname(__FILE__), '..')
|
5
|
-
RAILS_ROOT = root_path
|
6
|
-
end
|
7
|
-
|
8
|
-
unless defined?(Rails::Initializer)
|
9
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
10
|
-
Rails::Initializer.run(:set_load_path)
|
11
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
unless defined? RAILS_GEM_VERSION
|
4
|
-
RAILS_GEM_VERSION = ENV['UNICORN_RAILS_VERSION']
|
5
|
-
end
|
6
|
-
|
7
|
-
# Bootstrap the Rails environment, frameworks, and default configuration
|
8
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
9
|
-
|
10
|
-
Rails::Initializer.run do |config|
|
11
|
-
config.frameworks -= [ :action_web_service, :action_mailer ]
|
12
|
-
config.action_controller.session_store = :active_record_store
|
13
|
-
config.action_controller.session = {
|
14
|
-
:session_key => "_unicorn_rails_test.#{rand}",
|
15
|
-
:secret => "#{rand}#{rand}#{rand}#{rand}",
|
16
|
-
}
|
17
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
config.cache_classes = false
|
4
|
-
config.whiny_nils = true
|
5
|
-
config.action_controller.consider_all_requests_local = true
|
6
|
-
config.action_controller.perform_caching = false
|
7
|
-
config.action_view.cache_template_extensions = false
|
8
|
-
config.action_view.debug_rjs = true
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
404 Not Found
|
@@ -1 +0,0 @@
|
|
1
|
-
500 Internal Server Error
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
require 'digest/sha1'
|
4
|
-
class FooController < ApplicationController
|
5
|
-
def index
|
6
|
-
render :text => "FOO\n"
|
7
|
-
end
|
8
|
-
|
9
|
-
def xcookie
|
10
|
-
cookies["foo"] = "cookie #$$"
|
11
|
-
render :text => ""
|
12
|
-
end
|
13
|
-
|
14
|
-
def xnotice
|
15
|
-
flash[:notice] = "session #$$"
|
16
|
-
render :text => ""
|
17
|
-
end
|
18
|
-
|
19
|
-
def xpost
|
20
|
-
if request.post?
|
21
|
-
digest = Digest::SHA1.new
|
22
|
-
out = "params: #{params.inspect}\n"
|
23
|
-
if file = params[:file]
|
24
|
-
loop do
|
25
|
-
buf = file.read(4096) or break
|
26
|
-
digest.update(buf)
|
27
|
-
end
|
28
|
-
out << "sha1: #{digest.to_s}\n"
|
29
|
-
end
|
30
|
-
headers['content-type'] = 'text/plain'
|
31
|
-
render :text => out
|
32
|
-
else
|
33
|
-
render :status => 403, :text => "need post\n"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,111 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
# Don't change this file!
|
4
|
-
# Configure your app in config/environment.rb and config/environments/*.rb
|
5
|
-
|
6
|
-
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
7
|
-
|
8
|
-
module Rails
|
9
|
-
class << self
|
10
|
-
def boot!
|
11
|
-
unless booted?
|
12
|
-
preinitialize
|
13
|
-
pick_boot.run
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def booted?
|
18
|
-
defined? Rails::Initializer
|
19
|
-
end
|
20
|
-
|
21
|
-
def pick_boot
|
22
|
-
(vendor_rails? ? VendorBoot : GemBoot).new
|
23
|
-
end
|
24
|
-
|
25
|
-
def vendor_rails?
|
26
|
-
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
27
|
-
end
|
28
|
-
|
29
|
-
def preinitialize
|
30
|
-
load(preinitializer_path) if File.exist?(preinitializer_path)
|
31
|
-
end
|
32
|
-
|
33
|
-
def preinitializer_path
|
34
|
-
"#{RAILS_ROOT}/config/preinitializer.rb"
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
class Boot
|
39
|
-
def run
|
40
|
-
load_initializer
|
41
|
-
Rails::Initializer.run(:set_load_path)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class VendorBoot < Boot
|
46
|
-
def load_initializer
|
47
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
48
|
-
Rails::Initializer.run(:install_gem_spec_stubs)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
class GemBoot < Boot
|
53
|
-
def load_initializer
|
54
|
-
self.class.load_rubygems
|
55
|
-
load_rails_gem
|
56
|
-
require 'initializer'
|
57
|
-
end
|
58
|
-
|
59
|
-
def load_rails_gem
|
60
|
-
if version = self.class.gem_version
|
61
|
-
gem 'rails', version
|
62
|
-
else
|
63
|
-
gem 'rails'
|
64
|
-
end
|
65
|
-
rescue Gem::LoadError => load_error
|
66
|
-
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
67
|
-
exit 1
|
68
|
-
end
|
69
|
-
|
70
|
-
class << self
|
71
|
-
def rubygems_version
|
72
|
-
Gem::RubyGemsVersion rescue nil
|
73
|
-
end
|
74
|
-
|
75
|
-
def gem_version
|
76
|
-
if defined? RAILS_GEM_VERSION
|
77
|
-
RAILS_GEM_VERSION
|
78
|
-
elsif ENV.include?('RAILS_GEM_VERSION')
|
79
|
-
ENV['RAILS_GEM_VERSION']
|
80
|
-
else
|
81
|
-
parse_gem_version(read_environment_rb)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def load_rubygems
|
86
|
-
require 'rubygems'
|
87
|
-
min_version = '1.3.1'
|
88
|
-
unless rubygems_version >= min_version
|
89
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
90
|
-
exit 1
|
91
|
-
end
|
92
|
-
|
93
|
-
rescue LoadError
|
94
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
95
|
-
exit 1
|
96
|
-
end
|
97
|
-
|
98
|
-
def parse_gem_version(text)
|
99
|
-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
100
|
-
end
|
101
|
-
|
102
|
-
private
|
103
|
-
def read_environment_rb
|
104
|
-
File.read("#{RAILS_ROOT}/config/environment.rb")
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
# All that for this:
|
111
|
-
Rails.boot!
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
|
3
|
-
unless defined? RAILS_GEM_VERSION
|
4
|
-
RAILS_GEM_VERSION = ENV['UNICORN_RAILS_VERSION']
|
5
|
-
end
|
6
|
-
|
7
|
-
# Bootstrap the Rails environment, frameworks, and default configuration
|
8
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
9
|
-
|
10
|
-
Rails::Initializer.run do |config|
|
11
|
-
config.frameworks -= [ :action_web_service, :action_mailer ]
|
12
|
-
config.action_controller.session_store = :active_record_store
|
13
|
-
config.action_controller.session = {
|
14
|
-
:session_key => "_unicorn_rails_test.#{rand}",
|
15
|
-
:secret => "#{rand}#{rand}#{rand}#{rand}",
|
16
|
-
}
|
17
|
-
end
|