Skip to content

Commit

Permalink
Fix deprecation warning by passing a deprecator
Browse files Browse the repository at this point in the history
Note, this deprecation was originally done for zeitwerk/namespace loading
and should be removed soon.  It was added originally in:
9e0de20
  • Loading branch information
jrafanie committed Oct 30, 2024
1 parent 6fb02d3 commit 90a75bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/manageiq/reporting/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ module Formatter
# Deprecate the constants within ReportFormatter with a helpful replacement.
module ReportFormatter
include ActiveSupport::Deprecation::DeprecatedConstantAccessor
deprecate_constant :BLANK_VALUE, 'ManageIQ::Reporting::Formatter::BLANK_VALUE'
deprecate_constant :CRLF, 'ManageIQ::Reporting::Formatter::CRLF'
deprecate_constant :LABEL_LENGTH, 'ManageIQ::Reporting::Formatter::LABEL_LENGTH'
deprecate_constant :LEGEND_LENGTH, 'ManageIQ::Reporting::Formatter::LEGEND_LENGTH'
deprecate_constant :BLANK_VALUE, 'ManageIQ::Reporting::Formatter::BLANK_VALUE', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :CRLF, 'ManageIQ::Reporting::Formatter::CRLF', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :LABEL_LENGTH, 'ManageIQ::Reporting::Formatter::LABEL_LENGTH', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :LEGEND_LENGTH, 'ManageIQ::Reporting::Formatter::LEGEND_LENGTH', :deprecator => Vmdb::Deprecation.deprecator

deprecate_constant :C3Formatter, 'ManageIQ::Reporting::Formatter::C3'
deprecate_constant :C3Series, 'ManageIQ::Reporting::Formatter::C3Series'
deprecate_constant :C3Charting, 'ManageIQ::Reporting::Formatter::C3Charting'
deprecate_constant :ChartCommon, 'ManageIQ::Reporting::Formatter::ChartCommon'
deprecate_constant :Converter, 'ManageIQ::Reporting::Formatter::Converter'
deprecate_constant :ReportHTML, 'ManageIQ::Reporting::Formatter::Html'
deprecate_constant :ReportRenderer, 'ManageIQ::Reporting::Formatter::ReportRenderer'
deprecate_constant :ReportText, 'ManageIQ::Reporting::Formatter::Text'
deprecate_constant :ReportTimeline, 'ManageIQ::Reporting::Formatter::Timeline'
deprecate_constant :TimelineMessage, 'ManageIQ::Reporting::Formatter::TimelineMessage'
deprecate_constant :C3Formatter, 'ManageIQ::Reporting::Formatter::C3', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :C3Series, 'ManageIQ::Reporting::Formatter::C3Series', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :C3Charting, 'ManageIQ::Reporting::Formatter::C3Charting', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :ChartCommon, 'ManageIQ::Reporting::Formatter::ChartCommon', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :Converter, 'ManageIQ::Reporting::Formatter::Converter', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :ReportHTML, 'ManageIQ::Reporting::Formatter::Html', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :ReportRenderer, 'ManageIQ::Reporting::Formatter::ReportRenderer', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :ReportText, 'ManageIQ::Reporting::Formatter::Text', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :ReportTimeline, 'ManageIQ::Reporting::Formatter::Timeline', :deprecator => Vmdb::Deprecation.deprecator
deprecate_constant :TimelineMessage, 'ManageIQ::Reporting::Formatter::TimelineMessage', :deprecator => Vmdb::Deprecation.deprecator
end
1 change: 1 addition & 0 deletions lib/vmdb/deprecation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def self.respond_to_missing?(method, _include_private = false)
end

class << self
alias_method :deprecator, :instance
delegate :silence, :warn, :to => :instance
end

Expand Down

0 comments on commit 90a75bf

Please sign in to comment.