Skip to content

Instantly share code, notes, and snippets.

@texel
Created February 19, 2013 19:21
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 texel/4988973 to your computer and use it in GitHub Desktop.
Save texel/4988973 to your computer and use it in GitHub Desktop.
# Monkey patch Autotest...
class Autotest
def find_files
result = {}
targets = self.find_directories + self.extra_files
self.find_order.clear
targets.each do |target|
begin
order = []
Find.find target do |f|
Find.prune if f =~ self.exceptions
next if test ?d, f
next if f =~ /(swp|~|rej|orig)$/ # temporary/patch files
next if f =~ /^\.\/tmp/ # temporary dir, used by isolate
next if f =~ /\/\.?#/ # Emacs autosave/cvs merge files
filename = f.sub(/^\.\//, '')
result[filename] = File.stat(filename).mtime rescue next
order << filename
end
self.find_order.push(*order.sort)
rescue Errno::ENOENT => e
puts "target: #{target}"
# raise e
end
end
result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment