From 2191bc1088c0379a7691005e8e788aacdd0538ca Mon Sep 17 00:00:00 2001 From: Thibaud Guillaume-Gentil Date: Wed, 20 Oct 2010 22:40:44 +0200 Subject: [PATCH] Rescue Interrupt on run yield --- lib/guard.rb | 5 ++++- spec/guard_spec.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/guard.rb b/lib/guard.rb index 94b81c3..4dfcc1f 100644 --- a/lib/guard.rb +++ b/lib/guard.rb @@ -63,7 +63,10 @@ module Guard def run listener.stop UI.clear if options[:clear] - yield + begin + yield + rescue Interrupt + end listener.start end diff --git a/spec/guard_spec.rb b/spec/guard_spec.rb index ab4863f..2c468b5 100644 --- a/spec/guard_spec.rb +++ b/spec/guard_spec.rb @@ -12,7 +12,7 @@ describe Guard do describe "locate_guard" do - it "should return guard-rspec pat" do + it "should return guard-rspec gem path" do Guard.locate_guard('rspec').should match(/^.*\/guard-rspec-.*$/) end