diff options
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/server/server_command.rb | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 6c4cc3cb86..20694e7e39 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -21,19 +21,6 @@ module Rails set_environment end - def app - @app ||= begin - app = super - if app.is_a?(Class) - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Using `Rails::Application` subclass to start the server is deprecated and will be removed in Rails 6.0. - Please change `run #{app}` to `run Rails.application` in config.ru. - MSG - end - app.respond_to?(:to_app) ? app.to_app : app - end - end - def opt_parser Options.new end @@ -111,8 +98,6 @@ module Rails DEFAULT_PORT = 3000 DEFAULT_PID_PATH = "tmp/pids/server.pid" - argument :using, optional: true - class_option :port, aliases: "-p", type: :numeric, desc: "Runs Rails on the specified port - defaults to 3000.", banner: :port class_option :binding, aliases: "-b", type: :string, @@ -139,7 +124,6 @@ module Rails super @original_options = local_options - %w( --restart ) - deprecate_positional_rack_server_and_rewrite_to_option(@original_options) end def perform @@ -157,7 +141,7 @@ module Rails after_stop_callback = -> { say "Exiting" unless options[:daemon] } server.start(after_stop_callback) else - say rack_server_suggestion(using) + say rack_server_suggestion(options[:using]) end end end @@ -166,7 +150,7 @@ module Rails def server_options { user_supplied_options: user_supplied_options, - server: using, + server: options[:using], log_stdout: log_to_stdout?, Port: port, Host: host, @@ -275,22 +259,6 @@ module Rails FileUtils.rm_f(options[:pid]) if options[:restart] end - def deprecate_positional_rack_server_and_rewrite_to_option(original_options) - if using - ActiveSupport::Deprecation.warn(<<~MSG) - Passing the Rack server name as a regular argument is deprecated - and will be removed in the next Rails version. Please, use the -u - option instead. - MSG - - original_options.concat [ "-u", using ] - else - # Use positional internally to get around Thor's immutable options. - # TODO: Replace `using` occurrences with `options[:using]` after deprecation removal. - @using = options[:using] - end - end - def rack_server_suggestion(server) if server.in?(RACK_SERVERS) <<~MSG |