ember-script support

This commit is contained in:
heartsentwined 2013-04-25 11:34:55 +08:00
parent f86ec8b3b6
commit e9b224c091

View File

@ -1,12 +1,13 @@
require 'guard' require 'guard'
require 'guard/guard' require 'guard/guard'
require 'coffee-script' require 'coffee-script'
require 'ember_script'
module Guard module Guard
class JasmineHeadlessWebkit < Guard class JasmineHeadlessWebkit < Guard
autoload :Runner, 'guard/jasmine-headless-webkit/runner' autoload :Runner, 'guard/jasmine-headless-webkit/runner'
DEFAULT_EXTENSIONS = %w{js coffee} DEFAULT_EXTENSIONS = %w{js coffee em}
ALL_SPECS_MESSAGE = "Guard::JasmineHeadlessWebkit running all specs..." ALL_SPECS_MESSAGE = "Guard::JasmineHeadlessWebkit running all specs..."
SOME_SPECS_MESSAGE = "Guard::JasmineHeadlessWebkit running the following: %s" SOME_SPECS_MESSAGE = "Guard::JasmineHeadlessWebkit running the following: %s"
@ -88,6 +89,7 @@ module Guard
def run_something_and_rescue def run_something_and_rescue
yield yield
rescue ::CoffeeScript::CompilationError rescue ::CoffeeScript::CompilationError
rescue ::ExecJS::ProgramError
rescue StandardError => e rescue StandardError => e
if ENV['GUARD_ENV'] == 'test' if ENV['GUARD_ENV'] == 'test'
raise e raise e
@ -101,7 +103,7 @@ module Guard
class Dsl class Dsl
def newest_js_file(path) def newest_js_file(path)
Dir[path + '*.{js,coffee}'].sort { |left, right| File.mtime(right) <=> File.mtime(left) }.first Dir[path + '*.{js,coffee,em}'].sort { |left, right| File.mtime(right) <=> File.mtime(left) }.first
end end
end end
end end