/ Published in: Ruby

Code for a Rake task that allows compiles all LESS stylesheets (.less) contained within a single directory.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
desc "Compiles all .less files in the stylesheets directory of a Rails application" task :less do require 'less' directory = 'public/stylesheets/' stylesheets = Dir.entries(directory) stylesheets.each do |sheet| if(File.extname(sheet) == ".less") `lessc #{directory + sheet}` end end end
Comments
