Sha256: c734c059ed18e4a15c15ee8a9677bf4f25bbde8085ddc127031a74ee60059903

Contents?: true

Size: 648 Bytes

Versions: 16

Compression:

Stored size: 648 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)
          return "" if pathname.to_s.strip.empty?
          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

16 entries across 16 versions & 2 rubygems

Version Path
jekyll-assets-0.13.0 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.12.1 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.12.0 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.11.0 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.10.1 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.10.0 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.9.2 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.9.1 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.9.0 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.8.1 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.8.0 lib/jekyll/assets_plugin/patches/context_patch.rb
tgfa-jekyll-assets-0.7.9.2 lib/jekyll/assets_plugin/patches/context_patch.rb
tgfa-jekyll-assets-0.7.9.1 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.7.9 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.7.8 lib/jekyll/assets_plugin/patches/context_patch.rb
jekyll-assets-0.7.7 lib/jekyll/assets_plugin/patches/context_patch.rb