diff options
author | Leonel Galán <leonel@getstealz.com> | 2017-05-17 15:23:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 15:23:21 -0400 |
commit | 0804e58e1e6a52190a950f863622102b6b21ccb8 (patch) | |
tree | a2d9887906bd2c472edc54907362b93a57f52f0f /railties/lib/rails/commands/server/server_command.rb | |
parent | f5b2a0ef408f01dd9f12b456f5e4bb41ebb4cb76 (diff) | |
parent | 385d9af299fbfac7f063de214d371545bafef5df (diff) | |
download | rails-0804e58e1e6a52190a950f863622102b6b21ccb8.tar.gz rails-0804e58e1e6a52190a950f863622102b6b21ccb8.tar.bz2 rails-0804e58e1e6a52190a950f863622102b6b21ccb8.zip |
Merge branch 'master' into bug/filtered_parameters_class
Diffstat (limited to 'railties/lib/rails/commands/server/server_command.rb')
-rw-r--r-- | railties/lib/rails/commands/server/server_command.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 278fe63c51..cf3903f3ae 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -95,10 +95,11 @@ module Rails module Command class ServerCommand < Base # :nodoc: + DEFAULT_PORT = 3000 DEFAULT_PID_PATH = "tmp/pids/server.pid".freeze class_option :port, aliases: "-p", type: :numeric, - desc: "Runs Rails on the specified port.", banner: :port, default: 3000 + desc: "Runs Rails on the specified port - defaults to 3000.", banner: :port class_option :binding, aliases: "-b", type: :string, desc: "Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.", banner: :IP @@ -184,7 +185,7 @@ module Rails end def port - ENV.fetch("PORT", options[:port]).to_i + options[:port] || ENV.fetch("PORT", DEFAULT_PORT).to_i end def host |