Created
August 4, 2010 10:45
-
-
Save PatrickLef/507954 to your computer and use it in GitHub Desktop.
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
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