Created
September 17, 2011 22:45
-
-
Save connatser/1224454 to your computer and use it in GitHub Desktop.
Guard rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard 'rake', :task => 'parse_haml' do | |
watch(%r{_source/_layouts/haml/}) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Parse haml layouts" | |
task :parse_haml do | |
print "Parsing Haml layouts..." | |
system(%{ | |
cd _source/_layouts/haml && | |
for f in *.haml; do [ -e $f ] && haml $f ../${f%.haml}.html; done | |
}) | |
puts "done." | |
end | |
desc "Launch preview environment" | |
task :preview do | |
Rake::Task["parse_haml"].invoke | |
system "jekyll --auto --server" | |
end | |
desc "Build site" | |
task :build do |task, args| | |
Rake::Task["parse_haml"].invoke | |
system "jekyll" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment