Class: Shirobai::Cop::Rails::ApplicationMailer
- Inherits:
-
RuboCop::Cop::Base
- Object
- RuboCop::Cop::Base
- Shirobai::Cop::Rails::ApplicationMailer
- Extended by:
- RuboCop::Cop::AutoCorrector, RuboCop::Cop::TargetRailsVersion
- Includes:
- BundleEligible
- Defined in:
- lib/shirobai/cop/rails/application_mailer.rb
Overview
Drop-in Rust reimplementation of Rails/ApplicationMailer
(rubocop-rails 2.35.5). See ApplicationRecord for the shared
EnforceSuperclass semantics and offense/autocorrect ranges. Gated on
requires_gem('railties', '>= 5.0') like stock.
Constant Summary collapse
- MSG =
"Mailers should subclass `ApplicationMailer`."- SUPERCLASS =
"ApplicationMailer"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.badge ⇒ Object
21 |
# File 'lib/shirobai/cop/rails/application_mailer.rb', line 21 def self.badge = RuboCop::Cop::Badge.parse(cop_name) |
.bundle_args(_config) ⇒ Object
23 24 25 |
# File 'lib/shirobai/cop/rails/application_mailer.rb', line 23 def self.bundle_args(_config) [] end |
.cop_name ⇒ Object
20 |
# File 'lib/shirobai/cop/rails/application_mailer.rb', line 20 def self.cop_name = "Rails/ApplicationMailer" |
Instance Method Details
#on_new_investigation ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/shirobai/cop/rails/application_mailer.rb', line 27 def on_new_investigation buffer = processed_source.buffer source = bundle_eligible? ? processed_source.raw_source : buffer.source off = SourceOffsets.for(source) resolved_offenses.each do |start_offset, end_offset| range = Parser::Source::Range.new(buffer, off[start_offset], off[end_offset]) add_offense(range, message: MSG) do |corrector| corrector.replace(range, self.class::SUPERCLASS) end end end |