jasmine-headless-webkit/coffee.watchr

14 lines
281 B
Plaintext
Raw Normal View History

2011-05-12 21:02:11 +00:00
require 'coffee-script'
watch('(jasmine/.*)\.coffee') { |m| coffee(m[1]) }
2011-05-12 21:02:11 +00:00
def coffee(file)
2011-05-12 21:02:11 +00:00
begin
File.open(file + '.js', 'w') { |fh| fh.print CoffeeScript.compile File.open(file + '.coffee') }
puts "Wrote #{file}"
2011-05-12 21:02:11 +00:00
rescue Exception => e
puts e.message
end
end