Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move tmp directory creation from server to initializer

  • Loading branch information...
commit 5eeed9f00a3bd57134cfa0e6792cd8767619c132 1 parent c83c0f6
@josh josh authored
View
4 railties/lib/rails/commands/server.rb
@@ -44,10 +44,6 @@
puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}"
puts "=> Rails #{Rails.version} application starting on http://#{options[:Host]}:#{options[:Port]}}"
-%w(cache pids sessions sockets).each do |dir_to_make|
- FileUtils.mkdir_p(File.join(RAILS_ROOT, 'tmp', dir_to_make))
-end
-
if options[:detach]
Process.daemon
pid = "#{RAILS_ROOT}/tmp/pids/server.pid"
View
7 railties/lib/rails/initializer.rb
@@ -195,6 +195,13 @@ def self.run(initializer = nil, config = nil)
plugin_loader.add_plugin_load_paths
end
+ # Create tmp directories
+ Initializer.default.add :ensure_tmp_directories_exist do
+ %w(cache pids sessions sockets).each do |dir_to_make|
+ FileUtils.mkdir_p(File.join(configuration.root_path, 'tmp', dir_to_make))
+ end
+ end
+
# Loads the environment specified by Configuration#environment_path, which
# is typically one of development, test, or production.
Initializer.default.add :load_environment do
Please sign in to comment.
Something went wrong with that request. Please try again.