Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jzting/343029 to your computer and use it in GitHub Desktop.
Save jzting/343029 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
files = {}
loop do
Dir.glob("*.haml").each do |file|
ctime = File.ctime(file).to_i
if ctime != files[file]
files[file] = ctime
p "# recompiling: #{file}"
fork { exec 'haml ' + file + ' > ' + file.sub!(/\.haml/, '.html') }
end
end
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment