Class: Rails::Server::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/commands/server.rb

Constant Summary collapse

DEFAULT_PID_PATH =
File.expand_path("tmp/pids/server.pid").freeze

Instance Method Summary collapse

Instance Method Details

#parse!(args) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rails/commands/server.rb', line 12

def parse!(args)
  args, options = args.dup, {}
  options[:user_supplied_options] = []
  options[:user_supplied_options] << :Host if ENV["Host"]
  options[:user_supplied_options] << :Port if ENV["PORT"]

  option_parser(options).parse! args

  options[:user_supplied_options].uniq!
  options[:log_stdout] = options[:daemonize].blank? && (options[:environment] || Rails.env) == "development"
  options[:server]     = args.shift
  options
end