Sha256: c49961d079590830bb34d041e1932eb0bbf3ebfe4e32c4196cb439770e00f608

Contents?: true

Size: 616 Bytes

Versions: 16

Compression:

Stored size: 616 Bytes

Contents

# encoding: utf-8
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

16 entries across 16 versions & 1 rubygems

Version Path
rails_best_practices-1.19.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.18.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.18.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.17.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.16.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.15.7 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.15.6 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.15.4 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.15.3 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.15.2 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.15.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.14.4 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.14.3 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.14.2 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.14.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.14.0 lib/rails_best_practices/prepares/mailer_prepare.rb