Skip to content

Instantly share code, notes, and snippets.

@razenha
razenha / check_header_utf8.rb
Created July 15, 2012 21:14
A small ruby script that checks if all the .rb files in the given project starts with "# encoding: utf-8"
# encoding: utf-8
class String
def starts_with?(prefix)
prefix = prefix.to_s
self[0, prefix.length] == prefix
end
end
all_files = Dir["./**/*.rb"]
all_files.each do |file|