Skip to content

Instantly share code, notes, and snippets.

@PatrickLef
Created August 4, 2010 10:45
Show Gist options
  • Save PatrickLef/507954 to your computer and use it in GitHub Desktop.
Save PatrickLef/507954 to your computer and use it in GitHub Desktop.
module Padrino
module Reloader
module Stat
class << self
def rotation
paths = Dir[Padrino.root("*")].unshift(Padrino.root).reject { |path| !File.directory?(path) }
files = paths.map { |path| Dir["#{path}/**/*.rb"] }.flatten.uniq
files.map{ |file|
p file # => Output file to terminal
next if Padrino::Reloader.exclude.any? { |base| file =~ /^#{base}/ }
found, stat = figure_path(file, paths)
next unless found && stat && mtime = stat.mtime
CACHE[file] = found
yield(found, mtime)
}.compact
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment