Sha256: 05a02682012513be39133f0d5af9fc3b7707e0cb1a50d69cc3862230d42cd214
Contents?: true
Size: 779 Bytes
Versions: 4
Compression:
Stored size: 779 Bytes
Contents
# encoding: utf-8 module Middleman module Sprockets class AssetList attr_reader :assets def initialize(assets = []) @assets = Array(assets) end # Find candidate in list # # @param [#source_path] candidate # The candidate to search for # # @yield # This blocks gets the candidate found def lookup(candidate, &block) found_asset = assets.find { |a| a.match? candidate.source_path } block.call(candidate, found_asset) if block_given? && found_asset found_asset end # Append asset to list # # @param [Asset] # The asset to be appended def add(asset) assets << asset end alias_method :<<, :add end end end
Version data entries
4 entries across 4 versions & 1 rubygems