jasmine-headless-webkit/coffee.watchr

19 lines
403 B
Plaintext
Raw Permalink Normal View History

2011-05-12 21:02:11 +00:00
require 'coffee-script'
FILE = 'jasmine/jasmine.headless-reporter.coffee' if !self.class.const_defined?(:FILE)
TARGET = FILE.gsub('.coffee', '.js') if !self.class.const_defined?(:TARGET)
watch(FILE) { coffee }
def coffee
begin
File.open(TARGET, 'w') { |fh| fh.print CoffeeScript.compile File.open(FILE) }
puts "Wrote #{TARGET}"
rescue Exception => e
puts e.message
end
end
coffee