From dbd3d8ffc68db4bc2b32769778b86bb26965f3ec Mon Sep 17 00:00:00 2001 From: grosser Date: Thu, 26 Jul 2012 09:10:29 -0700 Subject: [PATCH] do not fail with missing root or missing .spin --- bin/spin | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/spin b/bin/spin index 665f065..cc3c4a4 100755 --- a/bin/spin +++ b/bin/spin @@ -60,7 +60,7 @@ end def serve(force_rspec, force_testunit, time, push_results, preload) root_path = rails_root(preload) and Dir.chdir(root_path) file = socket_file - Spin.parse_hook_file(root_path) + Spin.parse_hook_file(root_path) if root_path # We delete the tmp file for the Unix socket if it already exists. The file # is scoped to the `pwd`, so if it already exists then it must be from an @@ -291,7 +291,8 @@ module Spin end def self.parse_hook_file(root) - load(root.join(".spin.rb")) + file = root.join(".spin.rb") + load(file) if File.exist?(file) end private