Sha256: 13ad335badcfbc2733a55e8db7d73c280631f8bbcde434d26c1f5e07fcf2c1ba

Contents?: true

Size: 645 Bytes

Versions: 10

Compression:

Stored size: 645 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.
      def start_class(node)
        if "ActionMailer::Base" == current_extend_class_name
          @mailers << @klass
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rails_best_practices-1.10.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-gorgeouscode-1.0.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.10.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.9.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.9.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.8.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.7.2 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.7.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.7.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.6.0 lib/rails_best_practices/prepares/mailer_prepare.rb