Module: Sinatra::CssSupport::Helpers

Defined in:
lib/sinatra/support/csssupport.rb

Instance Method Summary collapse

Instance Method Details

#css_mtime_for(prefix = nil, fname) ⇒ Object



94
95
96
97
98
99
100
101
# File 'lib/sinatra/support/csssupport.rb', line 94

def css_mtime_for(prefix=nil, fname)
  if settings.css_aggressive_mtime
    prefix ||= File.basename(fname)
    Dir[prefix, "**/*"].map { |f| File.mtime(f).to_i }.max
  else
    File.mtime(fname).to_i
  end
end