Created
June 15, 2011 17:47
-
-
Save xenda/1027643 to your computer and use it in GitHub Desktop.
This file contains 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
archivos = "/home/mi_usuario/mis_webs/**/*" | |
analytics = File.read("codigo_analitica.txt") | |
Dir.glob[archivos].each do |file| | |
content = File.read file | |
content.gsub("</body>", "#{analytics}</body>") | |
File.open(file, 'rw') do |web| | |
web.write content | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment