Fixed WEBrick server to use ABSOLUTE_RAILS_ROOT instead of working_directory #687 [Nicholas Seckar]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@839 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 6d566e82
*SVN*
* Fixed WEBrick server to use ABSOLUTE_RAILS_ROOT instead of working_directory #687 [Nicholas Seckar]
* Fixed rails_generator to be usable without RubyGems #686 [Cristi BALAN]
* Fixed -h/--help for generate and destroy generators #331
......
......@@ -6,6 +6,7 @@
include WEBrick
ABSOLUTE_RAILS_ROOT = File.expand_path(RAILS_ROOT)
class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
REQUEST_MUTEX = Mutex.new
......@@ -18,12 +19,12 @@ def self.dispatch(options = {})
trap("INT") { server.shutdown }
server.start
Dir::chdir(OPTIONS['working_directory']) if OPTIONS['working_directory']
end
def initialize(server, options)
@server_options = options
@file_handler = WEBrick::HTTPServlet::FileHandler.new(server, options[:server_root])
Dir.chdir(ABSOLUTE_RAILS_ROOT)
super
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册