module Gluey::AssetRetrieving
Constants
- MARK_PARSER
Public Instance Methods
assets_path()
click to toggle source
# File lib/gluey/warehouse/asset_retrieving.rb, line 26 def assets_path @assets_path ||= "#{root}/public#{path_prefix}" end
fetch(asset_type, path, mark=nil)
click to toggle source
# File lib/gluey/warehouse/asset_retrieving.rb, line 15 def fetch(asset_type, path, mark=nil) extant_path = real_path asset_type, path return unless mark == extant_path.match(MARK_PARSER)[1] file = "#{assets_path}/#{asset_type}/#{extant_path}" file if File.exists? file rescue ::Gluey::ListingError nil end
real_path(asset_type, path)
click to toggle source
# File lib/gluey/warehouse/asset_retrieving.rb, line 5 def real_path(asset_type, path) list = @listing[asset_type] raise ::Gluey::ListingError.new("Asset type #{asset_type} is not defined!") unless list real_path = list[path] raise ::Gluey::ListingError.new("Unknown asset: #{path}, type=#{asset_type}!") unless real_path real_path end