class CabezaDeTermo::AssetsPublisher::AssetsFinder

Public Class Methods

asset_source_path_of(uri) click to toggle source

Search for the asset uri in the configured sources

# File lib/cabeza-de-termo/assets-publisher/source-finders/assets-finder.rb, line 10
def self.asset_source_path_of(uri)
        new.asset_source_path_of(uri)
end

Public Instance Methods

asset_source_path_of(uri) click to toggle source

Search for the stylesheet uri in the configured sources

# File lib/cabeza-de-termo/assets-publisher/source-finders/assets-finder.rb, line 17
def asset_source_path_of(uri)
        find_source_cotaining(uri).asset_path_of(uri)
end

Protected Instance Methods

configuration() click to toggle source

Answer the Publisher configuration.

# File lib/cabeza-de-termo/assets-publisher/source-finders/assets-finder.rb, line 34
def configuration
        Publisher.configuration
end
find_source_cotaining(uri) click to toggle source
# File lib/cabeza-de-termo/assets-publisher/source-finders/assets-finder.rb, line 23
def find_source_cotaining(uri)
        sources.detect(proc{ raise_asset_not_found_error(uri) }) do |each_source|
                each_source.has_asset?(uri)
        end
end
raise_asset_not_found_error(asset_uri) click to toggle source

Raise an asset not found error

# File lib/cabeza-de-termo/assets-publisher/source-finders/assets-finder.rb, line 39
def raise_asset_not_found_error(asset_uri)
        raise AssetNotFoundError.new(asset_uri)
end
sources() click to toggle source
# File lib/cabeza-de-termo/assets-publisher/source-finders/assets-finder.rb, line 29
def sources
        configuration.source_folders.collect { |folder| AssetsSource.on(folder) }
end