Sha256: ab567d172817eb047b25eb8f455c530ef03facf3bdf19eb36db244328b7c700e

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 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|
            asset.instance_variable_set :@site, @environment.site if asset
          end
        end

      end
    end
  end
end


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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jekyll-assets-0.7.6 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.5 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.4 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.3 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.2 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.1 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.0 lib/jekyll/assets_plugin/patches/index_patch.rb