Sha256: 16cd225c3b9adb849cd0a136cf192378beaeab982854702c9af17825f8a3ec11

Contents?: true

Size: 664 Bytes

Versions: 3

Compression:

Stored size: 664 Bytes

Contents

# stdlib
require "set"

module Jekyll
  module Assets
    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)
          pathname = pathname.to_s.strip

          return "" if pathname.empty?

          asset = resolve(pathname[/^[^#?]+/]).to_s
          jekyll_assets << asset

          site.asset_path(asset, *args) + (pathname[/[#?].+/] || "")
        rescue Sprockets::FileNotFound
          raise Environment::AssetNotFound, pathname
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-assets-1.0.0 lib/jekyll/assets/patches/context_patch.rb
jekyll-assets-1.0.0.pre.alpha1 lib/jekyll/assets/patches/context_patch.rb
jekyll-assets-1.0.0.pre.alpha0 lib/jekyll/assets/patches/context_patch.rb