# File raggle, line 5232 def Engine::get_file_url(url, last_modified = nil) ret = [nil, nil] # work with a copy of the url path = url.dup # strip 'file:' prefix from URL path.gsub!(/^\w+?:/, '') if path =~ /^\w+?:/ if stat = File::stat(path) stat_mtime = stat.mtime.to_s if last_modified # check last-modified header first if last_modified == stat_mtime # it's the same as the old content ret = [nil, last_modified] else # it's changed, get it again ret = get_file_url(url, nil) end else # no cache, just get the result if file = File::open(path) ret = [file.read, stat_mtime] file.close else raise "Couldn't open file URL: #$!" end end else raise "File URL Error: #$!" end # return URL content and last-modified header ret end