Skip to content

Commit

Permalink
Make it easier to disable the asset cache buster.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Oct 9, 2010
1 parent 12f4bc7 commit 794703f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc-src/content/tutorials/configuration-reference.markdown
Expand Up @@ -260,3 +260,7 @@ that points to the asset on disk — which may or may not exist.
"v=#{deploy_version}"
end
end

To disable the asset cache buster:

asset_cache_buster :none
12 changes: 11 additions & 1 deletion lib/compass/configuration/data.rb
Expand Up @@ -77,9 +77,19 @@ def asset_host(&block)
# If the block accepts two arguments, it will also be passed a File object
# that points to the asset on disk -- which may or may not exist.
# When called without a block, returns the block that was previously set.
def asset_cache_buster(&block)
#
# To disable the asset cache buster:
#
# asset_cache_buster :none
def asset_cache_buster(simple = nil, &block)
if block_given?
@asset_cache_buster = block
elsif !simple.nil?
if simple == :none
@asset_cache_buster = Proc.new {|_,_| nil}
else
raise ArgumentError, "Unexpected argument: #{simple.inspect}"
end
else
if @asset_cache_buster
@asset_cache_buster
Expand Down

0 comments on commit 794703f

Please sign in to comment.