#!/usr/bin/env rake require 'bundler' require 'less' Bundler::GemHelper.install_tasks desc "Prepare bundle environment" task :pre do sh 'bundle install' end desc 'Make css' task :css do parser = Less::Parser.new :paths => ['less'] tree = parser.parse(IO.read('less/bootstrap.less')) ::File.open("css/bootstrap.css",'w') do |f| f.puts tree.to_css end ::File.open("css/bootstrap.min.css",'w') do |f| f.puts tree.to_css(:compress => true) end end desc "Build the gem" task :build do sh 'gem build *.gemspec' end desc "Bundle the gem" task :bundle do sh 'gem install *.gem' sh 'rm *.gem' end task(:default).clear task :css => :pre task :build => [:pre, :css] task :bundle => :build task :release => :build task :default => :bundle