public
Created

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.