Skip to content

Commit 16ab507

Browse files
Merge pull request rails#46401 from jonathanhefner/other-framework-deprecators
Add other framework deprecators
2 parents 029a603 + 7479485 commit 16ab507

File tree

14 files changed

+56
-2
lines changed

14 files changed

+56
-2
lines changed

actioncable/lib/action_cable.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
Zeitwerk::Loader.for_gem.tap do |loader|
3131
loader.ignore(
3232
"#{__dir__}/rails", # Contains generators, templates, docs, etc.
33-
"#{__dir__}/action_cable/gem_version.rb"
33+
"#{__dir__}/action_cable/gem_version.rb",
34+
"#{__dir__}/action_cable/deprecator.rb",
3435
)
3536

3637
loader.do_not_eager_load(
@@ -44,6 +45,7 @@
4445

4546
module ActionCable
4647
require_relative "action_cable/version"
48+
require_relative "action_cable/deprecator"
4749

4850
INTERNAL = {
4951
message_types: {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
module ActionCable
4+
def self.deprecator # :nodoc:
5+
@deprecator ||= ActiveSupport::Deprecation.new
6+
end
7+
end

actioncable/lib/action_cable/engine.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ class Engine < Rails::Engine # :nodoc:
1010
config.action_cable.mount_path = ActionCable::INTERNAL[:default_mount_path]
1111
config.action_cable.precompile_assets = true
1212

13+
initializer "action_cable.deprecator" do |app|
14+
app.deprecators[:action_cable] = ActionCable.deprecator
15+
end
16+
1317
initializer "action_cable.helpers" do
1418
ActiveSupport.on_load(:action_view) do
1519
include ActionCable::Helpers::ActionCableHelper

actionmailbox/lib/action_mailbox.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require "action_mailbox/deprecator"
34
require "action_mailbox/mail_ext"
45

56
module ActionMailbox
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
module ActionMailbox
4+
def self.deprecator # :nodoc:
5+
@deprecator ||= ActiveSupport::Deprecation.new
6+
end
7+
end

actionmailbox/lib/action_mailbox/engine.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ class Engine < Rails::Engine
2222

2323
config.action_mailbox.storage_service = nil
2424

25+
initializer "action_mailbox.deprecator" do |app|
26+
app.deprecators[:action_mailbox] = ActionMailbox.deprecator
27+
end
28+
2529
initializer "action_mailbox.config" do
2630
config.after_initialize do |app|
2731
ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger

actiontext/lib/action_text.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require "active_support"
44
require "active_support/rails"
55

6+
require "action_text/deprecator"
7+
68
require "nokogiri"
79

810
module ActionText
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
module ActionText
4+
def self.deprecator # :nodoc:
5+
@deprecator ||= ActiveSupport::Deprecation.new
6+
end
7+
end

actiontext/lib/action_text/engine.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class Engine < Rails::Engine
1919
#{root}/app/models
2020
)
2121

22+
initializer "action_text.deprecator" do |app|
23+
app.deprecators[:action_text] = ActionText.deprecator
24+
end
25+
2226
initializer "action_text.attribute" do
2327
ActiveSupport.on_load(:active_record) do
2428
include ActionText::Attribute

activemodel/lib/active_model.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
require "active_support"
2727
require "active_support/rails"
2828
require "active_model/version"
29+
require "active_model/deprecator"
2930

3031
module ActiveModel
3132
extend ActiveSupport::Autoload

0 commit comments

Comments
 (0)