[Rails] Fixed a bug in asset hosts support when compiling outside the context of a controller.
This commit is contained in:
parent
8d938f3384
commit
6b8bbd22b1
@ -18,7 +18,6 @@ module Compass::SassExtensions::Functions::Urls
|
||||
path = path.value # get to the string value of the literal.
|
||||
# Short curcuit if they have provided an absolute url.
|
||||
if absolute_path?(path)
|
||||
puts "#{path} is absolute"
|
||||
return Sass::Script::String.new("url(#{path})")
|
||||
end
|
||||
|
||||
@ -44,7 +43,9 @@ module Compass::SassExtensions::Functions::Urls
|
||||
end
|
||||
|
||||
# Compute the asset host unless in relative mode.
|
||||
asset_host = (compute_asset_host(path) unless relative?)
|
||||
asset_host = if !relative? && Compass.configuration.asset_host
|
||||
Compass.configuration.asset_host.call(path)
|
||||
end
|
||||
|
||||
# Compute and append the cache buster if there is one.
|
||||
if buster = compute_cache_buster(path, real_path)
|
||||
@ -101,12 +102,4 @@ module Compass::SassExtensions::Functions::Urls
|
||||
end
|
||||
end
|
||||
|
||||
def compute_asset_host(path)
|
||||
if Compass.configuration.asset_host
|
||||
Compass.configuration.asset_host.call(path)
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user