Sha256: a8dca301e3fc7f72e714b42a8c90c714a095759876627f0b15ccca9fefd7237d

Contents?: true

Size: 659 Bytes

Versions: 10

Compression:

Stored size: 659 Bytes

Contents

# encoding: utf-8
require 'rails_best_practices/core/check'

module RailsBestPractices
  module Prepares
    # Remember the mailer names.
    class MailerPrepare < Core::Check
      include Core::Check::Classable

      interesting_nodes :class
      interesting_files MAILER_FILES, MODEL_FILES

      def initialize
        @mailers = Prepares.mailers
      end

      # check class node.
      #
      # if it is a subclass of ActionMailer::Base,
      # then remember its class name.
      add_callback :start_class do |node|
        if "ActionMailer::Base" == current_extend_class_name
          @mailers << @klass
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails_best_practices-1.13.8 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.13.5 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.13.4 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.13.3 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.13.2 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.13.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.13.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.12.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.11.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.11.0 lib/rails_best_practices/prepares/mailer_prepare.rb