Methods
- P
Instance Public methods
# File railties/lib/rails/commands/server.rb, line 8 8: def parse!(args) 9: args, options = args.dup, {} 10: 11: opt_parser = OptionParser.new do |opts| 12: opts.banner = "Usage: rails server [mongrel, thin, etc] [options]" 13: opts.on("-p", "--port=port", Integer, 14: "Runs Rails on the specified port.", "Default: 3000") { |v| options[:Port] = v } 15: opts.on("-b", "--binding=ip", String, 16: "Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| options[:Host] = v } 17: opts.on("-c", "--config=file", String, 18: "Use custom rackup configuration file") { |v| options[:config] = v } 19: opts.on("-d", "--daemon", "Make server run as a Daemon.") { options[:daemonize] = true } 20: opts.on("-u", "--debugger", "Enable ruby-debugging for the server.") { options[:debugger] = true } 21: opts.on("-e", "--environment=name", String, 22: "Specifies the environment to run this server under (test/development/production).", 23: "Default: development") { |v| options[:environment] = v } 24: opts.on("-P","--pid=pid",String, 25: "Specifies the PID file.", 26: "Default: tmp/pids/server.pid") { |v| options[:pid] = v } 27: 28: opts.separator "" 29: 30: opts.on("-h", "--help", "Show this help message.") { puts opts; exit } 31: end 32: 33: opt_parser.parse! args 34: 35: options[:server] = args.shift 36: options 37: end