refactor something that was really starting to bug me
This commit is contained in:
parent
7ca6900570
commit
245eeba260
@ -22,33 +22,27 @@ module Guard
|
||||
end
|
||||
|
||||
def run_all
|
||||
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
|
||||
run_something_and_rescue do
|
||||
UI.info "Guard::JasmineHeadlessWebkit running all specs..."
|
||||
JasmineHeadlessWebkitRunner.run if run_all_things_before
|
||||
@ran_before = false
|
||||
end
|
||||
end
|
||||
|
||||
def run_on_change(paths)
|
||||
paths = filter_paths(paths)
|
||||
@ran_before = false
|
||||
if run_all_things_before
|
||||
@ran_before = true
|
||||
if !paths.empty?
|
||||
UI.info "Guard::JasmineHeadlessWebkit running the following: #{paths.join(' ')}"
|
||||
JasmineHeadlessWebkitRunner.run(paths)
|
||||
else
|
||||
run_all
|
||||
run_something_and_rescue do
|
||||
paths = filter_paths(paths)
|
||||
@ran_before = false
|
||||
if run_all_things_before
|
||||
@ran_before = true
|
||||
if !paths.empty?
|
||||
UI.info "Guard::JasmineHeadlessWebkit running the following: #{paths.join(' ')}"
|
||||
JasmineHeadlessWebkitRunner.run(paths)
|
||||
else
|
||||
run_all
|
||||
end
|
||||
end
|
||||
end
|
||||
rescue ::CoffeeScript::CompilationError
|
||||
rescue StandardError => e
|
||||
puts e.message
|
||||
puts e.backtrace.join("\n")
|
||||
puts
|
||||
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
Block a user