Sha256: f9e83f5138eff2bcfde2252e63ced47fd6061be771089c96f92843747552c5a2

Contents?: true

Size: 676 Bytes

Versions: 4

Compression:

Stored size: 676 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Style
      # This cop checks for Windows-style line endings in the source code.
      class EndOfLine < Cop
        MSG = 'Carriage return character detected.'

        def investigate(processed_source)
          processed_source.lines.each_with_index do |line, index|
            if line =~ /\r$/
              convention(nil,
                         source_range(processed_source.buffer,
                                      processed_source[0...index],
                                      line.length - 1, 1),
                         MSG)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.14.1 lib/rubocop/cop/style/end_of_line.rb
rubocop-0.14.0 lib/rubocop/cop/style/end_of_line.rb
rubocop-0.13.1 lib/rubocop/cop/style/end_of_line.rb
rubocop-0.13.0 lib/rubocop/cop/style/end_of_line.rb