Skip to content

Commit

Permalink
Remove deprecated support to old config.ru that use the application…
Browse files Browse the repository at this point in the history
… class as argument of `run`
  • Loading branch information
rafaelfranca committed Jan 17, 2019
1 parent e20589c commit 553b86f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
4 changes: 4 additions & 0 deletions railties/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Remove deprecated support to old `config.ru` that use the application class as argument of `run`.

*Rafael Mendonça França*

* Remove deprecated `environment` argument from the rails commands.

*Rafael Mendonça França*
Expand Down
13 changes: 0 additions & 13 deletions railties/lib/rails/commands/server/server_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ def initialize(options = nil)
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
Expand Down
14 changes: 0 additions & 14 deletions railties/test/application/server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@ def teardown
teardown_app
end

test "deprecate support of older `config.ru`" do
remove_file "config.ru"
app_file "config.ru", <<-RUBY
require_relative 'config/environment'
run AppTemplate::Application
RUBY

server = Rails::Server.new(config: "#{app_path}/config.ru")
server.app

log = File.read(Rails.application.config.paths["log"].first)
assert_match(/DEPRECATION WARNING: Using `Rails::Application` subclass to start the server is deprecated/, log)
end

test "restart rails server with custom pid file path" do
skip "PTY unavailable" unless available_pty?

Expand Down

0 comments on commit 553b86f

Please sign in to comment.