Skip to content
Browse files

Add rake task for replacing url() with image-url() in scss

  • Loading branch information...
1 parent be3586b commit d327b60ac3d4f44b36e55a7fcf2a8308386f5555 @s-andringa s-andringa committed
Showing with 12 additions and 0 deletions.
  1. +12 −0 Rakefile
View
12 Rakefile
@@ -1 +1,13 @@
require "bundler/gem_tasks"
+
+desc "Fixes css image paths in scss files."
+task :fix_css do
+ Dir.glob(File.join("vendor/assets/stylesheets/dataTables", "*.css.scss")).each do |filename|
+ content = File.read(filename)
+ content.gsub!(/url\('\.\.\/images\/([A-Za-z0-9_]*\.png)'\)/) do
+ "image-url('dataTables/#{$1}')"
+ end
+ File.open(filename, 'w') { |f| f << content }
+ end
+ print "Done.\n"
+end

0 comments on commit d327b60

Please sign in to comment.
Something went wrong with that request. Please try again.