Sha256: f01a3d56a9ac3dc73f5a3d7939dd1c12fca396f7ac3a73cdfacbd283ac25d3d3

Contents?: true

Size: 634 Bytes

Versions: 2

Compression:

Stored size: 634 Bytes

Contents

# 3rd-party
require "sprockets"


module Jekyll
  module AssetsPlugin
    module Patches
      module IndexPatch

        def self.included base
          base.class_eval do
            alias_method :__orig_find_asset, :find_asset
            alias_method :find_asset, :__wrap_find_asset
          end
        end


        def __wrap_find_asset path, options = {}
          __orig_find_asset(path, options).tap do |asset|
            @environment.site.bundle_asset! asset if asset and options[:bundle]
          end
        end

      end
    end
  end
end


Sprockets::Index.send :include, Jekyll::AssetsPlugin::Patches::IndexPatch

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-assets-0.6.1 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.6.0 lib/jekyll/assets_plugin/patches/index_patch.rb