Sha256: 2c71168c00da5fa298d81955478266bc63582a8ff8691b107e454771651e549e

Contents?: true

Size: 526 Bytes

Versions: 3

Compression:

Stored size: 526 Bytes

Contents

#!/usr/bin/env ruby
require 'fileutils'
require 'bad_encodings'

if ARGV[0] && File.exists?(ARGV[0])
  dir = ARGV[0]
else
  raise ArgumentError, "must supply a directory"
end

raise ArgumentError, "Requires Ruby 1.9" unless RUBY_VERSION > '1.9'
dir = File.expand_path(dir)
bad_lines = BadEncodings.find_lines_in_path(dir)
unless bad_lines.empty?
  puts 'The following bad encodings were found:'
  bad_lines.each do |line|
    puts "[%s:%d]" % [line[0].sub(dir,ARGV[0]), line[1]]
  end
else
  puts 'No bad encodings found'
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
adamsalter-bad_encodings-ruby19-0.1.1 bin/find_bad_encodings
adamsalter-bad_encodings-ruby19-0.1.2 bin/find_bad_encodings
bad_encodings-ruby19-0.1.2 bin/find_bad_encodings