-
-
Save arbaaz/52b1a3d1e800977678b4 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
# http://stackoverflow.com/questions/4397412/read-edit-and-write-a-text-file-line-wise-using-ruby | |
# files = Dir.glob(File.dirname(__FILE__)+"/../app/**/*.rb") | |
files = Dir[Rails.root.join("app", "**/*.rb")] | |
files.each do |f_name| | |
# puts f_name | |
File.open(f_name, "r+") do |f| | |
old_pos = 0 | |
f.each do |line| | |
f.pos = old_pos # this is the 'rewind' | |
f.print line.gsub(/GxUserContacts/, "GxUserContact") | |
old_pos = f.pos | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment