Sha256: d5560546b58e38dd4dfa40df46e9e8fb7e858546ec47bb677572acb5ca6467ec

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

# stdlib
require "set"


module Jekyll
  module AssetsPlugin
    module Patches
      module ContextPatch

        def site
          self.class.instance_variable_get :@site
        end


        def jekyll_assets
          @jekyll_assets ||= Set.new
        end


        def asset_path pathname, *args
          asset = resolve(pathname.to_s[/^[^#?]+/]).to_s
          jekyll_assets << asset
          (site.asset_path asset, *args) + (pathname.to_s[/[#?].+/] || '')
        rescue Sprockets::FileNotFound
          raise Environment::AssetNotFound, pathname
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-assets-0.7.4 lib/jekyll/assets_plugin/patches/context_patch.rb