Skip to content

Commit

Permalink
[Rails] Fixed a bug in asset hosts support when compiling outside the…
Browse files Browse the repository at this point in the history
… context of a controller.
  • Loading branch information
chriseppstein committed Jul 7, 2009
1 parent 8d938f3 commit 6b8bbd2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions lib/compass/sass_extensions/functions/urls.rb
Expand Up @@ -18,7 +18,6 @@ def image_url(path)
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

Expand All @@ -44,7 +43,9 @@ def image_url(path)
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)
Expand Down Expand Up @@ -101,12 +102,4 @@ def default_cache_buster(path, real_path)
end
end

def compute_asset_host(path)
if Compass.configuration.asset_host
Compass.configuration.asset_host.call(path)
else
nil
end
end

end
end

0 comments on commit 6b8bbd2

Please sign in to comment.