Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 53 lines (42 sloc) 1.184 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
yuic = 'yuicompressor-2.4.6'
yuicjar = "#{yuic}.jar"

def compress_css(source, target)
  sh "java -jar 'bin/yuicompressor-2.4.6.jar' --type css " +
    "--charset utf-8 -o #{target} \"#{source}\""
end

task :default => :site

directory 'bin'

file "bin/#{yuicjar}" => 'bin' do
  sh "cd /tmp && wget http://yui.zenfs.com/releases/yuicompressor/#{yuic}.zip"
  sh "cd /tmp && unzip #{yuic}.zip"
  rm "/tmp/#{yuic}.zip"
  mv "/tmp/#{yuic}/build/#{yuicjar}", "bin/"
end

directory 'css'

less = FileList['less/**/*.less'].exclude('less/**/*.inc.less')

less.each do |source|
  target = source.sub(/less$/, 'css.fat').sub(/^less/, 'css')
  file target => (['css'] + FileList['less/**/*.less']) do
    sh "lessc #{source} #{target}"
  end
end

css = less.map {|f| f.sub(/less$/, 'css').sub(/^less/, 'css')}
css.each do |c|
  file c => ["#{c}.fat", "bin/#{yuicjar}"] do |t|
    compress_css "#{t.name}.fat", "#{t.name}"
  end
end

"Generate CSS files from LESS source."
task :less => css
task :open do
sh "ruby clojure_toolbox.rb"
end
task :site => :less do
  sh 'jekyll'
end

task :watch do
  sh 'while inotifywait -r .; do rake; done'
end

task :deploy => :site do
  sh 'bin/deploy'
end
Something went wrong with that request. Please try again.