Skip to content

Commit 553b86f

Browse files
committed
Remove deprecated support to old config.ru that use the application class as argument of run
1 parent e20589c commit 553b86f

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

railties/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated support to old `config.ru` that use the application class as argument of `run`.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove deprecated `environment` argument from the rails commands.
26

37
*Rafael Mendonça França*

railties/lib/rails/commands/server/server_command.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@ def initialize(options = nil)
2121
set_environment
2222
end
2323

24-
def app
25-
@app ||= begin
26-
app = super
27-
if app.is_a?(Class)
28-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
29-
Using `Rails::Application` subclass to start the server is deprecated and will be removed in Rails 6.0.
30-
Please change `run #{app}` to `run Rails.application` in config.ru.
31-
MSG
32-
end
33-
app.respond_to?(:to_app) ? app.to_app : app
34-
end
35-
end
36-
3724
def opt_parser
3825
Options.new
3926
end

railties/test/application/server_test.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@ def teardown
1818
teardown_app
1919
end
2020

21-
test "deprecate support of older `config.ru`" do
22-
remove_file "config.ru"
23-
app_file "config.ru", <<-RUBY
24-
require_relative 'config/environment'
25-
run AppTemplate::Application
26-
RUBY
27-
28-
server = Rails::Server.new(config: "#{app_path}/config.ru")
29-
server.app
30-
31-
log = File.read(Rails.application.config.paths["log"].first)
32-
assert_match(/DEPRECATION WARNING: Using `Rails::Application` subclass to start the server is deprecated/, log)
33-
end
34-
3521
test "restart rails server with custom pid file path" do
3622
skip "PTY unavailable" unless available_pty?
3723

0 commit comments

Comments
 (0)