Created
February 10, 2011 08:37
-
-
Save moro/820146 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/moro/opt/ruby192/bin/ruby | |
magicome = "# coding: #{Encoding.default_external.to_s.downcase}" | |
ARGV.each do |fname| | |
File.open(fname, 'r+:BINARY') do |src| | |
content = src.read | |
src.rewind | |
src.puts magicome | |
src.write content | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment