jonleighton/spring — pull request #46 by senny (2013-02-03 13:18:19+00:00)
Title: detect project and rails root

WIP (do not merge yet)

This is a first stab at implementing the project/rails root detection with proper error messages. It works but when the project or rails root can't be detected spring crashes. I wanted to show you the current implementation to start a discussion.

Currently if the rails root can't be detected it fails like:

```
Spring was not able to locate the rails root of your project. You should:
- change your woring directory.
- configure the location of your rails application using `config/spring.rb`.

Spring used the following paths to detect the Rails root (`config/application.rb`):
pwd: /Users/senny/Projects/spring/test/apps
project root: /Users/senny/Projects/spring
/Users/senny/Projects/spring/lib/spring/application_manager.rb:53:in `run': undefined method `chomp' for nil:NilClass (NoMethodError)
from /Users/senny/Projects/spring/lib/spring/server.rb:39:in `serve'
from /Users/senny/Projects/spring/lib/spring/server.rb:31:in `block in boot'
from /Users/senny/Projects/spring/lib/spring/server.rb:31:in `loop'
from /Users/senny/Projects/spring/lib/spring/server.rb:31:in `boot'
from /Users/senny/Projects/spring/lib/spring/server.rb:9:in `boot'
from -e:1:in `

'
/Users/senny/Projects/spring/lib/spring/client/run.rb:56:in `call': undefined method `chomp' for nil:NilClass (NoMethodError)
from /Users/senny/Projects/spring/lib/spring/client/command.rb:7:in `call'
from /Users/senny/Projects/spring/lib/spring/client.rb:15:in `run'
from ../../bin/spring:4:in `

'
```