Sha256: b791e6c326638a7649ab66bbbee6f27f13f1977620e56a916a9a06edc01a562f

Contents?: true

Size: 354 Bytes

Versions: 9

Compression:

Stored size: 354 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    class AvoidFor < Cop
      ERROR_MESSAGE = 'Prefer *each* over *for*.'

      def inspect(file, source, tokens, sexp)
        each(:for, sexp) do |s|
          add_offence(:convention,
                      s[1][1][2].lineno,
                      ERROR_MESSAGE)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubocop-0.6.1 lib/rubocop/cop/avoid_for.rb
rubocop-0.6.0 lib/rubocop/cop/avoid_for.rb
rubocop-0.5.0 lib/rubocop/cop/avoid_for.rb
rubocop-0.4.6 lib/rubocop/cop/avoid_for.rb
rubocop-0.4.5 lib/rubocop/cop/avoid_for.rb
rubocop-0.4.4 lib/rubocop/cop/avoid_for.rb
rubocop-0.4.3 lib/rubocop/cop/avoid_for.rb
rubocop-0.4.2 lib/rubocop/cop/avoid_for.rb
rubocop-0.4.1 lib/rubocop/cop/avoid_for.rb