Returns an Apache-style ETag for the specified file.
[Source]
# File lib/serverside/http/static.rb, line 77 77: def self.etag(fn) 78: stat = File.stat(fn) 79: "#{stat.mtime.to_i.to_s(16)}-#{stat.size.to_s(16)}-#{stat.ino.to_s(16)}" 80: end
Returns the extension for the file name as a symbol.
# File lib/serverside/http/static.rb, line 83 83: def self.extension(fn) 84: (ext = (fn =~ /\.([^\.\/]+)$/) && $1) ? ext.to_sym : nil 85: end
[Validate]