Sha256: 883a176c6cfc981e2f6dcee4286575adae9d1b735986c490b72b0b8b8fb2fbfb

Contents?: true

Size: 613 Bytes

Versions: 1

Compression:

Stored size: 613 Bytes

Contents

require 'simplabs/excellent/checks/base'

module Simplabs

  module Excellent

    module Checks

      class NameCheck < Base #:nodoc:

        def initialize(interesting_contexts, pattern, whitelist = [])
          super()
          @interesting_contexts = interesting_contexts
          @pattern              = pattern
          @whitelist            = whitelist
        end

        def evaluate(context)
          name = context.name.to_s
          if !@whitelist.include?(name) && !(name =~ @pattern)
            add_warning(*warning_args(context))
          end
        end

      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
excellent-1.7.2 lib/simplabs/excellent/checks/name_check.rb