Sha256: 1377fb4ce433d899d4c74cfc84afcb6b271b7239639f72f7ae561e6196004a12

Contents?: true

Size: 543 Bytes

Versions: 5

Compression:

Stored size: 543 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Lint
      # This cop checks for uses of *begin...end while/until something*.
      class Loop < Cop
        MSG = 'Use Kernel#loop with break rather than ' +
              'begin/end/until(or while).'

        def on_while_post(node)
          register_offence(node)
        end

        def on_until_post(node)
          register_offence(node)
        end

        private

        def register_offence(node)
          warning(node, :keyword)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-0.15.0 lib/rubocop/cop/lint/loop.rb
rubocop-0.14.1 lib/rubocop/cop/lint/loop.rb
rubocop-0.14.0 lib/rubocop/cop/lint/loop.rb
rubocop-0.13.1 lib/rubocop/cop/lint/loop.rb
rubocop-0.13.0 lib/rubocop/cop/lint/loop.rb