Advertisement
Guest User

Untitled

a guest
Jan 16th, 2014
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.35 KB | None | 0 0
  1. def cache_bust(target)
  2.   class << @site
  3.     attr_accessor :cache_bust_map
  4.   end
  5.   @site.cache_bust_map ||= {}
  6.   @site.cache_bust_map[target] ||= begin
  7.     require 'xxhash'
  8.     if target.is_a? String
  9.       target = @items[target]
  10.     end
  11.     relativize_path(target) + "?#{XXhash.xxh32(target.compiled_content, target.checksum.to_i)}"
  12.   end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement