Skip to content

Instantly share code, notes, and snippets.

@xenda
Created June 15, 2011 17:47
Show Gist options
  • Save xenda/1027643 to your computer and use it in GitHub Desktop.
Save xenda/1027643 to your computer and use it in GitHub Desktop.
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