Sha256: 206dfd1d70ea77af40a601e28e397dbc441684dc9a2a4bcf6e44e17569f1dfe3
Contents?: true
Size: 1.45 KB
Versions: 1
Compression:
Stored size: 1.45 KB
Contents
# 3rd-party require "sprockets" module Jekyll module AssetsPlugin module Patches module AssetPatch def self.included base base.send :extend, ClassMethods base.send :include, InstanceMethods end module ClassMethods def mtimes @mtimes ||= Hash.new end end module InstanceMethods attr_reader :site def jekyll_assets [] end def destination dest File.join dest, site.assets_config.dirname, filename end def filename case cachebust = site.assets_config.cachebust when :none, :soft then logical_path when :hard then digest_path else raise "Unknown cachebust strategy: #{cachebust.inspect}" end end def modified? self.class.mtimes[pathname.to_s] != mtime.to_i end def write dest dest_path = destination dest return false if File.exist?(dest_path) and !modified? self.class.mtimes[pathname.to_s] = mtime.to_i write_to dest_path write_to "#{dest_path}.gz" if gzip? true end def gzip? site.assets_config.gzip.include? content_type end end end end end end Sprockets::Asset.send :include, Jekyll::AssetsPlugin::Patches::AssetPatch
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jekyll-assets-0.7.0 | lib/jekyll/assets_plugin/patches/asset_patch.rb |