class Linner::Cache

Public Instance Methods

expire_by(paths) click to toggle source
# File lib/linner/cache.rb, line 12
def expire_by paths
  is_include_partial_styles = paths.any? do |path|
    Asset.new(path).stylesheet? and File.basename(path).start_with? "_"
  end
  self.reject! {|k, v| v.stylesheet?} if is_include_partial_styles
end
miss?(ns, path) click to toggle source
# File lib/linner/cache.rb, line 3
def miss? ns, path
  asset = Asset.new path
  if self["#{ns}:#{path}"] and self["#{ns}:#{path}"].mtime == asset.mtime
    false
  else
    self["#{ns}:#{path}"] = asset
  end
end