refactor something that was really starting to bug me
This commit is contained in:
parent
7ca6900570
commit
245eeba260
|
@ -22,17 +22,15 @@ module Guard
|
|||
end
|
||||
|
||||
def run_all
|
||||
run_something_and_rescue do
|
||||
UI.info "Guard::JasmineHeadlessWebkit running all specs..."
|
||||
JasmineHeadlessWebkitRunner.run if run_all_things_before
|
||||
@ran_before = false
|
||||
rescue ::CoffeeScript::CompilationError
|
||||
rescue StandardError => e
|
||||
puts e.message
|
||||
puts e.backtrace.join("\n")
|
||||
puts
|
||||
end
|
||||
end
|
||||
|
||||
def run_on_change(paths)
|
||||
run_something_and_rescue do
|
||||
paths = filter_paths(paths)
|
||||
@ran_before = false
|
||||
if run_all_things_before
|
||||
|
@ -44,11 +42,7 @@ module Guard
|
|||
run_all
|
||||
end
|
||||
end
|
||||
rescue ::CoffeeScript::CompilationError
|
||||
rescue StandardError => e
|
||||
puts e.message
|
||||
puts e.backtrace.join("\n")
|
||||
puts
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -91,6 +85,15 @@ module Guard
|
|||
system command
|
||||
$?.exitstatus == 0
|
||||
end
|
||||
|
||||
def run_something_and_rescue
|
||||
yield
|
||||
rescue ::CoffeeScript::CompilationError
|
||||
rescue StandardError => e
|
||||
puts e.message
|
||||
puts e.backtrace.join("\n")
|
||||
puts
|
||||
end
|
||||
end
|
||||
|
||||
class Dsl
|
||||
|
|
Loading…
Reference in New Issue