Sha256: e86c001ab06542dff0e2cdec817862e7515d49775801fe0a573d3c39fe032f04
Contents?: true
Size: 851 Bytes
Versions: 1
Compression:
Stored size: 851 Bytes
Contents
module Sprockets module Helpers # `AssetPath` generates a full path for an asset # that exists in Sprockets environment. class AssetPath < FilePath # def initialize(asset, options = {}) @options = { :body => false, :digest => Helpers.digest, :prefix => Helpers.prefix }.merge options @source = @options[:digest] ? asset.digest_path : asset.logical_path end protected # Prepends the base path if the path is not # already an absolute path. def rewrite_base_path(path) # :nodoc: File.join @options[:prefix].to_s, path end # Rewrite the query string to inlcude body flag if necessary. def rewrite_query(path) options[:body] ? "#{path}?body=1" : path end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sprockets-helpers-0.2.1 | lib/sprockets/helpers/asset_path.rb |