Methods
- A
- D
- L
- M
- N
- O
- S
Classes and Modules
- CLASS Rails::Server::Options
Class Public methods
Instance Public methods
# File railties/lib/rails/commands/server.rb, line 89 89: def default_options 90: super.merge({ 91: :Port => 3000, 92: :environment => (ENV['RAILS_ENV'] || "development").dup, 93: :daemonize => false, 94: :debugger => false, 95: :pid => File.expand_path("tmp/pids/server.pid"), 96: :config => File.expand_path("config.ru") 97: }) 98: end
# File railties/lib/rails/commands/server.rb, line 77 77: def middleware 78: middlewares = [] 79: middlewares << [Rails::Rack::LogTailer, log_path] unless options[:daemonize] 80: middlewares << [Rails::Rack::Debugger] if options[:debugger] 81: middlewares << [::Rack::ContentLength] 82: Hash.new(middlewares) 83: end
# File railties/lib/rails/commands/server.rb, line 57 57: def start 58: url = "#{options[:SSLEnable] ? 'https' : 'http'}://#{options[:Host]}:#{options[:Port]}" 59: puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}" 60: puts "=> Rails #{Rails.version} application starting in #{Rails.env} on #{url}" 61: puts "=> Call with -d to detach" unless options[:daemonize] 62: trap(:INT) { exit } 63: puts "=> Ctrl-C to shutdown server" unless options[:daemonize] 64: 65: #Create required tmp directories if not found 66: %w(cache pids sessions sockets).each do |dir_to_make| 67: FileUtils.mkdir_p(Rails.root.join('tmp', dir_to_make)) 68: end 69: 70: super 71: ensure 72: # The '-h' option calls exit before @options is set. 73: # If we call 'options' with it unset, we get double help banners. 74: puts 'Exiting' unless @options && options[:daemonize] 75: end