Skip to content

Instantly share code, notes, and snippets.

@atambo
Created January 25, 2013 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atambo/4636450 to your computer and use it in GitHub Desktop.
Save atambo/4636450 to your computer and use it in GitHub Desktop.
namespace :assets do
desc "Make all embedded assets in stylesheets relative paths"
task :relativize => :environment do
Dir[Rails.root + "public/assets/*.css"].each do |asset|
contents = File.read(asset)
File.open(asset, "w") do |file|
file.puts contents.gsub("url(/assets/", "url(../")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment