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 84
84:       def figure_path(file, paths)
85:         found = @cache[file]
86:         found = file if !found and Pathname.new(file).absolute?
87:         found, stat = safe_stat(found)
88:         return found, stat if found
89: 
90:         paths.each do |possible_path|
91:           path = ::File.join(possible_path, file)
92:           found, stat = safe_stat(path)
93:           return ::File.expand_path(found), stat if found
94:         end
95:       end
rotation() click to toggle source

(Not documented)

    # File lib/rack/reloader.rb, line 65
65:       def rotation
66:         files = [$0, *$LOADED_FEATURES].uniq
67:         paths = ['./', *$LOAD_PATH].uniq
68: 
69:         files.map{|file|
70:           next if file =~ /\.(so|bundle)$/ # cannot reload compiled files
71: 
72:           found, stat = figure_path(file, paths)
73:           next unless found and stat and mtime = stat.mtime
74: 
75:           @cache[file] = found
76: 
77:           yield(found, mtime)
78:         }.compact
79:       end
safe_stat(file) click to toggle source

(Not documented)

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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.