Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2327177e49
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 15 lines (13 sloc) 0.479 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
namespace :cdn do
  desc "Rewrite CSS files under ./public/ with CDN-friendly URLs"
  task :css_urls => :environment do
    require 'cdn_helpers'
    require 'pathname'

    public_root_path = Pathname.new('public').realpath
    FileList['public/**/*.css'].each do |css_file_path|
      css_file_path = Pathname.new(css_file_path).realpath
      public_path = Rails.root.join('public')
      CdnHelpers::CssRewriter.rewrite_css_file(css_file_path, public_path)
    end
  end
end
Something went wrong with that request. Please try again.