Takes a relative or absolute file name, a couple possible paths that the file might reside in. Returns the full path and File::Stat for the path.
# File lib/rack/reloader.rb, line 85 85: def figure_path(file, paths) 86: found = @cache[file] 87: found = file if !found and Pathname.new(file).absolute? 88: found, stat = safe_stat(found) 89: return found, stat if found 90: 91: paths.find do |possible_path| 92: path = ::File.join(possible_path, file) 93: found, stat = safe_stat(path) 94: return ::File.expand_path(found), stat if found 95: end 96: 97: return false, false 98: end
# File lib/rack/reloader.rb, line 66 66: def rotation 67: files = [$0, *$LOADED_FEATURES].uniq 68: paths = ['./', *$LOAD_PATH].uniq 69: 70: files.map{|file| 71: next if file =~ /\.(so|bundle)$/ # cannot reload compiled files 72: 73: found, stat = figure_path(file, paths) 74: next unless found && stat && mtime = stat.mtime 75: 76: @cache[file] = found 77: 78: yield(found, mtime) 79: }.compact 80: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.