Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
83448c7d
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
83448c7d
编写于
12月 30, 2013
作者:
C
Charlie Somerville
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove dispatch.rb and gateway.cgi
上级
8f99d008
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
35 addition
and
152 deletion
+35
-152
railties/Rakefile
railties/Rakefile
+13
-19
railties/dispatches/dispatch.rb
railties/dispatches/dispatch.rb
+0
-10
railties/dispatches/gateway.cgi
railties/dispatches/gateway.cgi
+0
-97
railties/lib/rails_generator/generators/applications/app/app_generator.rb
...ls_generator/generators/applications/app/app_generator.rb
+17
-19
railties/lib/tasks/framework.rake
railties/lib/tasks/framework.rake
+5
-7
未找到文件。
railties/Rakefile
浏览文件 @
83448c7d
...
...
@@ -163,12 +163,6 @@ task :copy_ties_content => [
:copy_configs
,
:copy_binfiles
,
:copy_test_helpers
,
:copy_app_doc_readme
]
task
:copy_dispatches
do
copy_with_rewritten_ruby_path
(
"dispatches/dispatch.rb"
,
"
#{
PKG_DESTINATION
}
/public/dispatch.rb"
)
chmod
0755
,
"
#{
PKG_DESTINATION
}
/public/dispatch.rb"
copy_with_rewritten_ruby_path
(
"dispatches/dispatch.rb"
,
"
#{
PKG_DESTINATION
}
/public/dispatch.cgi"
)
chmod
0755
,
"
#{
PKG_DESTINATION
}
/public/dispatch.cgi"
copy_with_rewritten_ruby_path
(
"dispatches/dispatch.fcgi"
,
"
#{
PKG_DESTINATION
}
/public/dispatch.fcgi"
)
chmod
0755
,
"
#{
PKG_DESTINATION
}
/public/dispatch.fcgi"
end
...
...
railties/dispatches/dispatch.rb
已删除
100755 → 0
浏览文件 @
8f99d008
#!/usr/bin/env ruby
require
File
.
dirname
(
__FILE__
)
+
"/../config/environment"
unless
defined?
(
RAILS_ROOT
)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
require
"dispatcher"
ADDITIONAL_LOAD_PATHS
.
reverse
.
each
{
|
dir
|
$:
.
unshift
(
dir
)
if
File
.
directory?
(
dir
)
}
if
defined?
(
Apache
::
RubyRun
)
Dispatcher
.
dispatch
railties/dispatches/gateway.cgi
已删除
100755 → 0
浏览文件 @
8f99d008
#!/usr/bin/env ruby
require
'drb'
# This file includes an experimental gateway CGI implementation. It will work
# only on platforms which support both fork and sockets.
#
# To enable it edit public/.htaccess and replace dispatch.cgi with gateway.cgi.
#
# Next, create the directory log/drb_gateway and grant the apache user rw access
# to said directory.
#
# On the next request to your server, the gateway tracker should start up, along
# with a few listener processes. This setup should provide you with much better
# speeds than dispatch.cgi.
#
# Keep in mind that the first request made to the server will be slow, as the
# tracker and listeners will have to load. Also, the tracker and listeners will
# shutdown after a period if inactivity. You can set this value below -- the
# default is 90 seconds.
TrackerSocket
=
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'../log/drb_gateway/tracker.sock'
))
DieAfter
=
90
# Seconds
Listeners
=
3
def
message
(
s
)
$stderr
.
puts
"gateway.cgi:
#{
s
}
"
if
ENV
&&
ENV
[
"DEBUG_GATEWAY"
]
end
def
listener_socket
(
number
)
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
"../log/drb_gateway/listener_
#{
number
}
.sock"
))
end
unless
File
.
exist?
TrackerSocket
message
"Starting tracker and
#{
Listeners
}
listeners"
fork
do
Process
.
setsid
STDIN
.
reopen
"/dev/null"
STDOUT
.
reopen
"/dev/null"
,
"a"
root
=
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
+
'/..'
)
message
"starting tracker"
fork
do
ARGV
.
clear
ARGV
<<
TrackerSocket
<<
Listeners
.
to_s
<<
DieAfter
.
to_s
load
File
.
join
(
root
,
'script'
,
'tracker'
)
end
message
"starting listeners"
require
File
.
join
(
root
,
'config/environment.rb'
)
Listeners
.
times
do
|
number
|
fork
do
ARGV
.
clear
ARGV
<<
listener_socket
(
number
)
<<
DieAfter
.
to_s
load
File
.
join
(
root
,
'script'
,
'listener'
)
end
end
end
message
"waiting for tracker and listener to arise..."
ready
=
false
10
.
times
do
sleep
0.5
break
if
(
ready
=
File
.
exist?
(
TrackerSocket
)
&&
File
.
exist?
(
listener_socket
(
0
)))
end
if
ready
message
"tracker and listener are ready"
else
message
"Waited 5 seconds, listener and tracker not ready... dropping request"
Kernel
.
exit
1
end
end
DRb
.
start_service
message
"connecting to tracker"
tracker
=
DRbObject
.
new_with_uri
(
"drbunix:
#{
TrackerSocket
}
"
)
input
=
$stdin
.
read
$stdin
.
close
env
=
ENV
.
inspect
output
=
nil
tracker
.
with_listener
do
|
number
|
message
"connecting to listener
#{
number
}
"
socket
=
listener_socket
(
number
)
listener
=
DRbObject
.
new_with_uri
(
"drbunix:
#{
socket
}
"
)
output
=
listener
.
process
(
env
,
input
)
message
"listener
#{
number
}
has finished, writing output"
end
$stdout
.
write
output
$stdout
.
flush
$stdout
.
close
railties/lib/rails_generator/generators/applications/app/app_generator.rb
浏览文件 @
83448c7d
...
...
@@ -218,8 +218,6 @@ def create_dispatch_files(m)
dispatcher_options
=
{
:chmod
=>
0755
,
:shebang
=>
options
[
:shebang
]
}
m
.
file
"dispatches/config.ru"
,
"config.ru"
m
.
file
"dispatches/dispatch.rb"
,
"public/dispatch.rb"
,
dispatcher_options
m
.
file
"dispatches/dispatch.rb"
,
"public/dispatch.cgi"
,
dispatcher_options
m
.
file
"dispatches/dispatch.fcgi"
,
"public/dispatch.fcgi"
,
dispatcher_options
end
end
...
...
railties/lib/tasks/framework.rake
浏览文件 @
83448c7d
...
...
@@ -139,8 +139,6 @@ namespace :rails do
require
'railties_path'
FileUtils
.
cp
(
RAILTIES_PATH
+
'/dispatches/config.ru'
,
RAILS_ROOT
+
'/config.ru'
)
FileUtils
.
cp
(
RAILTIES_PATH
+
'/dispatches/dispatch.fcgi'
,
RAILS_ROOT
+
'/public/dispatch.fcgi'
)
FileUtils
.
cp
(
RAILTIES_PATH
+
'/dispatches/dispatch.rb'
,
RAILS_ROOT
+
'/public/dispatch.rb'
)
FileUtils
.
cp
(
RAILTIES_PATH
+
'/dispatches/dispatch.rb'
,
RAILS_ROOT
+
'/public/dispatch.cgi'
)
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录