Sha256: da27ef9bb310cc5a8c9df78191d0bb2ec243096924a4e82e4c1b214a7aa044e4

Contents?: true

Size: 501 Bytes

Versions: 28

Compression:

Stored size: 501 Bytes

Contents

module Linner
  class Cache < Hash
    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

    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
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
linner-hc-1.0.0 lib/linner/cache.rb
linner-0.12.0 lib/linner/cache.rb
linner-0.11.6 lib/linner/cache.rb
linner-0.11.5 lib/linner/cache.rb
linner-0.11.4 lib/linner/cache.rb
linner-0.11.3 lib/linner/cache.rb
linner-0.11.2 lib/linner/cache.rb
linner-0.11.1 lib/linner/cache.rb
linner-0.11.0 lib/linner/cache.rb
linner-0.10.0 lib/linner/cache.rb
linner-0.9.1 lib/linner/cache.rb
linner-0.9.0 lib/linner/cache.rb
linner-0.8.7 lib/linner/cache.rb
linner-0.8.6 lib/linner/cache.rb
linner-0.8.5 lib/linner/cache.rb
linner-0.8.4 lib/linner/cache.rb
linner-0.8.3 lib/linner/cache.rb
linner-0.8.2 lib/linner/cache.rb
linner-0.8.1 lib/linner/cache.rb
linner-0.8.0 lib/linner/cache.rb