From 7c37c80a9af84d05ea7c388df5cf0f026b751b20 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 17 Jun 2011 10:27:00 -0400 Subject: [PATCH] fix coffeescript compile error exceptions --- bin/jasmine-headless-webkit | 6 +++++- lib/jasmine/files_list.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/jasmine-headless-webkit b/bin/jasmine-headless-webkit index 496a76f..1b9b28a 100755 --- a/bin/jasmine-headless-webkit +++ b/bin/jasmine-headless-webkit @@ -11,5 +11,9 @@ $:.unshift(File.join(gem_dir, 'lib')) puts "Running Jasmine specs..." require 'jasmine/headless/cli' -exit Jasmine::Headless::CLI.run +begin + exit Jasmine::Headless::CLI.run +rescue StandardError => e + exit 1 +end diff --git a/lib/jasmine/files_list.rb b/lib/jasmine/files_list.rb index 23f07a4..6cda54e 100644 --- a/lib/jasmine/files_list.rb +++ b/lib/jasmine/files_list.rb @@ -76,7 +76,7 @@ module Jasmine CoffeeScript.compile(fh = File.open(file)) rescue CoffeeScript::CompilationError => ne puts "[%s] %s: %s" % [ 'coffeescript'.color(:red), file.color(:yellow), ne.message.to_s.color(:white) ] - exit 1 + raise ne ensure fh.close end