Class Index [+]

Quicksearch

Rack::Reloader::Stat

Public Instance Methods

figure_path(file, paths) click to toggle source

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
rotation() click to toggle source

(Not documented)

    # 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
safe_stat(file) click to toggle source

(Not documented)

     # File lib/rack/reloader.rb, line 100
100:       def safe_stat(file)
101:         return unless file
102:         stat = ::File.stat(file)
103:         return file, stat if stat.file?
104:       rescue Errno::ENOENT, Errno::ENOTDIR
105:         @cache.delete(file) and false
106:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.