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
namespace :source do | |
def find_and_replace_in_source_files(find, replace) | |
puts "Search and replace #{find.inspect} => #{replace.inspect}" | |
files = %w[ .autotest .rspec .rvmrc Gemfile Procfile config.ru ].select{|f| File.exist?(f) } | |
directories = %w[app config lib public script spec test] # exclude bin, db, doc, log, and tmp | |
directories.each do |d| | |
files += Dir[File.join(d, "**/*.{rb,rake,haml,erb,builder,js,coffee,css,scss}")] | |
end |