This cop checks for Windows-style line endings in the source code.
# File lib/rubocop/cop/style/end_of_line.rb, line 9 def investigate(processed_source) buffer = processed_source.buffer original_source = IO.read(buffer.name, encoding: 'ascii-8bit') change_encoding(original_source) original_source.lines.each_with_index do |line, index| next unless line =~ /\r$/ add_offense(nil, source_range(buffer, processed_source[0...index], 0, line.length), MSG) # Usually there will be carriage return characters on all or none # of the lines in a file, so we report only one offense. break end end
Generated with the Darkfish Rdoc Generator 2.