require 'uglifier' task default: %w[build] task :build do puts "browserifying" puts system("browserify -t coffeeify browser.app.coffee > js/markdowntomla.js") puts "building minified self-contained index.html" html = File.read('template.html') bundled = html.split("\n").map{|line| if line =~ /\#{js}" else line end } File.open('built/index.html', 'w'){|f| f.puts bundled} end