Skip to content
代码片段 群组 项目
提交 3532b8db 编辑于 作者: Jacob Vosmaer's avatar Jacob Vosmaer
浏览文件

Remove config lines in one place

上级 628163b1
No related branches found
No related tags found
无相关合并请求
...@@ -11,22 +11,22 @@ ...@@ -11,22 +11,22 @@
# Remove these because they make setup harder. # Remove these because they make setup harder.
config_lines = config_lines.reject do |line| config_lines = config_lines.reject do |line|
%w[ %w[
working_directory
worker_processes
listen
pid pid
stderr_path stderr_path
stdout_path stdout_path
].any? { |prefix| line.start_with?(prefix) } ].any? { |prefix| line.start_with?(prefix) }
end end
config_lines = config_lines.reject { |l| l.start_with?('working_directory') }
config_lines << "working_directory '#{Rails.root}'" config_lines << "working_directory '#{Rails.root}'"
# We want to have exactly 1 worker process because that makes it # We want to have exactly 1 worker process because that makes it
# predictable which process will handle our requests. # predictable which process will handle our requests.
config_lines = config_lines.reject { |l| l.start_with?('worker_processes') }
config_lines << 'worker_processes 1' config_lines << 'worker_processes 1'
@socket_path = File.join(Dir.pwd, 'tmp/tests/unicorn.socket') @socket_path = File.join(Dir.pwd, 'tmp/tests/unicorn.socket')
config_lines = config_lines.reject { |l| l.start_with?('listen') }
config_lines << "listen '#{@socket_path}'" config_lines << "listen '#{@socket_path}'"
ready_file = 'tmp/tests/unicorn-worker-ready' ready_file = 'tmp/tests/unicorn-worker-ready'
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册