Skip to content

Instantly share code, notes, and snippets.

@inohiro
Created June 14, 2012 18:15
Show Gist options
  • Save inohiro/2931913 to your computer and use it in GitHub Desktop.
Save inohiro/2931913 to your computer and use it in GitHub Desktop.
utf8_sign_inserter.rb
Dir.glob( "/home/inohiro/tmp/utf8_inserter/*.rb" ).each do |f|
File.open( f, "r+" ) do |file|
lines = file.readlines
lines.unshift "# -*- encoding: UTF-8 -*-\n"
file.rewind
lines.each do |line|
file.puts line
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment