Created
August 10, 2010 13:23
-
-
Save Paxa/517249 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
... | |
# including fix manualy, becouse loading lib/**/*.rb happends in Padrino.load! | |
require "lib/reloader_fix" | |
Padrino::Reloader::Stat.skip_folders = %W{photos utilites vertex-lib importers} | |
Padrino.load! |
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
module Padrino | |
module Reloader | |
module Stat | |
class << self | |
# this fix skips [public log tmp] folders and allow to skip folders what you pass in | |
# Padrino::Reloader::Stat.skip_folders = [folders] | |
# this line | |
attr_accessor :skip_folders | |
def rotation | |
paths = Dir[Padrino.root("*")].unshift(Padrino.root).reject { |path| !File.directory?(path) } | |
# and this 2 lines | |
@skip_folders = Array(@skip_folders) | %W{public log tmp} | |
paths -= @skip_folders.map {|folder| Padrino.root(folder) } | |
files = paths.map { |path| Dir["#{path}/**/*.rb"] }.flatten | |
files.map{ |file| | |
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 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment