Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gazay
Forked from brainopia/gist:2215241
Created March 27, 2012 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gazay/2215244 to your computer and use it in GitHub Desktop.
Save gazay/2215244 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'epath'
bom = "\xEF\xBB\xBF".force_encoding('binary')
Path.glob('**/*.rb') do |file|
next if file.binread(3) == bom
previous = file.binread
file.write bom + previous
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment