diff --git a/doc-src/content/tutorials/configuration-reference.markdown b/doc-src/content/tutorials/configuration-reference.markdown index d62b89b7..ff6807d2 100644 --- a/doc-src/content/tutorials/configuration-reference.markdown +++ b/doc-src/content/tutorials/configuration-reference.markdown @@ -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 diff --git a/lib/compass/configuration/data.rb b/lib/compass/configuration/data.rb index 8ae6afa2..c2f88dd0 100644 --- a/lib/compass/configuration/data.rb +++ b/lib/compass/configuration/data.rb @@ -77,9 +77,19 @@ module Compass # 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